| [979] | 1 | if v:lang =~ "utf8$" || v:lang =~ "UTF-8$" | 
|---|
 | 2 |    set fileencodings=ucs-bom,utf-8,latin1 | 
|---|
 | 3 | endif | 
|---|
 | 4 |  | 
|---|
 | 5 | set nocompatible        " Use Vim defaults (much better!) | 
|---|
 | 6 | set bs=indent,eol,start         " allow backspacing over everything in insert mode | 
|---|
 | 7 | "set ai                 " always set autoindenting on | 
|---|
 | 8 | "set backup             " keep a backup file | 
|---|
 | 9 | set viminfo=            " don't keep a viminfo file | 
|---|
 | 10 | set history=50          " keep 50 lines of command line history | 
|---|
 | 11 | set ruler               " show the cursor position all the time | 
|---|
 | 12 |  | 
|---|
 | 13 | " Only do this part when compiled with support for autocommands | 
|---|
 | 14 | if has("autocmd") | 
|---|
 | 15 |   " In text files, always limit the width of text to 78 characters | 
|---|
 | 16 |   autocmd BufRead *.txt set tw=78 | 
|---|
 | 17 |   " When editing a file, always jump to the last cursor position | 
|---|
 | 18 |   autocmd BufReadPost * | 
|---|
 | 19 |   \ if line("'\"") > 0 && line ("'\"") <= line("$") | | 
|---|
 | 20 |   \   exe "normal! g'\"" | | 
|---|
 | 21 |   \ endif | 
|---|
 | 22 |   " don't write swapfile on most commonly used directories for NFS mounts or USB sticks | 
|---|
 | 23 |   autocmd BufNewFile,BufReadPre /media/*,/mnt/* set directory=~/tmp,/var/tmp,/tmp | 
|---|
 | 24 |   " start with spec file template | 
|---|
 | 25 |   autocmd BufNewFile *.spec 0r /usr/share/vim/vimfiles/template.spec | 
|---|
 | 26 | endif | 
|---|
 | 27 |  | 
|---|
 | 28 | if has("cscope") && filereadable("/usr/bin/cscope") | 
|---|
 | 29 |    set csprg=/usr/bin/cscope | 
|---|
 | 30 |    set csto=0 | 
|---|
 | 31 |    set cst | 
|---|
 | 32 |    set nocsverb | 
|---|
 | 33 |    " add any database in current directory | 
|---|
 | 34 |    if filereadable("cscope.out") | 
|---|
 | 35 |       cs add cscope.out | 
|---|
 | 36 |    " else add database pointed to by environment | 
|---|
 | 37 |    elseif $CSCOPE_DB != "" | 
|---|
 | 38 |       cs add $CSCOPE_DB | 
|---|
 | 39 |    endif | 
|---|
 | 40 |    set csverb | 
|---|
 | 41 | endif | 
|---|
 | 42 |  | 
|---|
 | 43 | " Switch syntax highlighting on, when the terminal has colors | 
|---|
 | 44 | " Also switch on highlighting the last used search pattern. | 
|---|
 | 45 | if &t_Co > 2 || has("gui_running") | 
|---|
 | 46 |   syntax on | 
|---|
 | 47 |   set hlsearch | 
|---|
 | 48 | endif | 
|---|
 | 49 |  | 
|---|
 | 50 | filetype plugin on | 
|---|
 | 51 |  | 
|---|
 | 52 | if &term=="xterm" | 
|---|
 | 53 |      set t_Co=8 | 
|---|
 | 54 |      set t_Sb=[4%dm | 
|---|
 | 55 |      set t_Sf=[3%dm | 
|---|
 | 56 | endif | 
|---|
 | 57 |  | 
|---|
 | 58 | " Don't wake up system with blinking cursor: | 
|---|
 | 59 | " http://www.linuxpowertop.org/known.php | 
|---|
 | 60 | let &guicursor = &guicursor . ",a:blinkon0" | 
|---|