Exciting Dotfile Enhancements

Over the weekend, I’ve been cleaning up, organizing and improving my dotfiles. Below are a couple of things that I’m most excited about. Zsh in Vim Mode I’ve been using zsh for a while, but only recently starting using zsh in Vim mode. One thing that’s been sorely missing is moving by word in INSERT mode. I got this working by adding the following to ~/.zshrc: bindkey '^b' backward-word bindkey '^w' forward-word With this config loaded, I can move forward by word boundaries with Control-w and backward with Control-b....

2016-09-11 · 2 min · 261 words · Nathaniel Hoag

Execute Multiple Commands in Vim

Today I needed to perform multiple transforms on a chunk of text in a file and found a nice solution in Vim! Initially I was thinking about VISUAL mode in Vim and chaining transforms the way I would do with sed (i.e. s/one/two/g;s/^/ /;s/$/,/). It turns out this doesn’t exactly work in Vim, but it’s not too far off the mark. The following syntax works in Vim NORMAL mode: :%s/^/ / | %s/string/replace/g | %s/$/,/ And in VISUAL mode, the sytax is slightly different....

2016-09-08 · 1 min · 103 words · Nathaniel Hoag

Switch to Prezto and vim-airline

I’ve been using Oh-My-Zsh and Powerline for vim for a while now, but just recently converted to Prezto and vim-airline, repectively, on word of the usability and performance improvements. Already, the benefits have been well worth the minimal effort required to set these up. Note: anecdotally, the original switch from bash to zsh was quite easy - I understandably hear questions about this often. With Prezto, two improvements stand out markedly:...

2014-03-23 · 2 min · 232 words · Nathaniel Hoag

Another Hodgepodge Update

Recently, a bash script that I’ve used many times on lots of different types of servers was giving very strange results. Typically the script is called as ./script.sh info.cfg and proceeds to run through several processes. On this occasion, I was left with : command not found. When I hit the script with bash -x I could see that both the script and the config file were giving strange results and choking on line-breaks and curly braces....

2013-12-29 · 2 min · 425 words · Nathaniel Hoag