vi is a text editor of the Unix operating system.

learn more… | top users | synonyms

0
votes
1answer
17 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
17 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
21 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
11 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
15 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
89 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
44 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
41 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
66 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
22 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
78 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
3answers
113 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 ...
3
votes
1answer
205 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
352 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
29 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
62 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
137 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 ...
2
votes
1answer
145 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
623 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
143 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
135 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
46 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
189 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
236 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
54 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
75 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
87 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
151 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
440 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
100 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
196 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
83 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
161 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
31 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
813 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
258 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
254 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 ...
1
vote
2answers
65 views

Why am I not able to go to the next matching entry in vim by just pressing n?

vimtutor says this in lesson 4.2 : The search command In Normal mode type the / character. Notice that it and the cursor appear at the bottom of the screen as with the : command. ...
1
vote
1answer
244 views

Vim: edit multiple lines

I was looking for a way to edit multiple line simultaneously. I found that Ctrl-V + selecting the lines + I should be the solution. The problem is that, for me, after pressing I (in fact Shift-i) I'm ...
0
votes
2answers
50 views

In vi, how can I navigate to the function declaration?

In Vi, if I am in the middle of a function, how can I navigate back to the function declaration?
5
votes
2answers
326 views

Edit text areas using vi key bindings, inside the textbox, in Firefox (without opening a separate window)

I'm using Firefox. Is there any way to edit the contents of a textbox using vi key bindings, inside the text area (not in a separate window)? For instance, is there a Firefox extension for that? I ...
0
votes
3answers
1k views

What is the keyboard shortcut to go to the end of the file in vi?

I'm using putty to view a 30+MB file in vi on a Linux server, and I have to use PgDn to scroll to the bottom of the page. I realize I can use tail but I want to be able to move up and down the file ...
1
vote
2answers
139 views

need to get rid of strange symbols in text

I need to process the following text to get rid of the strange symbols such as: â<80><99> â<80><9c> â<80>? Example text: With the mystery unexplained, the Hyatt ...
4
votes
2answers
92 views

Escape not idempotent in zsh's vi emulation?

I have zsh configured to use vi keybindings. I've noticed some unexpected behavior with "escape". In vim (I haven't tested vanilla vi) if I hit escape twice, I can hit 'i' once to return to insert ...
2
votes
2answers
143 views

In Vim, what are the differences between using :sus and :sh to access the shell without ending the Vim session?

I know that, while in Vim (and Vi, too, I think), if I want to temporarily access the shell I can do one of several things: Use :sh (a.k.a. :shell), then log out from the shell to return to Vim Use ...
2
votes
2answers
362 views

How can I remap CAPSLOCK key to ESC in Cygwin?

How can I remap the Capslock key to ESC in a Windows Cygwin shell? Ideally I would only remap the value in Cygwin shells instead of everywhere, preserving behavior in other apps (although admittedly ...
1
vote
3answers
1k views

Vim is not reading gzipped files automatically

I want to see some zipped log files .gz in unix through putty. When I open them in vim the contents are not readable. I think vim is not able to unzip them.
3
votes
3answers
3k views

How to get vim color mode to work in vim under cygwin

I have installed vim 7.3 under cygwin. And I have this in my ~/.vimrc $ cat .vimrc colorscheme wombat And then I have this file wombat.vim under '.vim/colors'. $ ls -la .vim/colors/ total 8.0K ...
0
votes
1answer
52 views

How to add a shell output content to vim?

When using vim, we can use :!ls to execute shell command, but how can we import the ls output into vim for editing?
1
vote
2answers
523 views

Copy visual mode selection below selection in vi

In vim, I often find myself repeating the same steps to copy a section before making changes to it: V to start Visual mode linewise j until I have selected the section I want to copy y to yank the ...