vimrc
this is a little vimrc that is just about right for small purposes..
(edit the file ~/.vimrc for user specific changes and /etc/vimrc?? for systemwide configuration)
[code language="bash" padlinenumbers="true"]
syntax on
filetype indent plugin on
set autoindent
set smartindent
set tabstop=4
set expandtab
set shiftwidth=4
set softtabstop=4
set number
set background=light
set smartcase
set cursorline
[/code]
explanation:
- smartcase searches smart:
/copyright " Case insensitive /Copyright " Case sensitive /copyright\C " Case sensitive /Copyright\c " Case insensitive - indentation:
- autoindent: same as line before
- smartindent: does some thinking (one level deeper for "if else", etc.)
- cursorline:
- highlights current line of cursor position
- The command
zcwill close a fold (if the cursor is in an open fold), andzowill open a fold (if the cursor is in a closed fold). It's easier to just usezawhich will toggle the current fold (close it if it was open, or open it if it was closed).The commandszc(close),zo(open), andza(toggle) operate on one level of folding, at the cursor. The commandszC,zOandzAare similar, but operate on all folding levels (for example, the cursor line may be in an open fold, which is inside another open fold; typingzCwould close all folds at the cursor).The commandzrreduces folding by opening one more level of folds throughout the whole buffer (the cursor position is not relevant). UsezRto open all folds.The commandzmgives more folding by closing one more level of folds throughout the whole buffer. UsezMto close all folds.
sources:
- python.org
- vim.wikia.com/wiki/Folding