Questions tagged [vim]

Vim is a free and open-source modal text editor available for most major platforms. It allows high efficiency in many text editing tasks but has a steep learning curve. To learn the basics, run ":help vimtutor". For non-programming questions please use https://vi.stackexchange.com/ instead.

Vim is a free and open source text editor with a steep learning curve that leads to high efficiency in many tasks related to text editing. If you wish to start with Vim, run :help vimtutor in Vim or run the vimtutor command in shell, which will teach you basic commands.

Vim is a highly configurable text editor built to enable efficient text editing. It is an improved version of the vi editor distributed with most UNIX systems and is available on a large number of other systems including Win32, MS-DOS, OS X, AMIGA, OS/2, Cygwin and many more. Vim is written by Bram Moolenaar.

Vim is often called a "programmer's editor," and is so useful for programming that many consider it an entire IDE. It's not just for programmers, though. Vim is perfect for all kinds of text editing, from composing email to editing configuration files.

Before you ask

  • If your question is not about programming, consider posting Vim related questions at the dedicated Vim Stack Exchange site.
  • Vim has an extensive help system that will often address your questions. Type :help <subject> within Vim to search for help on a particular subject; for instance: :help search. The help documentation is also available online.
  • Search Stack Overflow for similar or duplicate questions.

Free Vim books

Vim books

Documentation

Tutorial

See also

License/charityware

Vim is Charityware. You can use and copy it as much as you like, but you are encouraged to make a donation for needy children in Uganda. Please see |kcc| below or visit the ICCF web site, available at these URLs:

Related tags

27998 questions
24
votes
1 answer

How do I configure .vimrc so that line numbers display in netrw in Vim?

I'm using netrw to read directory listings in Vim, and I would like to display line numbers in my netrw tabs (so I can use :24 to navigate through directory listings faster). I'm using "set number" in my vimrc to enable line numbers when editing…
Travis
  • 4,018
  • 4
  • 37
  • 52
24
votes
3 answers

Remove the Toolbar in GVim

How do I remove the Toolbar (which has the open save buttons) in GVim?
unj2
  • 52,135
  • 87
  • 247
  • 375
24
votes
4 answers

git, vimdiff and dirdiff

I'm trying to use vimdiff+dirdiff.vim to diff inside Vim multiple files versionned with Git. For Mercurial, it is possible with mercurial extdiff extension. The only way I found on the web to integrate Vim with Git diff is to use vimdiff on a singe…
user744629
  • 1,961
  • 1
  • 18
  • 27
24
votes
1 answer

How to wrap long lines in .vimrc?

I've setup a colorcolumn=80, but I found I can not wrap long lines in ~/.vimrc. Is there any method like C's \ to concatenate? For example I tried this, but it does not work. autocmd FileType python setlocal ai si et sta sw=4 \ textwidth=80…
Daniel YC Lin
  • 15,050
  • 18
  • 63
  • 96
24
votes
3 answers

Getting Vim to recognize XML

I would like Vim to help me indent my XML files like my C code. However, when I use gg=G It just sets everything to the left. Do I need to designate a syntax? Is XML recognized as a language?
IslandCow
  • 3,412
  • 3
  • 19
  • 24
24
votes
11 answers

What's the point of viEmu plugin for Visual Studio?

This may sound a bit provocative but it actually is a real question. Feel free to edit if you don't like the tone. Now, as much as I understand vi from my short experience with it like 10 years ago, it's a primitive text editor with one editable…
Andriy Volkov
  • 18,653
  • 9
  • 68
  • 83
24
votes
3 answers

Refresh Vim buffer

I'm editing HTML files. I use this keymap to launch firefox to preview the page: map :update:silent !xdg-open %:p But after this command, the Vim window becomes completely black. I need to scroll every line to make it appear again. So…
McBear Holden
  • 5,741
  • 7
  • 33
  • 55
24
votes
4 answers

Vim command to insert blank line in normal mode

Is there any command in Vim that will do the same thing as o or O (insert a blank line before/after the current one), but which doesn't also switch into insert mode?
JSBձոգչ
  • 40,684
  • 18
  • 101
  • 169
24
votes
4 answers

gdb front end to use with vim?

What gdb frontends can I use with vim for debugging C and C++ code? Currently I use cgdb and am satisfied with it. Was just wondering what else is out there?
Letholdrus
  • 1,261
  • 3
  • 20
  • 36
24
votes
7 answers

How to increment in vim under windows (where CTRL-A does not work...)

While CtrlX works fine in vim under windows, CtrlA selects all (duh). Is there a way to increment a number with a keystroke under windows?
Paul Oyster
  • 2,237
  • 3
  • 18
  • 13
24
votes
1 answer

Challenge "Simple text editing with Vim" at VimGolf: How does the #1 solution work?

Simple text editing with Vim: http://vimgolf.com/challenges/4d1a34ccfa85f32065000004 I find it difficult to understand the #1 solution (Score 13). Sorry, no solution is pasted in this post, because I don't know if it's appropriate to do that.
Junfeng
  • 940
  • 10
  • 19
24
votes
19 answers

Are there any reasons why a C# developer should learn Emacs/Vim?

I work as a c# developer in a purely Microsoft shop. I recently started teaching myself assembly using gas and Linux in my free time away from work. I like messing about with Linux, I'm still very new to it though. I keep hearing I should learn…
handles
  • 7,639
  • 17
  • 63
  • 85
24
votes
3 answers

How to create and open for editing a nonexistent file whose path is under the cursor in Vim?

I’m trying Vim for the first couple of hours with Ruby on Rails, and I’m loving it so far. Specifically, the gf command is great, but I miss something: If the file under the cursor does not exist yet, gf returns an error. Is there a command to…
demental
  • 1,444
  • 13
  • 25
24
votes
3 answers

How do you paste multiple tabbed lines into Vi?

I want to paste something I have cut from my desktop into a file open in Vi. But if I paste the tabs embed on top of each other across the page. I think it is some sort of visual mode change but can't find the command.
tristanbailey
  • 4,427
  • 1
  • 26
  • 30
24
votes
4 answers

How to open gzip text files in Gvim without unzipping?

How to open Gzipped text files (*.gz) in Gvim without unzipping them first ?
Jean
  • 21,665
  • 24
  • 69
  • 119