vi is a text editor of the Unix operating system.

learn more… | top users | synonyms

0
votes
1answer
14 views

How to read shell and insert in text (using Emacs)?

I want to read and insert output from shell (bash) in a text using Emacs. My idea is to do something like :r!ls in vi, but using emacs.
0
votes
1answer
30 views

How to apply “set number” to vi on root?

I'm using vi on centos 6.5 and added "set number" script to /etc/bashrc in order to look line numbers whenever boot. It works well to show it on user login but not root. How to apply "set number" of ...
1
vote
1answer
26 views

Is there such thing as a .virc for the vi editor?

I know that you can modify Vim with a .vimrc. Does Vi , the older version of Vim, have a .virc? If so, where can I find info on it? I am trying to turn on line numbers permanently instead of ...
2
votes
1answer
54 views

vim: insert enough spaces to align text to column number

COMP_ID=` echo $SRC | sed -e 's/.*COMP_ID=//' -e 's/:.*$//'` SRC_TYP=` echo $SRC | sed -e 's/.*SRC_TYP=//' -e 's/:.*$//'` DOC_TYP=` echo $SRC | sed -e 's/.*DOC_TYP=//' -e ...
0
votes
1answer
42 views

How to add a prefix to every row of a particular column in a csv file via command line on linux

So basically i am trying to achieve the following.    File before editing.  column-1,   column-2,  column-3,  column-4,  column-5 Row-1-c1, ...
0
votes
2answers
46 views

vi copy entire line in PuTTY

I have a very long XML string in a line of a log in vi/PuTTY. It is too long to drag the mouse over to copy to clipboard. Is there a shortcut to select/copy to clipboard the entire line? I do not want ...
0
votes
1answer
23 views

inputrc windows for ipdb kybinding

I am trying to get vi bindings for python debugger ipdb. I am not running cygwin's python but the windows version from the dos command prompt. I have tried creating .inputrc in my %HOMEPATH% ...
0
votes
2answers
56 views

Insert numbered text on every even/odd line

In Vim I have the following text: Door Chair Table Uganda And I want to add numbered text on every odd line, which should give this: >item1 Door >item2 Chair >item3 Table >item4 ...
2
votes
1answer
53 views

Why does Vim still have vi-compatibility mode? [closed]

Could anyone explain why does Vim still have vi-compatibility mode? Why would one use it? As a consequence, we have to keep set nocompatible in our .vimrc; there is much noise in docs like {not in ...
-1
votes
2answers
36 views

Can I remove a file frome inside` vi `?

I want to open several files with vi or even less and delete those I don't care without going back to the shell and go to the next.
0
votes
1answer
23 views

How do I use / interpret vi shortcuts on linux?

I've found myself in the dreadful predicament of having to use vi, and I don't understand this list of shortcuts for it. I'm in insert mode, and I want to save the changes that I've made so far and ...
0
votes
2answers
153 views

home/end in INSERT mode in vi on a Mac

On a Mac I can go to the start and end of an line in vi, when not in INSERT mode: ^ (start of line) $ (end of line) This is for example explained here: How do I do “end” , “home”, “page up” and ...
0
votes
1answer
208 views

vi Error | Out of memory saving lines for undo - try using ed

While executing the following command on a large file: vi largeFile.log I get the following error: Out of memory saving lines for undo - try using ed My environment is: AIX6 I cannot add any ...
0
votes
1answer
29 views

Arrow keys not working correctly in remote vi

I'm on a linux box connected with ssh to another linux box. When editing a file with vi, arrow keys work in default mode, but when I switch to edit mode ('a' or 'i') arrow keys output letters (like ...
1
vote
1answer
38 views

VIM - How to search and replace multiple strings using leader?

I'd like to make a leader shortcut for doing multiple global search and replaces in the current buffer. For example, pressing leader then "fq", I'd like it to search and replace 3 times globally, ...
0
votes
0answers
22 views

with rlwrap vi file edit not happening

Am using rlwrap,with that history fetch commands editing works fine. But in vi mode am not able to edit the file, and not able to exit from vi mode. I added following entries in inputrc, set ...
0
votes
1answer
32 views

What does “vi-move” keymap in Bash's vi mode actually do?

The keymap section in the Bash Reference Manual says that one of the acceptable options is "vi-move". There doesn't seem to be any description for what this corresponds to. I'm well acquainted with ...
0
votes
1answer
185 views

How to find special characters in Linux Vim

I want to find special characters in a text file. It is known that the UTF-8 encoded file contains Chinese characters , "-", "^A"(control-A, which is one of special characters), numbers, ...
1
vote
3answers
53 views

what's the meaning of ^@, ^I and $ in vi?

When I try to use Context.write(k,v) in MapReduce(using Java) to write data to a file ,I find the following contents in file(opened with vi, have :set list): ^@R^@u^@n^@^I1$ ^@a^@c^@c^@e^@s^@s^@^I1$ ...
0
votes
2answers
149 views

Notepad++ visibility for BOM

How to use the 6.2.3 version of Notepad++.I want to know how to make visible of BOM chanracters.I tried with menu list available but no use. But those characters are available only at Linux ...
-1
votes
1answer
71 views

When editing hosts file with vi , the added line gets repeated ad infinitum

Sometimes when I edit the hosts file by adding a new line, and when I do Esc, :, W, Q to save and exit, that line gets repeated infinite times in the file, and then gets saved. What am I doing wrong? ...
0
votes
1answer
25 views

Replacing values in a file using vi

I have a file which as multiple entries like "allowed_users 100", "allowed_hits 100", "allowed_users 10000". Want to replace the values of "allowed_users 100" to "allowed_users 1000". Best Wishes, ...
1
vote
0answers
97 views

Tmux and Vi in PuTTY = No arrow keys in Vi

I'm using PuTTY as my terminal with tmux. At first I couldn't resize panes so based on this thread I added the below to my .tmux.conf" set -g terminal-overrides ...
0
votes
2answers
60 views

Terminal Program To Save VI State

For a few years now at work I have been using the GNOME Terminal, and have gotten very used to that. I usually organize my work by categorizing each task on its own virtual desktop, then within each ...
0
votes
3answers
167 views

Unnecessary indenting in bash

I have been trying to paste text from one file to another in bash. I'm working in Putty. To be more clear, I have a file hotel.txt with some lines of text that are indented, thus have tabs and ...
4
votes
1answer
312 views

Hiding vim command-line when it's not being used?

Is there any way to hide the vim command-line (ideally, automatically) when it's not being used? On small screens it takes up one valuable line. I'm thinking it would be 'normally' hidden, and appear ...
1
vote
1answer
582 views

Why config file of vi is not named .virc but .exrc? [closed]

Just from curiosity I want to know why .exrc is not named .virc? Is there reason for it?
1
vote
1answer
30 views

How do I save from VI to a pipe?

I've seen lots of ways to redirect input from stdin to VI, but I'd like to redirect VI to save to a pipe rather than a file. For example, I'd like to pipe VI's entire pipe buffer to another text ...
1
vote
1answer
77 views

how to type foreign language in vi editor

I want to type text as \documentclass{article} \usepackage{fontspec} \setmainfont{Aparajita} \begin{document} \section*{इनपुट साधने ऑनलाइन वापरून पहा} आपण निवडलेल्‍या भाषेमध्‍ये टाइप करणे सोपे बनवतात ...
0
votes
3answers
345 views

Is there a command to split lines in vim?

In vim, the J key joins two lines together. Is there a similar, built-in, key combination to split lines with a newline (at the cursor position, or similar)? Alternatively, what would be the most ...
3
votes
1answer
208 views

How to cut and paste tabbed lines with auto indent set to on in vi

Not sure which stack exchange group this question goes so please move to the correct one if this is the wrong one. What's happening is if I highlight something with tabs/indents from one ...
13
votes
4answers
1k views

Inserting a blank line in vim?

I quite often find I have a need to insert a blank line either below or above the current line when editing in vim. o and O will do this, but they subsequently switch into insert mode, which is ...
0
votes
1answer
204 views

Selecting all text in Vi/Vim through PuTTY

I need to select the text in a log file (~900 lines) and paste it into a normal text file. However, I am on my server via PuTTY so when I do :%y+ or gg"+yG it does not let me paste it. By any ...
0
votes
2answers
197 views

vim - open files containing a specific string in new tabs

I am looking for a way to open all files that contain a specific string in new vim tabs. The files are not in a specific directory, but scattered across a directory tree. Ideally I want to jump to ...
0
votes
1answer
70 views

Creating a file through a dangling symlink with vi

This is the content of my typescript file, /mac>ln -s non_exist ~/link /mac>vi ~/link Hi! I am a link. /mac>cat ~/link Hi! I am a link. /mac>cat non_exist cat: non_exist: No such file or ...
4
votes
1answer
220 views

how do I go from typing `/foo` to `:%s/foo/bar` efficiently

In vim, I typed /foo Enter and found some matches. Now I want to replace all instances of foo with bar (i.e. :%s/foo/bar). Can this be done without retyping the foo? (e.g. into the command line ...
1
vote
2answers
474 views

Increase the space between lines in vim

I think the title says it all. I've done my homework and the only command that I found was: :set linespace=3 but it doesn't seem to work, neither on the Mac nor in Linux. Edit: In Mac OSX you can ...
0
votes
1answer
65 views

Getting rid of characters when doing gf in vim

I am using vim for coding. When I have something like the following: SomeModule->actualMethod() if I take the cursor to SomeModule and I do a gf I get a complaint that SomeModule- does not exist in ...
0
votes
1answer
87 views

Is there a way to filter out filenames from vim's “oldfiles”, perhaps using a pattern?

I use vim's :browse oldfiles a lot to edit files I've recently worked with. However, there are some files, such as git's auto-generated COMMIT_EDITMSG, which clutter that list and which I never need ...
0
votes
2answers
142 views

What does shiftwidth do in VIM editor

I read this about shiftwidth option on Google: To change the number of space characters inserted for indentation, use the 'shiftwidth' option. Ok Ok, but what's that more exactly? How can I try this ...
-1
votes
1answer
189 views

Cannot use vi editor

When I try to launch vi using vi or vim, it fails to start. ozzesh:~ # clear ozzesh:~ # vi ozzesh:~ # echo $? 0 ozzesh:~ # The above vi / vim command can't launch vi.
3
votes
2answers
590 views

vi/vim alternative to sublimetext's “Expand selection to scope”

Sublime text has a cool feature called "Expand selection to scope" SHIFT+CMD+SPACE which selects the everything within the scope. It select everything in scope, works perfectly ( ) or [ ] or { } ...
3
votes
2answers
109 views

vi swap file is empty

If vim crashes and leaves me with a .swp file that is empty (i.e., file size = 0), does that mean I didn't make any changes to the file during the session in which my computer crashed? If so, then is ...
2
votes
2answers
219 views

Why provide vi and vim?

I think I'm right in saying RedHat and other distributions provide both vi and Vim. Does anyone know what the rationale is behind providing both when presumably if Vim is provided it covers the ...
1
vote
1answer
105 views

Bash readline move cursor to previous forward slash

In bash , we can move back or forward by 1 word or character. Is there any option where i can move the cursor to the previous character that i specify, for example Forward Slash. ? Something like the ...
2
votes
4answers
194 views

In vim, what keystrokes (did I accidentally hit to) bring up :'<,'> and how do you set those marks?

I fumbled in vi and briefly saw this at the bottom of the screen, just as I was hitting ESC: :'<,'> Like it was ready for me to type an arbitrary ed command over a range spanned by the marks ...
1
vote
2answers
32 views

how to match string in “sk_term(” in vi

I have a sql file where I want to match the string "sk_term(" in the file when I am using :/sk_term( it giving the following error E486: Pattern not found: sk_term(
4
votes
2answers
1k views

Error location navigation in Vim Syntastic

I've got Syntastic installed in Vim and it is finding errors perfectly (mostly in Python code I'm working on). If I jump around normally in the file I see the errors in the status bar when the cursor ...
0
votes
1answer
361 views

Is it possible to launch MacVim NOT in full screen mode?

Whenever I Launch MacVim it takes up the whole screen. I don't want this. Is there any way to prevent it from happening? I run OS X 10.8.
1
vote
1answer
326 views

Vim has unexpected key presses on startup, what could be causing this?

Whenever I open a file with vim, the vim session starts with 2c having been automatically/programmatically 'pressed'. This means that if I start off trying to move down the file by pressing j, then ...