JohnBeckett (talk | contribs) (archive 2009; add new month) |
JohnBeckett (talk | contribs) (archive) |
||
Line 5: | Line 5: | ||
'''To discuss suggestions for new items, please edit the [[Talk:Did you know|talk page]].''' |
'''To discuss suggestions for new items, please edit the [[Talk:Did you know|talk page]].''' |
||
+ | |||
+ | ==April 2010== |
||
+ | *<tt>zz</tt> scrolls the current line to the [[VimTip182|middle of the screen]]; scrolloff can keep it there. |
||
+ | *Vim can do calculations using [[VimTip1235|Python]], [[VimTip1359|Perl]] or [[VimTip1349|bc]]. |
||
+ | *You can wrap long lines while moving the cursor by [[VimTip38|screen lines]]. |
||
+ | *A tricky search can [[VimTip220|find text that does ''not'' match]]. |
||
+ | *Pressing <tt>%</tt> [[VimTip6|jumps to a matching bracket]], and <tt>matchit.vim</tt> can match much more. |
||
+ | *The <tt>shortmess</tt> and <tt>cmdheight</tt> options allow you to [[VimTip16|avoid "Hit Enter to continue" prompts]]. |
||
+ | *An option controls [[VimTip17|how backspace and other delete keys work in insert mode]]. |
||
+ | *You can [[VimTip19|display line numbers and change the width of the number column]]. |
||
+ | *It's easy to [[VimTip49|change text between lowercase and UPPERCASE]]. |
||
+ | *The command history allows you to [[VimTip45|repeat several commands, possibly after editing them]]. |
||
==March 2010== |
==March 2010== |
Revision as of 07:27, 3 May 2010
This is an archive of the Did you know? section on the home page
Every few weeks, the section on the home 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.
April 2010
- zz scrolls the current line to the middle of the screen; scrolloff can keep it there.
- Vim can do calculations using Python, Perl or bc.
- You can wrap long lines while moving the cursor by screen lines.
- A tricky search can find text that does not match.
- Pressing % jumps to a matching bracket, and matchit.vim can match much more.
- The shortmess and cmdheight options allow you to avoid "Hit Enter to continue" prompts.
- An option controls how backspace and other delete keys work in insert mode.
- You can display line numbers and change the width of the number column.
- It's easy to change text between lowercase and UPPERCASE.
- The command history allows you to repeat several commands, possibly after editing them.
March 2010
- Vim tutorials has videos illustrating simple and advanced topics.
- Use % to jump to the matching bracket, and more.
- Use :lcd %:p:h to change directory to the file in the current window.
- ga shows the ascii value of the current character.
- You can list changes to the current file, even old changes.
- Use za to toggle folds open/closed.
- The status line can show your fileencoding and bomb.
- In a program, you can jump to the beginning or end of a code block.
- With two related files in a vertical split, you can scroll both windows together.
- It's easy to count the words in a file or block.
- You can even make a frequency table counting the occurrences of each word!
February 2010
- Vim tutorials has videos illustrating simple and advanced topics.
- You can press * to search for the current word.
- Ctrl-A can increment numbers.
- After typing a couple of characters, you can complete a word with Ctrl-N or Ctrl-P.
- Vim's help use prefixes like v_ (visual mode) to show the context.
- The :let command can set registers and options as well as variables.
- The command :42 jumps to line 42, as does typing 42G.
- The shortmess and cmdheight options allow you to avoid "Hit Enter to continue" prompts.
- The 'backspace' option controls how backspace and other delete keys work in insert mode.
- The 'number' and 'numberwidth' options control the display of line numbers.
- It's easy to change text between lowercase and UPPERCASE.
January 2010
- Vim tutorials has videos illustrating simple and advanced topics.
- We have an explanation for how :g/^/m0 reverses all lines.
- In a search pattern, \_s matches a space or tab or newline character.
- A script can use a test like &buftype == "quickfix" to check if it is operating in the quickfix window.
- Typing =i{ reindents the "inner block" (code inside braces).
- Using 'smartindent' means that typing # may remove an indent before the #.
- The 'winaltkeys' option controls whether Vim handles Alt keys.
- If you would prefer Y to be consistent with C, use :nnoremap Y y$.
- A plugin should set its "loaded" variable to show its version, for example let g:loaded_dbext = 503.
- We have a short FAQ for new users concerning common issues raised at #vim.
- You can use :cnoremap to map a key to <C-\>e(...)<CR> which will replace the command line with the (...) expression.