Most Popular

1500 questions
513
votes
15 answers

How can I copy text to the system clipboard from Vim?

Is there a way to copy a block of text to the system clipboard, so I can paste it in another program?
thameera
  • 17,434
  • 16
  • 40
  • 42
330
votes
6 answers

How do I reload the current file?

Quite often I am working with files that are version controlled, so it is possible for changes to be made to them outside of Vim. What is a quick way to reload the file without having to close and reopen Vim? And is there a way to do this…
Kevin Brown-Silva
  • 5,833
  • 5
  • 19
  • 20
315
votes
10 answers

What are the differences between the Vim plugin managers?

I have been looking at the different package managers for Vim, and the one I decided to use is vim-plug. However, I have seen others like pathogen and vundle, and I honestly don't know what the difference is. Can someone give me a brief overview of…
ZucchiniZe
  • 3,253
  • 3
  • 12
  • 6
260
votes
13 answers

How can I see the full path of the current file?

When I'm editing a file in Vim, is there a command to see the path of the current file? Sometimes this is very handy if there are multiple files with the same name in a project.
thameera
  • 17,434
  • 16
  • 40
  • 42
237
votes
6 answers

How do I change the current split's width and height?

I am working on split (using ^w+v, ^w+s) buffers, but sometimes I would like to widen a current split or change its height. How can I achieve that?
Nebril
  • 3,427
  • 4
  • 16
  • 13
237
votes
6 answers

Why doesn't the backspace key work in insert mode?

Trying to delete characters in insert mode with the backspace key sometimes doesn't seem to work. I can backspace sometimes, but at other times it does nothing; the cursor doesn't go to the left, and absolutely nothing seems to happen. I noticed…
glS
  • 3,869
  • 4
  • 18
  • 16
211
votes
6 answers

What's the simplest way to strip trailing whitespace from all lines in a file?

It's pretty common when programming or opening text files to encounter files with trailing whitespace at the end of a line. vim has a way to show this by setting the trail option in the listchars option and then turning list on. However, what's the…
Andrew Ferrier
  • 6,729
  • 7
  • 28
  • 41
209
votes
9 answers

How can I display tabs as characters?

When I work on files in python, I sometimes mistake tabs for spaces and vice versa. Is there a way I can get Vim to display a character for a tab instead of a tab?
Dom
  • 3,314
  • 5
  • 21
  • 38
208
votes
11 answers

How do I use Vim as a diff tool?

I use Vim as my primary editor. I would also like to use vim to diff files and modify the files while doing the diff to fix easy changes (rather than most diff techniques which are a cycle of diff, fix, diff, fix). Additionally are there easy ways…
Martin York
  • 6,542
  • 4
  • 20
  • 26
197
votes
6 answers

What is Neovim, and how is it different from Vim?

I've been hearing about Neovim; how does it differ from Vim? All the points on the homepage are just architectural changes 'under the hood'. As a user, what's the difference for me?
Martin Tournoij
  • 62,054
  • 25
  • 192
  • 271
194
votes
9 answers

Does Ex mode have any practical use?

Vim has an Ex mode that can be entered by entering Q, and a command line mode that can be entered with q:. A common complaint amongst new vim users is that they enter these modes accidentally when trying to quit vim. As such, I disable these keys in…
Andrew Ferrier
  • 6,729
  • 7
  • 28
  • 41
174
votes
2 answers

How can I use Vim as a hex editor?

Is there a neat way I can view binary files as hex in Vim, and save it back to binary from the hex?
nos
  • 1,893
  • 2
  • 13
  • 7
158
votes
10 answers

How to format JSON file in Vim

Given a file with a large JSON object all on one line like {"versions":[{"count":2,"version":""},{"count":1,"version":"1.1.1"},{"count":14,"version":"2.9"},{... How can I format this to be human readable in Vim?
ljs.dev
  • 2,677
  • 2
  • 11
  • 10
152
votes
4 answers

What is the Vim8 package feature and how should I use it?

Vim 8 was released today and the release notes mentions a new "package" feature. What is it and how should I use it? Most importantly, does it replace the good old plugin managers?
statox
  • 49,782
  • 19
  • 148
  • 225
146
votes
13 answers

Exit from Terminal mode in Neovim/Vim 8

I can't figure out how to go back to Normal mode after entering Terminal in Insert mode... Escape just doesn't seem to work. Any idea?
Stephane Rolland
  • 1,857
  • 2
  • 13
  • 23
1
2 3
99 100