1"-------------------------------------- 2" General 3"-------------------------------------- 4set nocompatible " get out of horrible vi-compatible mode; must be first, as it changes other options 5set undolevels=1000 6set history=2000 7if exists(":filetype") 8 filetype plugin indent on "detect the type of file 9 runtime ftplugin/man.vim " to have :Man available 10endif 11set cindent 12set autowrite " automatically save before commands like :next and :make 13set viminfo+=! " make sure it can save viminfo 14set isk+=_,$,@,%,#,- " none of these should be word dividers, so make them not be 15 16let s:cpo_save=&cpo 17set cpo&vim 18map! <xHome> <Home> 19map! <xEnd> <End> 20map! <S-xF4> <S-F4> 21map! <S-xF3> <S-F3> 22map! <S-xF2> <S-F2> 23map! <S-xF1> <S-F1> 24map! <xF4> <F4> 25map! <xF3> <F3> 26map! <xF2> <F2> 27map! <xF1> <F1> 28map <xHome> <Home> 29map <xEnd> <End> 30map <S-xF4> <S-F4> 31map <S-xF3> <S-F3> 32map <S-xF2> <S-F2> 33map <S-xF1> <S-F1> 34map <xF4> <F4> 35map <xF3> <F3> 36map <xF2> <F2> 37map <xF1> <F1> 38map <F9> :set paste!<bar>set paste?<cr> 39let &cpo=s:cpo_save 40unlet s:cpo_save 41 42if has("autocmd") 43 44 filetype plugin indent on 45 autocmd BufReadPost * 46 \ if line("'\"") > 0 && line("'\"") <= line("$") | 47 \ exe "normal g`\"" | 48 \ endif 49 50endif " has("autocmd") 51 52 53"------------------------------------- 54" Vim UI 55"------------------------------------- 56set background=dark 57syntax on 58if exists(":colorscheme") 59 colorscheme desert 60endif 61 62set ttyfast 63"set mouse=a " make sure mouse is used in all cases. 64set nomousehide " hide the mouse pointer when characters are typed 65set lsp=0 " space it out just like unix 66set fillchars=vert:\ ,stl:\ ,stlnc:\ 67set wildmenu " turn on wild menu 68"set number " turn on line numbers 69set ruler " Always show current positions along the bottom 70set lz " do not redraw while running macros (much faster) (LazyRedraw) 71set ignorecase " easier to ignore case for searching 72set report=0 " tell us when anything is changed via :... 73set cmdheight=2 " it's better to use screen 74 75" setting for the GTK2 GUI 76if has("gui_running") 77 set columns=105 lines=33 78 colorscheme desert 79" set guioptions-=tT 80" set guifont=Bitstream\ Vera\ Sans\ Mono\ 10 81endif 82 83 84"------------------------------------- 85" Vim locale 86"------------------------------------- 87set enc=utf-8 88set fileencoding=utf-8 89set hls 90set sw=2 91set background=dark 92 93set langmenu=none 94syntax on 95highlight Comment ctermfg=darkcyan 96highlight Search term=reverse ctermbg=4 ctermfg=7 97 98 99"------------------------------------- 100" Visual Cues 101"------------------------------------- 102set mat=5 " how many tenths of a second to blink matching brackets for 103set backspace=2 " indent,eol,start 104set showmatch " show matching brackets 105set showcmd " Show (partial) command in status line 106set incsearch " do incremental searching 107set hlsearch " highlight searched for phrases 108set splitbelow " splitting a windows will put the window below the current one 109set scrolloff=10 " Keep 10 lines (top/bottom) for scope 110set novisualbell " don't blink 111set noerrorbells " no noises 112set laststatus=2 " always show the status line 113"set statusline=[%n][File:%f]%m%=[Row:%l][Col:%c][%p%%] 114"set statusline=%<[%n]\ %F\ \ Filetype=\%y\ \ %r\ %1*%m%*%w%=%(Line:\ %l%)%4(%)Column:\ %5(%c%V/%{strlen(getline(line('.')))}%)\ %4(%)%p%% 115set statusline=[%n]\ %<%f\ %((%1*%M%*%R%Y)%)\ %=%-19(\LINE\ [%3l/%3L]\ COL\ [%02c%03V]%)\ ascii['%02b']\ %P 116 117 118"------------------------------------ 119" Text Formatting/Layout 120"------------------------------------ 121set autoindent 122set smartindent 123set shiftwidth=2 124set softtabstop=2 125set textwidth=0 " maximum width of text that is being inserted 126set linebreak " wrap long lines at a character in 'breakat' 127set noexpandtab " use real tabs 128set nojoinspaces " insert two spaces after a '.', '?' and '!' with a join command 129set smarttab " use tabs at the start of a line, spaces elsewhere 130 131 132"------------------------------------- 133" Folding 134"------------------------------------- 135set foldenable " Turn on folding 136set foldmethod=indent " Make folding indent sensitive 137set foldlevel=100 " Don't autofold anything (but I can still fold manually) 138set foldopen-=search " don't open folds when you search into them 139set foldopen-=undo " don't open folds when you undo stuff 140 141"------------------------------------- 142" Mappings 143"------------------------------------- 144" Optimized timestamp; useful for ChangeLogs. 145map <F2> i<C-R>=strftime("%Y-%m-%d %H:%M")<CR> Leonard Schmidt<CR><TAB>* <CR><CR><ESC>--A 146map Q gq " Don't use Ex mode, use Q for formatting 147 148"------------------------------------- 149" Minibuf 150"------------------------------------- 151let g:miniBufExplTabWrap = 1 " make tabs show complete (no broken on two lines) 152let g:miniBufExplModSelTarget = 1 153 154"------------------------------------- 155" Matchit 156"------------------------------------- 157let b:match_ignorecase = 1 158 159"------------------------------------- 160" Perl 161"------------------------------------- 162let perl_extended_vars=1 " highlight advanced perl vars inside strings 163let perl_want_scope_in_variables=1 164let perl_include_pod=1 165let perl_fold=1 166let perl_fold_blocks=1 167 168"------------------------------------- 169" C 170"------------------------------------- 171let c_comment_strings = 1 " hilights strings inside comments 172let c_gnu = 1 " set syntax for gnu gcc/g++ 173let c_space_errors = 1 " show spacing errors 174 175"------------------------------------- 176" sh 177"------------------------------------- 178let highlight_function_name = 1 179 180"------------------------------------- 181" settings for :TOhtml 182"------------------------------------- 183let g:html_use_css = 1 184let g:html_use_xhtml = 1 185let g:html_number_lines = 1 186 187