Questions tagged [vi]

vi is a text editor of the Unix operating system.

Filter by
Sorted by
Tagged with
0
votes
0answers
9 views

Changing bash prompt in operator pending mode

I'm pretty happy with the normal and insert mode being visible in my prompt thanks to my .inputrc file: set vi-cmd-mode-string : set vi-ins-mode-string + However there are other two "modes" which ...
0
votes
0answers
14 views

Linux account will no longer let me edit or create files

I was editing a file and Instead of typing ZZ to save and exit I typed something else by mistake. I think it might have been either ctl-z or ctl-c . Anyway it ended up abending the vi session. When I ...
0
votes
1answer
35 views

Use sed to replace part of a string leaving other part represented by regex unchanged

Consider you want to replace part of a sentence and leave other part represented by the regular expression (regex) unchanged. For instance, here's a text file text1.txt A Egg b Egg C Egg D Egg E ...
0
votes
0answers
40 views

Why is Mobaxterm not copying all my lines in my clipboard?

I have trouble copying the lines i have in my clipboard into Mobaxterm (In a VI file with Unix) since it is not copying all my lines, only certain amount and may cut a line in half at the end
1
vote
2answers
28 views

how to switch tabs in vim when openning vim using -O option

I opened two files using -O vim file1 file2 -O it opens the files horizontally aligned but I dont know how switch between them ?
1
vote
1answer
217 views

my WSL ubuntu vi editor screen is broken when I scroll down

When I scroll down at my vim editor, all of my codes is wrapped with strange boxes. Can I fix it? My .vimrc file: Problem Image:
0
votes
1answer
117 views

No color in vim with SSH on Linux server

At work, I use SSH to remotely connect on servers to edit files. As I got quickly bored of vi, I built a local vim, years ago, and everything worked fine. As my profile is shared between almost all ...
0
votes
0answers
80 views

.vimrc file works with csh, not bash

My .vimrc file installs some plug-ins and enables syntax. With csh, all of this works perfectly. But when I switch to bash, none of these options work anymore; I get errors for the plug-in manager and ...
0
votes
0answers
19 views

Vi Editor does not work properly under cmder when connecting to a Ubuntu Server VM

I connected to a local Ubuntu-Server 18.04.2 VM (created with virtualbox) via SSH in cmder. When I try to use vi to edit text files the display looks strange: 1. Only the top part of the screen is ...
0
votes
0answers
65 views

Vim : The “:bnext” command — Is it working properly?

According to Vim's documentation for the command :bnext (bn), if you have multiple help buffers open, you should be able to use :bn to move to the next buffer displaying help documentation. My ...
0
votes
0answers
28 views

Vi on macOS pastes single quotes as “â<9c>” and double quotes as “â<99>”

If I copy text from a book or a web page which contains quotes and then paste that text into a file opened with Vi, the single quotes come out as â<9c> and the double quotes come out as â<99&...
1
vote
1answer
131 views

How to enable VI key binding in cmder?

In linux terminal we can easily enable vi key-binding mode with commands like set -o vi. Does cmder on windows provide any such feature? Or Is there any hack available to do so?
0
votes
1answer
180 views

Confusing text when editing .bash_profile

I am running MacOS v.10.13.6, and in Terminal I was installing pipenv by following a tutorial. As part of the installation I went to edit bash_profile with vi editor in order to add 3 directories to ...
2
votes
1answer
47 views

How to make Vim “repeat search” direction absolute instead of relative?

I am looking for a way to make Vim always go backwards whether I press repeat last , or N and forward when using their pairs ; or n. Currently Vim is using a relative direction which depends on the ...
0
votes
0answers
49 views

when I'm trying to open file in vi mode its prompting help.txt, How to resolve this issue

When I'm trying to open file in vi mode its prompting help.txt as shown below. I tried to close it by using :q, for few seconds its closing again im getting help.txt. i;m not able to edit my file. ...
0
votes
0answers
26 views

Stop users from using vim to overwrite file

I have a program that's generating a hash file that only root has the permissions to read and write. Why am I still able to use vi to open it ( not being able to read anything ), then using the :wq! ...
0
votes
1answer
10 views

Stack line numbers/file locations in vi

