Tip 1582 Printable Monobook Previous Next
created 2008 · complexity basic · author Metacosm · version 7.0
The #vim community started this FAQ to help solve some common problems enountered by new users of Vim.
Common issues[]
- Vim is confusing, where do I start? New to Vim, Tutorial, Vi-Improved.org Tutorial
- How do I record a macro? Macros
- How do I reselect the visual range I just used? Visual selection
- How do I change the GUI Font (and make those changes stick)? Change font
- How do I make backspace work like in other editors? Backspace and delete problems
- How do I fix syntax highlighting problems? Fix syntax highlighting
- How do I paste in code without having all the indenting screwed up? Toggle auto-indenting for code paste
- How do I insert the current date/time into my file? Insert current date or time
- How do I make the options I set stay set? Debug unexpected option settings
- How can you read/write system environment variables from within Vim? Environment variables
- How can I dump my file to html looking exactly as it currently does (syntax highlighting at all)? Pasting code with syntax coloring in emails
- How to tell Vim to save as a new file when the file is hardlinked? Editing a hard link to a file
- How can I fix the line-endings in this file? File format
- How to exchange the current line with the line above/below? Swapping characters, words and lines
- How can Vim work with Visual Studio .Net? Integrate gvim with Visual Studio
- How can I get diff to work properly in the MS Windows port of Vim? Cannot create diffs under Windows
- How can I make keywords autocompletable when creating a new C source file? Make sure Vim knows it is a C file. For example, open it with
:e main.c
, not just:enew
. - How can I get Visual Studio like completion (i.e. Intellisense) in Vim? Omni completion
- How can I delete parens that surround text? See Surround at Best plugins
- Why do letters show up when I try to enter numbers from the keypad? Why doesn't the numpad work as expected? Why does the NumLock key bring up help.txt? PuTTY numeric keypad mappings
- How can I avoid pressing the Escape key to exit from insert mode? Avoid the escape key
- How do I edit GPG encrypted files in Vim? Edit gpg encrypted files
- When using encryption, is all my data encrypted? No. :help encryption explains that only the file written to disk is encrypted, and there are various possibilities for plain text information to be visible to others. For example, you may want to change your
'viminfo'
option so that information in registers is not saved to disk.
Documentation guide[]
- Using help
- Searching
- Searching how to search, with links to related tips
- :help 'hlsearch' turn search highlights on or off permanently
- :help :nohlsearch turn search highlights off until the next search
- Backspace behavior
- :help 'bs' how to backspace over line-endings and more
- Do something to all lines matching a pattern
- Format options
- End-of-line problems (^M is displayed)
- Indenting
- Category:Indenting
- :help 'expandtab'
- :help 'shiftwidth'
- :help 'tabstop'
- :help 'copyindent'
- :help 'preserveindent'
- :help sub-replace-special why
\n
doesn't do what you want in:s///
- Not indenting when pasting
- Display invisible characters (tabs, newlines and more)
- Show matching braces
Other sources[]
- Vim FAQ this supersedes previous FAQ at sourceforge