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