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