JohnBeckett (talk | contribs) (Add October archive) |
JohnBeckett (talk | contribs) (Add November archive) |
||
Line 4: | Line 4: | ||
To discuss suggestions for new items, please edit the [[Talk:From Vim Help|talk page]]. |
To discuss suggestions for new items, please edit the [[Talk:From Vim Help|talk page]]. |
||
+ | |||
+ | ==November 2008== |
||
+ | *Use <tt>:set nu!</tt> to toggle the display of line numbers. {{help|'number'}} |
||
+ | *Use <tt>:-5,5l#</tt> to list lines near the current line. {{help|:list}} |
||
+ | *<tt>:-5,5#</tt> does the same, without showing unprintable characters. {{help|:#}} |
||
==October 2008== |
==October 2008== |
Revision as of 04:46, 29 November 2008
This is an archive of the From Vim Help section on the Main Page
The From Vim Help section was started in February 2008. Every few weeks, the section on the Main Page will be replaced. Old items will be moved here so anyone interested can browse them.
To discuss suggestions for new items, please edit the talk page.
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'.