Most Popular
1500 questions
146
votes
17 answers
Other ways to exit Insert mode besides Escape
The primary reason I like vim over emacs is that my hand movement distance away from the home row is very low (even as a programmer). However, the one main time that I do this is leaving insert mode, by pressing Escape.
I recently learned that I can…
durron597
- 2,161
- 3
- 17
- 14
143
votes
7 answers
How do I install a plugin in Vim/vi?
How do I install a plugin in Vim?
Does it matter:
Whether I use vi or Vim?
Whether I use gVim?
Which version of Vim I'm using?
What my OS is?
elyashiv
- 2,429
- 2
- 18
- 23
138
votes
8 answers
How can I easily move a line?
What is the command (or shortcut) to move a line up or down in vim? My current workflow is to yank (copy) the line and than delete that line and than to put (paste) that line.
Vader
- 1,635
- 3
- 12
- 7
137
votes
6 answers
How do I jump to the location of my last edit?
I often make changes to the middle of a big file, use gg to jump to the top to check something, and then realize I forgot to set a mark where I was editing. Is there a built-in way to jump to the location of the last-changed line?
bdesham
- 2,983
- 2
- 18
- 20
136
votes
3 answers
How do I navigate to topics in Vim's documentation?
In Vim's built-in help system, how do I…
search for topics that I want help on?
follow hyperlinks?
browse around for related material?
romainl
- 40,486
- 5
- 85
- 117
135
votes
5 answers
How to replace tabs with spaces?
Is it possible to convert tabs to spaces, while maintaining text alignment?
Simply replacing only works usefully when there are no leading characters.
ideasman42
- 3,733
- 3
- 27
- 34
129
votes
4 answers
Is it possible to split Vim window to view multiple files at once?
When working with multiple files, it would be very handy if we can see more than one file in the screen at once. Is there any way in Vim to split the window (horizontally or vertically) so each split can show a different file?
thameera
- 17,434
- 16
- 40
- 42
126
votes
7 answers
Is there a way to count the number of occurrences of a word in a file?
Is it possible to count how many times a word or a pattern appears in a file? This is sometimes useful to find out how many times a function has been called, etc.
thameera
- 17,434
- 16
- 40
- 42
124
votes
8 answers
How to share config between Vim and Neovim
I started using Neovim and moved my .vimrc to .config/nvim/init.vim and other stuff is located in .local/share/nvim.
What is the best way to share configs or even plugins between Vim and Neovim?
Symlinks? Can I change the directories in the .vimrc…
lumbric
- 1,529
- 2
- 9
- 9
118
votes
9 answers
What is the command for "Select All" in Vim and VsVim?
How do I select all the content of a file in Vim and VsVim? Like in other editors Ctrl-A does the job for select all.
Armaan
- 1,283
- 2
- 9
- 6
118
votes
5 answers
How to join lines without producing a space?
The standard J command for joining lines replaces the newline character(s) with a space. It's useful when editing 'literature' but can be troublesome if I, say, edit a hex dump by hand if I forget to remove the superfluous space.
Is there a quick &…
SF.
- 2,089
- 4
- 15
- 14
116
votes
8 answers
How to edit binary files with Vim?
Is there a way to edit binary files in some kind of hexadecimal mode?
For example if I have some binary data shown by xxd or hexdump -C like this:
$ hexdump -C a.bin | head -n 5
00000000 cf fa ed fe 07 00 00 01 03 00 00 80 02 00 00 00 …
janos
- 2,818
- 2
- 14
- 27
116
votes
16 answers
How do I delete a large block of text without counting the lines?
In vim, I often need to delete, or yank/put large blocks of text.
I can count the lines of text and enter something like 50dd to delete 50 lines.
But that's a bit of a pain. How can I delete this large block of text without having to know how many…
user579
112
votes
1 answer
How to debug a mapping?
I see a lot of questions on here where a user has a mapping which doesn't work
and most of the time the reasons are pretty similar.
I suggest to make this question a reference for this kind of questions, to give a complete procedure to debug a…
statox
- 49,782
- 19
- 148
- 225
111
votes
8 answers
How do I debug my vimrc file?
I have a problem in Vim, and I think it may be in my vimrc file (or have been told it could be my vimrc file).
How do I verify this? If it is my vimrc file, how do I know where exactly the problem lies?
Martin Tournoij
- 62,054
- 25
- 192
- 271