I wanted to modify a test suite to call a method using ruby 2’s keyword arguments. There were several calls to the same initialization function that followed a pattern that made it a good candidate for a series of `%s` calls using key-value pairs in a dictionary. Interesting how vimscript uses a leading slash as […]
Tag Archives: vim
powerline vim, NameError, invalid expression error on the latest update.
I have vim with pathogen and on the latest update of the powerline.vim, everything broke. It turns out that my old default config files are incompatible with the new version of powerline. See GitHub issue. When I ran vim with –cmd ‘let g:powerline_config_overrides={“common”:{“log_file”:”/tmp/powerline.log”}}’ as suggested, a bunch of config mapping errors showed up: 2014-09-03 15:36:33,992:ERROR:vim:matcher_generator:Failed […]
Moving back to the last cursor position in line in vim
Ever have a stray keystroke in vim that jumped to somewhere you didn’t intend to go? Two backticks “ will jump to the exact position of where you were. Two single quotes ” will jump to the first non-blank character where you were. This also works for moving to the beginning of a line/cursor position […]
Using vim-rails to help navigate the rails project.
In the interest of being able to quickly navigate my Rails projects, I decided to dive a little deeper into the vim-rails plugin. This helpfile describes the commands in detail, but some of the quick commands are :Econtroller, :Emodel, :Eview, which pretty reliably jump between corresponding controller, model, and view. :Espec needs a little more […]
Getting Fast File Finder Functionality Out of Vim
Problem: All of these other editors have handy functionality to quickly find a file Solution: ctrlp.vim is a plugin that allows you to do that. The plugin’s page has full instructions, but the most important detail after work done in yesterday’s post to declutter my vim windows: After pressing Ctrl-P, use <c-t> or <c-v>, <c-x> […]
Avoiding Scattered Vim Windows in MacVim
Problem: I open too many windows in vim, which get buried in the clutter on my Mac OS X desktop. Solution: Open files in MacVim in an existing window using a tab mvim –remote-tab new_file_to_open.rb Open files in MacVim in an existing window using a split mvim –remote-send “:split `pwd`/new_file_to_open.rb<CR>” I packaged this in a zsh […]