You're viewing a single post. I have much more to say! The main blog page is a good starting point.
Wednesday, August 17, 2005 ★ 11:07 ★ Categories Programming, Linux
I’m a die-hard Vim user. I use my beloved editor for all my text tasks, including:
Over the past few years, I’ve developed a rather extensive Vim setup with a lot of (mostly file-type specific) settings, abbreviations and keyboard mappings. Having your editor configured conveniently helps you concentrate on what you’re doing instead of how to do it.
If you want me to post more tips, please let me know.
Put these examples in your ~/.vimrc if you want to use them.
" adds different types of quotes around the current word nnoremap ,` mxbi`<Esc>ea`<Esc>`xl nnoremap ,' mxbi'<Esc>ea'<Esc>`xl nnoremap ," mxbi"<Esc>ea"<Esc>`xl
To delete eveything between (but not including) parentheses, hit di(. To delete a paragraph, hit dap. The following mappings make this feature work for quoted strings too, so that ci" lets you replace a quoted string with a new one.
" Quote motions for operators: da" will delete a quoted string. omap i" :normal vT"ot"<CR> omap a" :normal vF"of"<CR> omap i' :normal vT'ot'<CR> omap a' :normal vF'of'<CR> omap i` :normal vT`ot`<CR> omap a` :normal vF`of`<CR>
Put this in ~/.vim/ftplugin/mail.vim and make sure you have filetype on and filetype plugin on in your ~/.vimrc.
" delete empty quotes lines map <buffer> ,> mx:g/^\(>\s*\)\+\s*$/d<CR>`x
Random photo from Ireland (February, 2006)
Wouter Bolsterlee, also known as uws, a postmodern geek living in the Netherlands. Read more about me…
Unless stated otherwise, all material on this site is available under a Creative Commons Share-Alike license.