To set tab stop and auto indent open ~/.vimrc
filetype plugin indent on
" show existing tab with 4 spaces width
set tabstop=4
" when indenting with '>', use 4 spaces width
set shiftwidth=4
" On pressing tab, insert 4 spaces set expandtab
To set tab stop and auto indent open ~/.vimrc
filetype plugin indent on
" show existing tab with 4 spaces width
set tabstop=4
" when indenting with '>', use 4 spaces width
set shiftwidth=4
" On pressing tab, insert 4 spaces set expandtab
Nice quick tryout blog on ctags and cscope.
The following tutorial introduces you both to Vim’s built-in Cscope support, and to a set of maps that make searching more convenient.
I was having a file with format as below.
1. Different fields with a field seperator.
2. Multiple lines.
3. There were multiple lines with same strings to be replaced but there are few lines to match a pattern string to execute find and replace.
Used the following vi editor command.
:%g/^.*pattern*.$/s/find/replace/g
where,
%g for using regular expression command in vi.
^.*pattern*.$ for searching and selecting lines containing the (semi-)word pattern.
s/find/replace/g for string find words with value “find” and replace them with string “replace”.