Vim Zoom Hack

Date Tags vim

When writing large documents with a text editor, it is sometimes useful to zoom out and get a high-level view of the file (I believe Sublime Text has a feature called minimap that does this). This functionality can be added to gVim with a simple vimrc addition (to my knowledge, this will not work with regular Vim).

Add the zoom out command with the following: noremap <Leader>zo :set guifont=courier_new:h4<CR>

Add the …

more ...

Docopt

Date Tags python

While browsing YouTube recently, I stumbled upon a video about a great third-party Python module called Docopt. It greatly simplifies writing command-line utilities; instead of writing custom logic using the standard library optparse or argparse modules, you simply write the usage docs for the utility and Docopt handles the parsing. Check out the documentation; there are some great examples that really showcase the power of this module.

more ...

PopPage

Date Tags python

Recently, I had a need for a very lightweight static website generator. The idea was to have AsciiDoc and Pandoc handle the markup to HTML conversions while the generator would simply apply the HTML content to a Jinja2 template. The result was PopPage, a simple command-line driven website generator. It plays nicely with native Windows batch scripting and I plan on providing a few examples in the GitHub repo shortly.

more ...


Vim Scratch Buffer

Date Tags vim

Opening a scratch buffer in Vim can come in handy. The following vimrc addition works well: nnoremap <Leader>sc :e scratch<CR>:setlocal readonly<CR>

It is especially useful in combination with the run shell command shortcut once Vim is configured to change to the directory of the current file with the following vimrc addition: autocmd BufEnter * execute "chdir ".escape(expand("%:p:h"), ' ')

The advantage this named buffer has over the [No Name] buffers created …

more ...

Fossil Command-Line Tips

Date Tags fossil

For small projects, Fossil is a great choice for version control. Fossil's command-line interface is very easy to use and plays nice with utilities like grep, gawk and xargs. The following are examples of common operations:

  • Check in only edited files: fossil changes | grep EDITED | gawk '{print $2}' | xargs fossil commit -m "Added feature X."

  • Add only files with name containing "pattern" to repo: fossil extras | grep pattern | xargs fossil add

  • Move files in repo …

more ...

Vim Run Shell Command

Date Tags vim

Here is a nice simple vimrc file addition that will execute a line as a shell command and read back the output into the buffer: nnoremap <Leader>rl yy:r!<C-r>"<CR>

more ...

Hi, I am Jeff Rimko!
A computer engineer and software developer in the greater Pittsburgh, Pennsylvania area.