Vim Tips Wiki

This is an archive of the From Vim Help section on the Main Page for 2008 (started in February 2008).

December 2008[]

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[]

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[]

March 2008[]

February 2008[]