" vimrc file " " Maintainer: Sergei Stolyarov " Last change: Tue, 04 Mar 2008 11:52:56 +0600 " This configuration file is intended for using for UNIX console VIm version, " windows is not supported by design. " Use Vim settings, rather then Vi settings (much better!). " This must be first, because it changes other options as a side effect. set nocompatible " allow backspacing over everything in insert mode set backspace=indent,eol,start " keep 300 lines of command line history set history=300 " always show cursor position set ruler " always display incomplete commands set showcmd " perform incremental search set incsearch " turn on syntax highlighting syntax on " turn on highlighting of all matches set hlsearch " turn on autoindent set autoindent " fix langmap for KOI8-R terminals set langmap=ÊÃÕËÅÎÇÛÝÚÈ߯Ù×ÁÐÒÏÌÄÖÜÑÞÓÍÉÔØÂÀ;qwertyuiop[]asdfghjkl\;'zxcvbnm\,.,êãõëåHçûýúèÿæù÷áðòïìäöüñþóíéôøâà;QWERTYUIOP{}ASDFGHJKL:\"ZXCVBNM<> " set some useful shortcuts " disable F1 as 'help' shortcut imap :echo nmap :echo " use F2 to save files imap :w nmap :w " use F4 for turning off search results highlighting imap :noh nmap :noh " use F7 to toggle paste mode set pastetoggle= "nmap " use F10 to toggle line numbers imap :set number! nmap :set number! " always show status line set laststatus=2 " status line formatting options set statusline=%<%f\ %h%m%r%=%-14.(%l,%c%V%)\ %P " turn on 'visualbell' set visualbell " enable mouse support set mouse=a " ignore case in search patterns set ignorecase " tabulation and indenting options set tabstop=4 " tabstop value set shiftwidth=4 " Number of spaces to use for each step of (auto)indent set expandtab " use spaces instead of tab, use to insert a tabulation symbol set smarttab " smart Backspace behaviour " don't display VIm greating message set shm+=I " turn off brackets matching vimscript (for VIm > 7) let loaded_matchparen = 0 " set bash-like file names completion set wildmode=longest,list " vim tip #38 Cursor one line at a time when :set wrap nnoremap j gj nnoremap k gk vnoremap j gj vnoremap k gk nnoremap gj nnoremap gk vnoremap gj vnoremap gk inoremap gj inoremap gk " Restore cursor to file position in previous editing session autocmd BufReadPost * \ if line("'\"") > 0 && line("'\"") <= line("$") | \ exe "normal g`\"" | \ endif " some options that depends on 'autocmd' feature if has("autocmd") " set 'textwidth' to 78 characters for all text files autocmd FileType text setlocal textwidth=78 " for 'php' files do not use 'expandtab' and 'smarttab' options autocmd FileType php set noexpandtab autocmd FileType php set nosmarttab endif " if has("autocmd")