" Make hlsearch work like less(1) set hlsearch nnoremap <ESC>u :nohlsearch<CR> hi Search ctermfg=black ctermbg=white
Wed, 28 Mar 2007Make vim's hlsearch behave like less(1)
Put this in your vimrc.
" Make hlsearch work like less(1) set hlsearch nnoremap <ESC>u :nohlsearch<CR> hi Search ctermfg=black ctermbg=white
Comments: 0 (view comments)
Shortcuts in your shell
I always run across commands I want to run more than once, but don't
necessarily merit an alias in my zshrc file. For these commands, I abuse
environment variables and use them as prefixes.
For instance, I have one command that runs mplayer in a loop, in case the connection drops: while true; do mplayer -cache 48 -prefer-ipv4 http://foo.com/streamthing; doneNormally, I might use !while to re-invoke this command. However, I
have lots of oneliners in my shell history that start with while.
So, let's hack around it:
MPLAYER= while true; do mplayer -cache 48 -prefer-ipv4 http://foo.com/streamthing; doneThis will set the environment variable 'MPLAYER' to an empty string and pass it to the while subshell (and thus mplayer), but since MPLAYER isn't used as an environment variable in mplayer, we won't break anything.
Now, any time I want to rerun this specific command, I can just do
Comments: 0 (view comments)
|
Search this siteNavigationMetadataHome About Resume My Code (SVN)ArticlesARP Security Dynamic DNS with DHCP OpenLDAP+Kerberos+SASL PPP over SSH SSH Security: /bin/false Week of Unix Tools Work EfficiencyProjectsfex firefox tabsearch firefox urledit grok keynav liboverride newpsm (FreeBSD) nis2ldap pam_captcha poor man's backup Solaris audio utility xboxproxy xdotool xmlpresenter xpathtool misc scriptsPresentationsYahoo! Hack Day '08 Yahoo! Hack Day '06 Unix Essentials Vi/Vim Essentials SSH Tunneling (Video)Tag CloudCalendar
FriendsBarCamp Kent Brewster Tantek Çelik John Resig Wesley Shields Tyler ShieldsTechnorati |
|||||||||||||||||||||||||||||||||||||||||||||||||