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