Quick: functions (index) | habits |
Tutorials, etc.
Links
- Sites: syntax colors
- Quick Reference
- Reference Card
- Expressions and operators
- Append ? or # for ignoring or matching case.
- Learn Vimscript the Hard Way
- Editing binary files
- Online docs
- Initialization
- Limits
- options
- all options
- 'statusline'
- When the option starts with "%!" then it is
used as an expression, evaluated and the
result is used as the option value.
Example:
:set statusline=%!MyStatusLine()
The result can contain%{}
items that will be evaluated too.
e.g.
set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [ASCII=\%03.3b]\ [HEX=\%02.2B]\ [POS=%04l,%04v][%p%%]\ [LEN=%L]
set statusline=%f%m%r%h%w\ \ [%Y]\ \|\ asc:\ %3.3b,\ hex:\ %2.2B\ \|\ pos:\ %4.4l,%-4.4v\ \|\ byte:\ %6.8o\ \|\ %2.2p%%\ \|\ lines:\ %5.8L\ \ \ \ %#Pmenu#%{strftime(\"%a\ %Y-%m-%d\ %H:%M\",localtime())}%#Status#
- When the option starts with "%!" then it is
used as an expression, evaluated and the
result is used as the option value.
Example:
- command
- Autocommands
- Eval
- FileTypes
- Modeline
- Syntax
- Tabs
- Online Book - A Byte of Vim
- Text Objects
:checktime
: Check if files were modified and (prompt to) reload
Tips, Cheatsheets, questions, etc.
- Daily VIM tip blog
- Redir
- StackOverflow: What is your most productive vim shortcut
- Vim on Stackoverflow
- Persistent Undo in vim 7
- Using undo branches
- Best of Vim Tips
- Highest voted tips
- Graphical vi-vim Cheat Sheet and Tutorial
- Learn Vim Progressively
- Cheat Sheets, etc.
- Emacs and Vi
- HN: Why does vim use the hjkl keys as arrow keys
Bag
Using an expression in substitute command
Switching to existing tab. You must use :sbuf
, etc to do the navigation.
set switchbuf=usetab,useopen
Highlight long lines
:match ErrorMsg '\%>80v.\+'