Posts Tagged ‘vim’

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 [...]


How to insert the output of a command in VI

Friday, February 27th, 2009

To insert the output of a command (e.g. ‘ls’) below the cursor, type: :r !ls or :read !ls


How to insert the contents of a file in VI

Friday, February 27th, 2009

To insert the contents of a file called /tmp/myfile.txt below the cursor, type: :r /tmp/myfile.txt or :read /tmp/myfile.txt


Search and replace with VI

Wednesday, February 25th, 2009

To search and replace in VI, you have to use the “substitute” command, which looks like this: [range]s/[search_string]/[replacement_string]/[options] Examples To search and replace all occurrences of OLD with NEW, type: :%s/OLD/NEW/g To search and replace all occurrences of OLD with NEW and ask for confirmation with each substitution, type: :%s/OLD/NEW/gc To search and replace all [...]