Generating Mock Userdata
I often find myself needing to generate dummy data when doing software projects. The rig command-line utility makes it easy to do so. # apt-get install rig $ rig Maureen Cummings 614 Spring County Blvd...
View ArticleRemoving Lines that Don't Match a Pattern
Following up on a previous tip, you can also use the "g" and "d" commands to remove lines in your current buffer that don't match a specific pattern. The following example would remove all lines that...
View ArticleFinding and Replacing Unicode Characters
If you'd like to find a particular multibyte character, you can do the following. /\%u001c You can also do a find and replace as you normally would. %s/\%u001c//g
View ArticleRemoving Blank Lines
Here's a handy one-liner to remove blank lines from a file. :g/^$/d Breaking this down. The "g" will execute a command on lines that match a regular expression. The regular expression matches blank...
View ArticleVim.js
I'm not sure what utility this provides, but it's a pretty darn cool hack. Kudos to Lu Wang for this Javascript port of Vim. http://coolwanglu.github.io/vim.js/web/vim.html
View ArticleSnipmate
If you like Textmate Snippits, consider installing Snipmate. From the Github page. SnipMate aims to provide support for textual snippets, similar to TextMate or other Vim plugins like UltiSnips. For...
View ArticleSupertab
If you like Bash auto-completion, you'll love Supertab. Installation and configuration details are available via its Github Page.
View ArticleVim Gitgutter
Vim Gitgutter Vim Gitgutter shows a diff in the sign (left-hand) column of your editing window. This is a really cool way to see what portions of a file have changed without resorting to git diff....
View ArticleBasic Recovery
The following commands are useful for recovering an editing session. Retrieve a list of recoverable files. vim -r Recover a specific file. vim -r .file.extension.swp (from swap files listed above)...
View ArticleWatching Memcached Traffic with TCPDump
Here's a fun little one-liner I just hacked together to keep tabs on the get/set commands coming in on a memcached server that I administer. sudo tcpdump -i eth0 -s 65535 -A -ttt port 11211| cut -c 9-...
View ArticleWrap Git With Fugitive
From the Fugitive Github page: I'm not going to lie to you; fugitive.vim may very well be the best Git wrapper of all time. Check out these features: View any blob, tree, commit, or tag in the...
View ArticleCheap Process Monitoring: Echo, Watch, and Netcat
I frequently work with memcached, gearman, and a variety of other services that allow you to retrieve useful stats by connecting via telnet and issuing a status command. In a lot of cases, retrieving...
View ArticleSensible Defaults with Vim-Sensible
If you have a fresh Vim install, and you'd like a sensible set of defaults, consider installing the vim-sensible plugin. If you've already installed Pathogen, installing the plugin can be accomplished...
View ArticleSort: Human Numeric
The sort command can accept input data formatted in human readable form. The du -h command is a longtime favorite for finding file sizes in a format that's easy to read with the naked eye. Coupled with...
View ArticlePathogen Makes Plugin Management Easy
I have been using Pathogen for installing new plugins whenever possible for quite a while now. In my opinion, Pathogen is the simplest path to extending your existing Vim runtime with additional...
View ArticleThe Wonderful "F" Key
If you press the "f" key in normal mode, Vim will move the cursor forward to whatever character you input after "f" is pressed. As an example, consider the following line: a quick brown fox If the...
View ArticleBack From The Dead
After an almost four year hiatus, I've decided to bring this blog back from the dead. Looking over the last decade, my career as a programmer has been an interesting and challenging endeavor, and over...
View ArticleVimgrep Tips
I've mentioned vimgrep in a previous post, but I neglected to mention a few useful flags that can be used in conjunction with it.If you apply the 'g' flag to your vimgrep, it will return all matches...
View ArticleMore on Text States
A few people have asked me for more information on text states. An anonymous reader contributed the following in the comments of my previous post on the topic.Using g+ and g- is very different than...
View Article