scriptencoding utf-8 " General settings set ai " Always set auto-indenting on set background=dark " syntax highlighting for a dark terminal background "colorscheme tango " set the colorscheme to tango colors set backspace=indent,eol,start " allow backspacing over everything in insert mode set history=50 " keep 50 lines of command history set incsearch " jumps to search word as you type set nocompatible " Use Vim defaults (much better!) set modeline " modelines at the {end,beginning} of a file are handy! set ruler " Show the cursor position all the time set copyindent " Copy the structure of existing indentation set shiftwidth=2 " tab indention set tabstop=2 " number of spaces for a tab set textwidth=79 " textwidth set expandtab " expand tabs to spaces set encoding=utf-8 " encoding set nobackup " do not keep a backup file, use versions instead set nowritebackup " do not create a backup file set showcmd " display incomplete commands set autoindent " always set autoindenting on nnoremap :nohlsearch/ "remove color after finished searching " map F3 to change .c/.h files quickly map :AV set cino=>s,f0,{0,(0,\:s,=s,t0,+s " set indenting for c " >s normal indent is shiftwidth " f0 do not indent the first opening brace " {0 place the opening brace 0 characters from the prevailing indent " (0 line up unclosed parentheses to the begin of the parentheses " :s place case labels shiftwidth characters from the indent of switch " =s place statements occurring after a case label shiftwidth characters from " the indent of the label " t0 indent the type of a function 0 characters from the margin " +s indent a continuation line shiftwidth additional characters " Always show statusline set laststatus=2 set noruler " Show file name, filetype, fileformat and fileencoding in statusline set statusline=[%f]\ \ \ %w%y%r%m[%{&fileformat}][%{&fileencoding}]\ %=%l,c%-5c\ %p%% " format options, see :h 'fo-table for a detailed explanation "set formatoptions=croql set formatoptions=tcrqn " low priority for these files in tab-completion set suffixes+=.info,.aux,.log,.dvi,.bbl,.out,.o,.lo set wildchar= set wildmenu set wildmode=longest:full,full " pastetoggle nnoremap :set invpaste paste? set pastetoggle= set tabpagemax=20 " Folding settings if version >= 600 set foldenable set foldmethod=marker endif " Always check for UTF-8 when trying to determine encodings. if &fileencodings !~? "utf-8" set fileencodings+=utf-8 endif " Make sure we have a sane fallback for encoding detection set fileencodings+=default " Syntax highlighting settings " Switch syntax highlighting on, when the terminal has colors " Also switch on highlighting the last used search pattern. if &t_Co > 2 || has("gui_running") syntax on set hlsearch set showmatch " show the matching { } endif " Filetype plugin settings " Enable plugin-provided filetype settings, but only if the ftplugin " directory exists (which it won't on livecds, for example). if isdirectory(expand("$VIMRUNTIME/ftplugin")) filetype plugin on filetype indent on set grepprg=grep\ -nH\ $* endif " automatically give executable permissions if file begins with #! and contains " '/bin/' in the path " au BufWritePost * if getline(1) =~ "^#!" | if getline(1) =~ "/bin/sh" | silent !chmod a+x | endif | endif