#Indent: with using '>' instead of tab key. To indent(add tab) 5 lines place cursor at start of line and use 5>>
#To mark a block of lines and indent it, Vjj> to indent 3 lines (vim only).
#To indent a curly-braces block, put your cursor on one of the curly braces and use >%.
If you’re copying blocks of text around and need to align the indent of a block in its new location, use ]p instead of just p. This aligns the pasted block with the surrounding text.
#Find Replace : In command mode use :s/TOFIND/TOREPLACE/g to find replace in current line, %s instead of s for all lines. use c with /g for confirmation before each replacement. Use line numbers (e.g- :5,10s/find/replace/g) will work only on line numbers from 5 to 10. Source: vim.wikia.com
Also, the shiftwidth setting allows you to control how many spaces to indent.
auto complete configuration:
created file .vimrc in home dir
Cloned git project: git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
installed dev packages: sudo apt-get install python-dev python3-dev
added :
set nocompatible " be iMproved, required
filetype off " required
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'Valloric/YouCompleteMe'
call vundle#end() " required
filetype plugin indent on " required
Executed :
vim
:PluginInstall
cmake -G "Unix Makefiles" . ~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp