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