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