Configuration: vim
Features
List of my Vim configuration features:
- F1 help: open man/info/perldoc window for word under cursor
- F2 save
- F4 toggle paste "as-is"
- F5 snippets: quickly fill and insert large text templates
- F6 show menu for converting file between different Russian encodings
- F10 quit (if no modified unsaved files left)
- F11, F12 navigate between prev/next compile errors
- Tab, Shift+Tab autocomplete current word
- Tab, Shift+Tab switch between open files
- Shift+arrows Windows-like selecting text, Ctrl+Insert Windows-like "copy into clipboard", copy both into Xwindow clipboard (this feature require external utility: xsel, or xclip or xcb) and Vim buffer, Shift+Insert Windows-like "paste from clipboard" (work only in XTerm)
- Ctrl+arrows scroll text in windows without changing cursor position
- Alt+arrows moving between "tag"-links, eg. in Vim help or man pages (like it work in text browsers lynx and elinks)
- #, Alt+#, Ctrl-C [un]comment current line using commenting rules for current file type
- Full-screen mode: each open file, or window with Vim help, etc. open in full-screen window, with ease switching between them (see keys above). Correctly restore cursor position when switching between edited files.
- Perl scripts automatically checked for syntax errors when saving file, Vim show small window with found errors and able to navigate on them (see keys above).
- Spell checking on-the-fly, both Russian and English at once.
- Transparent editing of gpg encrypted files.
- Large files opens faster.
- Command-mode works with Russian keyboard layout.
- Highlight 80-column margin.
Configuration files
~/.vimrc - it's well commented, but most comments are in Russian.
~/.vim/ - contain all needed plugins, syntax files, etc.
vimrc-2.2.1.tgz - everything in single archive.
Plugins
- manpageview
-
Viewer for manpages, info pages, perldoc, and php (unix/linux only).
I've applied simple patch for version 14 to make it compatible with my "full screen mode" configured in ~/.vimrc. Newer version 22 doesn't work well out of box for me, so I still use version 14 for now.
- FeralToggleCommentify
-
(Un-)Comment lines in a program.
I've applied few trivial patches: make "#" default commenting symbol, setup javascript to use "//" comments, and removed annoying warning about unsupported file types.
- foldutil
-
Utility for creating folds (using specified match criteria). This plugin make creating custom fold much ease.
Syntax highlight
Tips and Tricks
- Replace standard man and info commands
-
To replace console commands man and info by Vim's viewer (which is much better, from my view) you can add to ~/.bashrc these lines:
function man() { vim -c "Man $1 $2"; } function info() { vim -c "Man $1.i"; }