vi is a text editor of the Unix operating system.

learn more… | top users | synonyms

0
votes
0answers
13 views

PuTTY causes vi to open help.txt on SSH session

When I connect to my server running openSuse 13.1 via ssh and open any file in vi, after some time it automatically opens the help.txt (just like the action on pressing F1). If you close the "help" ...
0
votes
0answers
6 views

Show previous line of search pattern

I want to display the previous line for a search pattern for example - "TELEVISION"."CHANNEL" (TableId 0211H 4A90H) bypassed due to pending FastSearch. The pattern I use to search for is FastSearch ...
0
votes
0answers
22 views

Vi scrolling in Firefox/Chrome

Is there a way to rebind j and k to scroll pages in Firefox or Chrome, or addons available just for vi-like scrolling that aren't entire emulators like vimperator and vimium? All I want to do is ...
-1
votes
2answers
29 views

vi: How do I save without exiting the editor?

Any way to save changes in vi without exiting the editor? I'm experimenting with php and checking my work in the browser. To get back to my code I have to reopen the php file which is an extra step. ...
1
vote
0answers
38 views

How to change BASH “editing-mode vi” shortcuts?

I'm trying to change my bash vi mode keys to enter and exit insert mode, I would like to set these shortcuts: Ctrl-\ : Enter moviment mode Alt-\ : Enter insert mode how can I do that? I'm trying ...
0
votes
0answers
10 views

How to make vi hex edit display similar to UltraEdit?

UltraEdit and vi both support hex edit. In UltraEdit content is very readable and easy to understand, but in vi it looks very different. How do I make both display in the same way? I use "%!xxd" ...
0
votes
1answer
17 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
35 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
37 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
160 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
86 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
74 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
37 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
75 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
55 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
39 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
25 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
266 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
354 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
39 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
52 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
27 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
44 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
217 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
57 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$ ...
1
vote
2answers
307 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
73 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
102 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
61 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
190 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
379 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 ...
2
votes
1answer
722 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
31 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
79 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
451 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
252 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
241 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
255 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
83 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
237 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
661 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
70 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
97 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
165 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
211 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.
5
votes
2answers
698 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
120 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
227 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 ...