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
25
votes
2 answers

Where is vimrc or vim profile for github's mingw32 shell on a Windows machine?

Cygwin has a home directory where I can store a .vimrc file to set up syntax highlighting. I know on linux machines this file is usually in a home directory and that it can be stored globally (although I haven't figure out how the global thing…
laserface
  • 449
  • 1
  • 4
  • 12
25
votes
3 answers

How to unmap TAB and do not make Ctrl-I invalid in VIM

When I use vim in normal mode, I often press the TAB key accidentally, the key TAB do the same thing as Ctrl-I in default. I want to make the key TAB do nothing, so I put this line in the vimrc file: nmap :echo Thus, the key TAB will do…
tisyang
  • 303
  • 4
  • 7
25
votes
1 answer

Powerline can be shown in multiple buffer, but not in a single buffer

I have just installed Powerline plugin into my vim by using pathogen and submodule. The powerline is only visible when where are multiple buffers. When there is only one buffer in vim, I can't see it. I wonder whether it is a bug or not?
code4j
  • 4,208
  • 5
  • 34
  • 51
25
votes
2 answers

How do you get Vim to highlight C++ syntax errors like Visual Studio?

Is it possible to get gVim to highlight C++ syntax errors (the red squiggles underneath) in real-time like Visual Studio?
teknix
  • 935
  • 2
  • 9
  • 14
25
votes
4 answers

How to highlight lines changed since the last save of a file in Vim?

Is it possible to have Vim highlight the changed lines since the last save? I know it can be done with version control, but can it be done without? I do not want to use any version control system, because the code I work on does not have that. I…
Ayman
  • 11,265
  • 16
  • 66
  • 92
25
votes
4 answers

what can the dot command repeat, exactly?

Vimmers know that . can repeat simple changes. I tried to build a list of what can be repeated or not, but is there a list? I tried to list what I know to be repeatable: they are all normal-mode commands: Text insertion : a, A, i, I, o, O Text…
Benoit
  • 76,634
  • 23
  • 210
  • 236
25
votes
2 answers

Any VI like editor under windows?

I am wondering whether there is a vi like editor under windows command line?
Adam Lee
  • 24,710
  • 51
  • 156
  • 236
25
votes
5 answers

Pipe Vim buffer to stdout

I'd like to use Vim in the middle of a pipe. This existing post looks like what I'd like to do, except I was hoping to do it without Python's help -- only with bash. [It it helps, the environment is the bash shell in the Terminal IDE app on…
Mike
  • 811
  • 1
  • 10
  • 15
25
votes
2 answers

How to change granularity level of undo in emacs evil-mode with undo-tree?

These are some awesome options: emacs-24, evil-mode (using vim bindings in emacs), and undo-tree. However, when I'm in edit mode (insert mode), I sometimes jump around for a number inserts, deletes, etc. before hitting escape and leaving insert…
justingordon
  • 12,553
  • 12
  • 72
  • 116
24
votes
1 answer

Three curly brackets together in php source code

I just downloaded complete source code of PHP from php.net (PHP 5.4.0 [tar.bz2]). They are often using three curly brackets together as given below (The following code snippet extracted form ext/ctype/ctype.c.) /* {{{ proto bool ctype_digit(mixed…
Mohammed H
  • 6,880
  • 16
  • 81
  • 127
24
votes
2 answers

Can vim recognize indentation styles (tabs vs. spaces) automatically?

I'm working on a large codebase, where each file has different indentation conventions: tabs, 4 spaces, 3 spaces, etc. I currently default on tabs and do set shiftwidth=N expandtab smarttab when I come across a spaces-indented file, but that's…
Stefan Majewsky
  • 5,427
  • 2
  • 28
  • 51
24
votes
8 answers

Pad all lines with spaces to a fixed width in Vim or using sed, awk, etc

How can I pad each line of a file to a certain width (say, 63 characters wide), padding with spaces if need be? For now, let’s assume all lines are guaranteed to be less than 63 characters. I use Vim and would prefer a way to do it there, where I…
mathematical.coffee
  • 55,977
  • 11
  • 154
  • 194
24
votes
8 answers

Strange Vim inner borders

I'm using gVIM with Windows 8, and since first time I opened it theres always those strange borders at right and bottom sides: normal window [full size image] fullscreen [full size image] - even bigger borders, look at the green dotted area at…
Yuri Ghensev
  • 2,507
  • 4
  • 28
  • 45
24
votes
8 answers

How to simplify "copy and paste" in Vim?

I find that the procedure to copy and paste in VIM is a bit tricky: Visual mode Y p (or shift p) insert mode and if you wrongly hit the "delete" key, you lost the content (it is replaced by the char you deleted) and you have to re-copy it! I've…
Alessandro De Simone
  • 4,085
  • 6
  • 28
  • 41
24
votes
7 answers

Nerd tree: enter does not open sub dirs

I installed NERDTree via Pathogen on Mac OSX 10.6.8. When I vim a dir, I cannot enter into sub dirs with enter key. Furthermore, the dirs look like this: ?~V? doc/ What's going on?
Calvin Froedge
  • 16,135
  • 16
  • 55
  • 61