X-Git-Url: https://code.kerkeslager.com/?a=blobdiff_plain;f=.vimrc;h=b48496e00c1d6ac8585e229fe4310dbb8b825fd2;hb=342890eff5844f8cfb8eea6d07cbc912c4992a68;hp=e0ba2ef0579e459d5cc105e268f022c6fef9164d;hpb=497a143384f5299f33f3b61ee87b9e44caef29b1;p=dotfiles diff --git a/.vimrc b/.vimrc index e0ba2ef..b48496e 100644 --- a/.vimrc +++ b/.vimrc @@ -1,28 +1,55 @@ " Don't imitate vi. set nocompatible -" Show line numbers. -set number -set numberwidth=4 +" Make tab-completion work more like bash. +set wildmenu +set wildmode=list:full -" Scroll five lines ahead of cursor. -set scrolloff=5 +" 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 " Set up autoindentation. set smartindent filetype indent on +" Example filetype-specific setting: +" if has('autocmd') +" autocmd filetype python set expandtab +" endif + +" Allow folding. +set foldenable +set foldmethod=syntax +set foldlevelstart=99 + +" Scroll five lines ahead of cursor. +set scrolloff=5 + +" Turn off error bells and visual bell +set noeb vb t_vb= + " Set tabs to width 4. -set softtabstop=4 -set tabstop=4 -set shiftwidth=4 +filetype plugin indent on +set shiftwidth=2 +set softtabstop=2 +set tabstop=2 set expandtab -"Highlight bad spacing +" language-specific settings +autocmd FileType python setlocal shiftwidth=4 softtabstop=4 tabstop=4 + +" 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 (nasty bastards) + " 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 / *$/ @@ -42,15 +69,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. @@ -66,4 +97,5 @@ noremap! noremap "" noremap! - +" Automatically reload the .vimrc when changes are made to it +au! BufWritePost .vimrc source %