Skip to main content

Posts

Showing posts from 2015

How to Apply Vim Settings to cat Command

I first sought out a solution for the absence of colordiff in my new work environment, which I had next to zero control over what packages get installed.  So basically, I would output my diffs into a file then open it in vim .  Eventually that got really annoying and I wanted something I can run in a single command, such as svn diff | less .  So naturally, I was looking for a simple way to read a diff and have the colors differentiate modifications.  Not long after, I found this thread and discovered one can vim in less mode!  This essentially lets you pipe out string and scroll through it, all with your vim settings. Add a new command script called vless using the less macro vim provides: cp /usr/share/vim/vim{version}/macros/less.sh /usr/local/bin/vless Then use vless instead of less and enjoy life in color! svn diff | vless