Posts Tagged ‘UNIX’

How to Remove Spaces from Filenames in Linux/UNIX

Wednesday, April 22nd, 2009

This command will rename all files that have spaces in their filenames, in the current directory and recursively in its subdirectories, so that in the new filenames all spaces are replaced with underscores (‘_’ characters). find . -name ‘* *’ | while read file; do target=`echo “$file” | sed ‘s/ /_/g’`; echo “Renaming ‘$file’ to [...]


Code completion (IntelliSense) for C++ in Vim with OmniCppComplete

Friday, March 20th, 2009

C++ autocompletion is possible with VIM. This is officially the coolest tech discovery I’ve made this year. And it’s easy to setup. Here’s how to configure C++ IntelliSense for Vim, with an example that demonstrates how to enable code completion for the the C++ Standard Template Library (STL). 1. Download You need the following: Vim [...]


Floating point arithmetic using bc

Monday, March 16th, 2009

The bc shell utility that is available on most UNIX/Linux distributions defaults to integer arithmetic (i.e. throws away anything after the comma). To prevent this, you can set the “scale” option in bc. E.g., the following command will return 3.333: echo “scale=3; 10/3″ | bc


Customizing/disabling VIM’s matching parenthesis highlighting

Monday, February 23rd, 2009

I find vim’s matching parenthesis highlighting feature useful, but the default colors drive me nuts! It highlights the matching brace/bracket so vividly, I keep on getting confused with the cursor position! Here are a few solutions to this annoyance. Change the matching parenthesis font color and/or text-style To customize the font color, background color and/or [...]