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