This is an archive of the From Vim Help section on the Main Page for 2008 (started in February 2008).
December 2008[]
- The gf command (goto file) opens the file under the cursor. :help gf
- You can control which characters are in the file name. :help 'isfname'
- And which directories are searched to look for the file. :help 'path'
- And what extensions are added to the file name. :help 'suffixesadd'
November 2008[]
- Use :set nu! to toggle the display of line numbers. :help 'number'
- Use :-5,5l# to list lines near the current line. :help :list
- :-5,5# does the same, without showing unprintable characters. :help :#
October 2008[]
- Use :match ErrorMsg /sample/ to highlight every "sample". :help :match
- Or do the same with :call matchadd('ErrorMsg', 'sample') then :call clearmatches(). :help matchadd()
- Use :hi ErrorMsg to see the ErrorMsg highlight definition. :help :highlight
September 2008[]
- The command :marks aB lists marks 'a' and 'B'. :help :marks
- Press g`a to jump to mark 'a' without changing the jumplist. :help g`
- Press `. to jump to the position of the last change in the current buffer. :help `.
August 2008[]
- You can modify part of the status line without creating an entire 'statusline' string, using 'rulerformat'. :help 'rulerformat'
- The GUI menus in gvim can interfere with alt-key mappings. See :help 'winaltkeys' to fix this.
- Use :set all& to set all options, except terminal options, to their default value. :help :set-&
July 2008[]
- In a script, <sfile> is replaced with the name of the sourced file or function. :help <sfile>
- The path modifier :r gives the root of a file name (removes extension). :help ::r
- In insert mode, press Ctrl-K = e (no spaces) to insert the euro sign €. :help digraphs
June 2008[]
- You can have Vim try to detect whether to ignore case in searches. :help 'smartcase'
- Toggle an option by adding ! (set spell! will turn spell checking on/off). :help :set
- With set, use += to add option flags, or -= to remove them. :help add-option-flags
May 2008[]
- :verbose abbreviate lists each abbreviation and where it was defined. :help :abbreviate-verbose
- Avoid an insert-mode abbreviation by pressing Ctrl-V (or Ctrl-Q if you use Ctrl-V for paste) before the character after the abbreviation. :help abbreviations
- Setting the 'display' option to include "lastline" will show as much of the final (wrapped) line as will fit on the screen. :help 'display'
April 2008[]
- :set report=0 shows all "x lines changed" and "x substitutions" messages. :help 'report'
- :verbose set cindent? shows the option and where it was last set. :help :set-verbose
- :set shows all non-default options. :help :set
March 2008[]
- You can use g/pattern/ to make a quickfix list. :help :caddexpr
- Each window can have a separate location list. :help location-list
- Use :cexpr to make a quickfix list from an expression. :help :cexpr
February 2008[]
- Not happy with how the Backspace key works? :help 'backspace'.
- What directory would you like to use for your backup files? :help 'backupdir'.
- Control whether two spaces occur after '.' when you join lines. :help 'joinspaces'.