A lot of the time I'm reading through code and going from function to function, simulating a call stack. Once I get to the bottom, I need to work my way backwards to see how the returned values are ...
-2
votes
1answer
66 views

What time is it? - Fewest number of keystrokes in vim? [closed]

Task: display current time to the vim user. It is not a matter of inserting the time into a document, which one can easily do with e.g. !!date. In my question, the user simply wants to know what time ...
1
vote
2answers
3k views

OpenSSH via powershell - vi turns prompt blue

I'm on Windows 10, using Win32-OpenSSH via Powershell to connect to a CentOS 7 machine on my network. If I launch vi on a new file, or on occasion open other files, any and all new text in my window ...
0
votes
1answer
208 views

Copying/Pasting a block of lines in vi editor

I have a strange problem when copying/pasting a group of lines within vi. For example, let us say we have a group of lines as follows: AAAAAAAA AAAAAAAAAAAAAA BBBBBB BBBBB BBBBBBBBBB CCCCC ...
10
votes
2answers
3k views

Why is VIM starting in replace mode?

On several new CentOS 7 machines, I find that VIM automatically starts in replace mode. After removing all automatically installed .vimrc files, normal behavior returns. However, if I simply create a ...
1
vote
1answer
713 views

reload file in vim without scrolling

Is it possible to :e a buffer in vim without having the scrolling adjusted? The behavior I see: the file is reloaded followed by a zz (redraw with line count at center of window). I'd like to just ...
3
votes
1answer
578 views

How to paste vim command into vim editor on mac

I have a bunch of vim commands that I keep in a file because I don't find them easy to remember. I want to paste them into whatever vim session I'm running. However, since upgrading to High Sierra, ...
0
votes
0answers
83 views

screen and $TERM and misformatted vi

