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
6 answers

how to work with csv files in vim

I want csv file to be opened in vim in the same way it opens in microsoft office . Data should be in column format and commas should not be seen and its should be traversed easily. Is it possible in vim with help of any plug-ins?
vaichidrewar
  • 9,251
  • 18
  • 72
  • 86
24
votes
2 answers

VIM: More precise C/C++ code parsing solutions?

Pre: I've been working in VIM for like a year already. Lots of great things: combinations, scripts. Whenever I'm editing something in a different editor, I feel sluggish/uncomfortable without VIM's navigation. The problem: The thing that really…
Andrew_Lvov
  • 4,621
  • 2
  • 25
  • 31
24
votes
4 answers

Vim: change mouse click behavior

I am playing with my vimrc settings, and enabled the mouse support. set mouse=a Now, I miss the copy and paste option with mouse. Normally, if the mouse is not enabled, I could copy text with left click + drag, and paste by right click (in Insert…
bsr
  • 57,282
  • 86
  • 216
  • 316
24
votes
3 answers

Use Vim Retab to solve TabError: inconsistent use of tabs and spaces in indentation?

Apologize for the newbie question, but I have read the manual, this question, and tried several times without results I expected. So I was using vim to edit a file (attached). But when running, I got the TabError: inconsistent use of tabs and…
yuqli
  • 4,461
  • 8
  • 26
  • 46
24
votes
3 answers

Reload tags file Vim

How do i reload the tags file from within Vim? Is a restart necessary?
asymmetric
  • 3,800
  • 3
  • 34
  • 52
24
votes
1 answer

Vim: how to stay in visual mode after executing a command

Using vim, I'd like to make a selection of lines and then perform a series of operations on them. The problem is that with each op vim exits visual mode and the lines have to be selected again. Any ideas? Thank you.
Nick Redmark
  • 667
  • 6
  • 17
24
votes
3 answers

vim: would like it to turn settings on only for certain file types

I've looked at this but it wasn't too much help. Maybe I didn't read it too well. Basically what I want is when I open a .txt file the settings: set wrap set linebreak are turned on. How might I go about doing that? Thanks in advance. Also, I'm…
Nope
  • 34,682
  • 42
  • 94
  • 119
24
votes
4 answers

How to delete a buffer in Vim without closing the window?

I usually type :bd to remove the buffer, however, it results in undesirable side-effect of the window being closed which I do NOT want.
vehomzzz
  • 42,832
  • 72
  • 186
  • 216
24
votes
5 answers

Vim: Ignore Special Path in Search

In my .vimrc file, I have two very useful lines: set path=~/nbapp/** set backupdir=~/nbapp/temp The first line allows me to search in my project directory and subdirectories. The second line makes vim create backup files in a special temporary…
Rafid
  • 18,991
  • 23
  • 72
  • 108
24
votes
2 answers

Vim keep window position when switching buffers

A problem I've been having with Vim in general is that when I switch buffers in a window (either :[n]b or MiniBufExpl) the cursor position stays the same, but the window always positions itself so the row the cursor on is in the middle. This is…
andrew
  • 2,819
  • 24
  • 33
24
votes
6 answers

Grey bar on left in vim?

I get a grey bar on left side in vim for one file. This does not happen for any other file. What is this? And how to get rid of it? EDIT: This is what it looks like: This goes on for the full height of the file. It does not appear in any other…
nakiya
  • 14,063
  • 21
  • 79
  • 118
24
votes
3 answers

How to trigger omnicomplete/auto-completion on keystrokes in INSERT mode?

VIM's omnicomplete autocompletion is not really working as expected. Is there a way to make it smarter? Like, to monitor the context of surround text? (e.g. don't trigger if within comments or quotes) I ask because I cannot get to a happy place…
eduncan911
  • 17,165
  • 13
  • 68
  • 104
24
votes
3 answers

Folding (expanding and colapsing) xml tags in vim (xml parsing)

I know that % in vim will jump from one tag to another, I also know how to use visual mode to select entire blocks between tags in an xml file, using o to jump from the top to the bottom tags. I've done multiple web searches and have the matchit…
Deesbek
  • 865
  • 2
  • 12
  • 27
24
votes
2 answers

How can I commit files currently displayed in Vim with fugitive?

I am editing files opened split into three windows. I want to commit those into the repository. Is there any commands to do that?
katatagan
  • 343
  • 1
  • 2
  • 6
24
votes
4 answers

Vim search in C/C++ code lines

Is there any way to search a string in a C/C++ source file while skipping commented lines?
Nicola Bonelli
  • 8,101
  • 4
  • 26
  • 35
1 2 3
99
100