da4393
" When started as "evim", evim.vim will already have done these settings.
da4393
if v:progname =~? "evim"
da4393
  finish
da4393
endif
da4393
da4393
" Use Vim settings, rather than Vi settings (much better!).
da4393
" This must be first, because it changes other options as a side effect.
da4393
" Avoid side effects when it was already reset.
da4393
if &compatible
da4393
  set nocompatible
da4393
endif
da4393
da4393
" When the +eval feature is missing, the set command above will be skipped.
da4393
" Use a trick to reset compatible only when the +eval feature is missing.
da4393
silent! while 0
da4393
  set nocompatible
da4393
silent! endwhile
da4393
da4393
" Allow backspacing over everything in insert mode.
da4393
set backspace=indent,eol,start
da4393
da4393
"set ai			" always set autoindenting on
da4393
"set backup		" keep a backup file
da4393
set viminfo='20,\"50	" read/write a .viminfo file, don't store more
da4393
			" than 50 lines of registers
da4393
set history=50		" keep 50 lines of command line history
da4393
set ruler		" show the cursor position all the time
da4393
set showcmd		" display incomplete commands
da4393
set wildmenu		" display completion matches in a status line
da4393
da4393
set ttimeout		" time out for key codes
da4393
set ttimeoutlen=100	" wait up to 100ms after Esc for special key
da4393
da4393
" Show @@@ in the last line if it is truncated.
da4393
set display=truncate
da4393
da4393
" Show a few lines of context around the cursor.  Note that this makes the
da4393
" text scroll if you mouse-click near the start or end of the window.
da4393
set scrolloff=5
da4393
da4393
" Do incremental searching when it's possible to timeout.
da4393
if has('reltime')
da4393
  set incsearch
da4393
endif
da4393
da4393
" Do not recognize octal numbers for Ctrl-A and Ctrl-X, most users find it
da4393
" confusing.
da4393
set nrformats-=octal
da4393
da4393
" Only do this part when compiled with support for autocommands
da4393
if has("autocmd")
da4393
  augroup fedora
da4393
  autocmd!
da4393
  " In text files, always limit the width of text to 78 characters
da4393
  " autocmd BufRead *.txt set tw=78
da4393
  " When editing a file, always jump to the last cursor position
da4393
  autocmd BufReadPost *
da4393
  \ if line("'\"") > 0 && line ("'\"") <= line("$") |
da4393
  \   exe "normal! g'\"" |
da4393
  \ endif
da4393
  " don't write swapfile on most commonly used directories for NFS mounts or USB sticks
da4393
  autocmd BufNewFile,BufReadPre /media/*,/run/media/*,/mnt/* set directory=~/tmp,/var/tmp,/tmp
da4393
  " start with spec file template
da4393
  " 1724126 - do not open new file with .spec suffix with spec file template
da4393
  " apparently there are other file types with .spec suffix, so disable the
da4393
  " template
da4393
  " autocmd BufNewFile *.spec 0r /usr/share/vim/vimfiles/template.spec
da4393
  augroup END
da4393
endif
da4393
da4393
if has("cscope") && filereadable("/usr/bin/cscope")
da4393
   set csprg=/usr/bin/cscope
da4393
   set csto=0
da4393
   set cst
da4393
   set nocsverb
da4393
   " add any database in current directory
da4393
   if filereadable("cscope.out")
da4393
      cs add $PWD/cscope.out
da4393
   " else add database pointed to by environment
da4393
   elseif $CSCOPE_DB != ""
da4393
      cs add $CSCOPE_DB
da4393
   endif
da4393
   set csverb
da4393
endif
da4393
da4393
" Switch syntax highlighting on, when the terminal has colors
da4393
" Also switch on highlighting the last used search pattern.
da4393
if &t_Co > 2 || has("gui_running")
da4393
  " Revert with ":syntax off".
da4393
  syntax on
da4393
da4393
  " I like highlighting strings inside C comments.
da4393
  " Revert with ":unlet c_comment_strings".
da4393
  let c_comment_strings=1
da4393
  set hlsearch
da4393
endif
da4393
da4393
filetype plugin on
da4393
da4393
if &term=="xterm"
da4393
     set t_Co=8
da4393
     set t_Sb=?[4%dm
da4393
     set t_Sf=?[3%dm
da4393
endif
da4393
da4393
" Convenient command to see the difference between the current buffer and the
da4393
" file it was loaded from, thus the changes you made.
da4393
" Only define it when not defined already.
da4393
" Revert with: ":delcommand DiffOrig".
da4393
if !exists(":DiffOrig")
da4393
  command DiffOrig vert new | set bt=nofile | r ++edit # | 0d_ | diffthis
da4393
		  \ | wincmd p | diffthis
da4393
endif
da4393
da4393
if has('langmap') && exists('+langremap')
da4393
  " Prevent that the langmap option applies to characters that result from a
da4393
  " mapping.  If set (default), this may break plugins (but it's backward
da4393
  " compatible).
da4393
  set nolangremap
da4393
endif
da4393
da4393
" Don't wake up system with blinking cursor:
da4393
let &guicursor = &guicursor . ",a:blinkon0"
da4393
da4393
" Source a global configuration file if available
da4393
if filereadable("/etc/vimrc.local")
da4393
  source /etc/vimrc.local
da4393
endif