I'm ssh'ing from my Mac (Terminal.app) into a Linux box, where I need to run ckermit or screen over USB to have a console on a second Linux box. (There are no graphics on the second box, and I'm ...
12
votes
2answers
4k views

How to use vimium to select text from a page

Background I'm a religious fanatical devoted believer of vimium. It speeds up my internet usage like nothing else. I'm also (naturally) a heavy user of vim itself. Question How can I actually ...
-1
votes
1answer
2k views

If/Else Statements Linux, Vi , Simple Scripts

First I have tried finding answers to my questions and it's really difficult for a newbie to phrase his questions in a way that yields online results with answers relevant to the situation at hand. ...
2
votes
3answers
124 views

How can I substitute multiple instances of a character with the same number of instances of a different character in linux sed?

I need to substitute a repeating set of characters (2 or more) with the exact number of replacement characters. I need to do this either with sed, or within vi. Examples "abc,,,def" becomes "abc|||...
0
votes
1answer
344 views

Why is bash not recognizing my newline character?

I am trying to get a script to reverse the order of entrees ( yes I know "tac" command already does this) my script is as follows, The print F line that prints the array value and then is followed by ...
0
votes
1answer
90 views

VI Ctrl+W terminal Alternative

Is there a mouse control short cut to Ctrl+W, like Option+click, to go to any screen directly? I dont want to cycle through all windows, instead want to directly go to say 7th screen, of the 10 split ...
0
votes
1answer
883 views

Reconnect to accidentally stopped vi session (git commit)

On Cygwin, I accidentally pressed Ctrl+Z while in vim. I was editing a git commit message. This resulted in $ git commit -a [1]+ Stopped git commit -a I think the vi session is ...
0
votes
0answers
410 views

How can I make `file -i` command return ISO-8859-9?

Let's say I have a text file with content şşş and in vi/vim I have set fileencoding as :set fileencoding=ISO-8859-9. Later when I check the encoding with file -i <myFile> it gives text/...
0
votes
0answers
45 views

Have vim not caring about the capslock state in normal mode

I would like to know if it is possible (and if yes, how) to have vim (or another vi-like editor, really. Changing from vim to another one would not annoy me that much, as long as the editor is usable ...
1
vote
1answer
287 views

How to enter Vi / Vim command mode with `;` instead of `:`?

When using Vi or Vim, I need to perform the following sequence to save a file: esc + :s But the : key is hard to reach on my keyboard. So I would like to switch : and ; so that I can type esc + ;s to ...
2
votes
1answer
2k views

Close multiple files in vi

If I open multiple files in vi using vi *.py then how do I exit the whole vi session instead of editing each and every file? Seems like a simple enough issue but can't find anything on google.
-1
votes
1answer
225 views

How to map cw to ciw in Vim

I almost never use the cw in Vim. Instead I use ciw. Is there a way to make cw do the same thing as ciw? I have tried googling and looking in the man page but I have not found a clear answer.
2
votes
1answer
241 views

vim shortcut for moving to beginning of previous line not working

Pressing Shift and + takes me to first non whitespace character of the next line. I expected that Shift and - would similarly take me to first non-whitespace character of the previous line. But, it ...
0
votes
1answer
105 views

Can tab be remapped in nvi?

I want to map tab in nvi(1). When I try to map a literal tab by typing Ctrl+V then Tab, it does not get rendered as ^I and nvi(1) shows "Usage: map[!] [keys replace]". Can tab be remapped in nvi?
0
votes
1answer
235 views

Copy and paste using vi duplicates comment lines

On a windows PC, I copy the following to the tooltip. var http = require("http"); http.createServer(function (request, response) { // Send the HTTP header // HTTP Status: 200 : OK // ...
1
vote
1answer
37 views

Is it possible to change permission of group by VI editor

I'm new to vi-editor and trying to edit permission of mc (Midnight Commander) group by vi-editor. I try to locate where is mc: vi /usr/share/mc but it gives me empty file and says mc is a directory.....
0
votes
1answer
2k views

Trying to edit file in vi and it crashes [1]+ Stopped

Found this question, this is what I see: Swap file error message while trying to edit .vimrc file? But in my case, I can delete swap files, try to edit file and Ctrl-Z and I get this: [6]+ Stopped ...
0
votes
1answer
47 views

Prevent Vim from selecting less than 2 characters?

I use Vim more and more, and I installed the plugin ideaVim in my IDE from JetBrains (pyCharm, phpStorm). I still use the mouse a lot to navigate and select text, and sometimes when I click in the ...
1
vote
0answers
107 views

Make part of php comment line bold in vim

I've a PHP script, and I would like to know if natively, I can make a part of a comment line BOLD. For example a comment : // it is released when you execute RELEASE_LOCK(), execute a new GET_LOCK()...
0
votes
2answers
78 views

VI - Paste something in the first position/character of a succession of lines

I would like to yank one character and paste it in the first position of the succession of lines. For example, I need to add a "#" in the front of 7 lines of a file. Someone can help me?
0
votes
4answers
5k views

How to extend vim editor to full screen in putty?

When I use vi or vim to edit files in putty, it only shows a limited lines and columns. So how to extend the editor to full screen?
4
votes
5answers
25k views

How do I copy text from window text editor to nano/vi in a Putty window

I was following some guide to create key-pair for my remote linux system, one of the steps being copy the public key generated and saved on my local computer to the authorized-keys file on remote ...
5
votes
1answer
115 views

Trouble defining an environment variable on Cygwin

I'm using the Cygwin 64-bit installation on my Windows 7 machine. In my ~/.bash_profile, I set export JBOSS_HOME=/cygdrive/c/Program\ Files/wildfly-10.0.0.CR2/ However, when I attempt to open a ...
1
vote
2answers
372 views

Vim; Shortcut to add comment at beginning of line

When I code, I tend to execute the following manually a lot after having selected multiple lines of code. :'<,'>s/^/#/ I want to add this to my .vimrc but I am having troubles making it work. ...
0
votes
2answers
1k views

Vi copy and paste is not working

When I open vi/vim in conemu I am unable to paste text from clipboard (mouse right button), and unable to copy file to clipboard (mark text). However in git bash everything works fine. Any clues?
0
votes
0answers
42 views

Does VIMProbable have register support?

VIMProbable is a browser that works using vi keys. Does it have support for storing text in registers?
0
votes
1answer
294 views

Cannot Suspend vi with Ctrl-Z

It's on an AIX 6.1 connected via PuTTY 0.65. If I open a file and hit Ctrl-Z then. It works 1st. But when I switch back and hit Ctrl-Z again. A square cursor jumps to the bottom. I can type something ...

1
2 3 4 5