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