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
zc
will close a fold (if the cursor is in an open fold), andzo
will open a fold (if the cursor is in a closed fold). It's easier to just useza
which 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
,zO
andzA
are similar, but operate on all folding levels (for example, the cursor line may be in an open fold, which is inside another open fold; typingzC
would close all folds at the cursor).The commandzr
reduces folding by opening one more level of folds throughout the whole buffer (the cursor position is not relevant). UsezR
to open all folds.The commandzm
gives more folding by closing one more level of folds throughout the whole buffer. UsezM
to close all folds.
sources:
- python.org
- vim.wikia.com/wiki/Folding