|
|
1fa1ff |
if v:lang =~ "utf8$" || v:lang =~ "UTF-8$"
|
|
|
1fa1ff |
set fileencodings=ucs-bom,utf-8,latin1
|
|
|
1fa1ff |
endif
|
|
|
1fa1ff |
|
|
|
1fa1ff |
set nocompatible " Use Vim defaults (much better!)
|
|
|
1fa1ff |
set bs=indent,eol,start " allow backspacing over everything in insert mode
|
|
|
1fa1ff |
"set ai " always set autoindenting on
|
|
|
1fa1ff |
"set backup " keep a backup file
|
|
|
1fa1ff |
set viminfo='20,\"50 " read/write a .viminfo file, don't store more
|
|
|
1fa1ff |
" than 50 lines of registers
|
|
|
1fa1ff |
set history=50 " keep 50 lines of command line history
|
|
|
1fa1ff |
set ruler " show the cursor position all the time
|
|
|
1fa1ff |
|
|
|
1fa1ff |
" Only do this part when compiled with support for autocommands
|
|
|
1fa1ff |
if has("autocmd")
|
|
|
073263 |
augroup redhat
|
|
|
1fa1ff |
autocmd!
|
|
|
1fa1ff |
" In text files, always limit the width of text to 78 characters
|
|
|
1fa1ff |
" autocmd BufRead *.txt set tw=78
|
|
|
1fa1ff |
" When editing a file, always jump to the last cursor position
|
|
|
1fa1ff |
autocmd BufReadPost *
|
|
|
1fa1ff |
\ if line("'\"") > 0 && line ("'\"") <= line("$") |
|
|
|
1fa1ff |
\ exe "normal! g'\"" |
|
|
|
1fa1ff |
\ endif
|
|
|
1fa1ff |
" don't write swapfile on most commonly used directories for NFS mounts or USB sticks
|
|
|
1fa1ff |
autocmd BufNewFile,BufReadPre /media/*,/run/media/*,/mnt/* set directory=~/tmp,/var/tmp,/tmp
|
|
|
1fa1ff |
" start with spec file template
|
|
|
1fa1ff |
autocmd BufNewFile *.spec 0r /usr/share/vim/vimfiles/template.spec
|
|
|
1fa1ff |
augroup END
|
|
|
1fa1ff |
endif
|
|
|
1fa1ff |
|
|
|
1fa1ff |
if has("cscope") && filereadable("/usr/bin/cscope")
|
|
|
1fa1ff |
set csprg=/usr/bin/cscope
|
|
|
1fa1ff |
set csto=0
|
|
|
1fa1ff |
set cst
|
|
|
1fa1ff |
set nocsverb
|
|
|
1fa1ff |
" add any database in current directory
|
|
|
1fa1ff |
if filereadable("cscope.out")
|
|
|
1fa1ff |
cs add $PWD/cscope.out
|
|
|
1fa1ff |
" else add database pointed to by environment
|
|
|
1fa1ff |
elseif $CSCOPE_DB != ""
|
|
|
1fa1ff |
cs add $CSCOPE_DB
|
|
|
1fa1ff |
endif
|
|
|
1fa1ff |
set csverb
|
|
|
1fa1ff |
endif
|
|
|
1fa1ff |
|
|
|
1fa1ff |
" Switch syntax highlighting on, when the terminal has colors
|
|
|
1fa1ff |
" Also switch on highlighting the last used search pattern.
|
|
|
1fa1ff |
if &t_Co > 2 || has("gui_running")
|
|
|
1fa1ff |
syntax on
|
|
|
1fa1ff |
set hlsearch
|
|
|
1fa1ff |
endif
|
|
|
1fa1ff |
|
|
|
1fa1ff |
filetype plugin on
|
|
|
1fa1ff |
|
|
|
1fa1ff |
if &term=="xterm"
|
|
|
1fa1ff |
set t_Co=8
|
|
|
1fa1ff |
set t_Sb=?[4%dm
|
|
|
1fa1ff |
set t_Sf=?[3%dm
|
|
|
1fa1ff |
endif
|
|
|
1fa1ff |
|
|
|
1fa1ff |
" Don't wake up system with blinking cursor:
|
|
|
1fa1ff |
" http://www.linuxpowertop.org/known.php
|
|
|
1fa1ff |
let &guicursor = &guicursor . ",a:blinkon0"
|