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