X-Git-Url: https://code.kerkeslager.com/?a=blobdiff_plain;f=.vimrc;h=5aa1f563f684f823056d3e30fcb8f1ccb11eda53;hb=1ce39ef1ae4a376a098ec52398037461317d0853;hp=92fe29238edd01417616e787ed4ab98cc6bb9ade;hpb=0b848c1ed37b96dcf9ee8ea5c2c1260dbad49475;p=dotfiles diff --git a/.vimrc b/.vimrc index 92fe292..5aa1f56 100644 --- a/.vimrc +++ b/.vimrc @@ -1,6 +1,23 @@ " Don't imitate vi. set nocompatible +" Make tab-completion work more like bash. +set wildmenu +set wildmode=list:full + +" Ignore certain file extensions when tab-completing. +set wildignore=*.swp,*.bak,*.pyc,*.class,*.o,*.exe + +" Set filetype stuff to on. +filetype on +filetype plugin on +filetype indent on + +" Example filetype-specific setting: +" if has('autocmd') +" autocmd filetype python set expandtab +" endif + " Show line numbers. set number set numberwidth=4 @@ -8,6 +25,9 @@ set numberwidth=4 " Scroll five lines ahead of cursor. set scrolloff=5 +" Turn off error bells and visual bell +set noeb vb t_vb= + " Set up autoindentation. set smartindent filetype indent on @@ -18,6 +38,22 @@ set tabstop=4 set shiftwidth=4 set expandtab +" Allow backspacing over everything in insert mode. +set backspace=indent,eol,start + +"Highlight bad spacing. +highlight BadSpacing term=standout ctermbg=cyan +augroup Spacing + autocmd! + " Highlight tabulators and trailing spaces + autocmd BufNewFile,BufReadPre * match BadSpacing /\(\t\| *$\)/ + " Only highlight trailing space in tab-filled formats + autocmd FileType help,make match BadSpacing / *$/ +augroup END + +" Highlight search terms. +set hlsearch + " Search as you type. set incsearch @@ -32,15 +68,19 @@ set splitbelow splitright " Line wrapping off set nowrap +" Enlarge history and undo/redo buffers. +set history=1000 +set undolevels=1000 + " Reset colors to a clean state. if !has('gui_running') - set t_Co=8 t_md= + set t_Co=8 t_md= endif -" Enable syntax "highlighting. +" Enable syntax highlighting. syntax enable -" Force vim to sync syntax "highlighting from the beginning of the file. +" Force vim to sync syntax highlighting from the beginning of the file. syn sync fromstart " Set the color scheme to desert. @@ -56,4 +96,5 @@ noremap! noremap "" noremap! - +" Automatically reload the .vimrc when changes are made to it +au! BufWritePost .vimrc source %