" Paul Gorman's .vimrc (http://paulgorman.org) set nocompatible " Enable features not found in vanilla vi set encoding=utf-8 " Execute per-project .vimrc files saved in the current directory: set secure " Disallow autocmd and shell commands in current directory " " Colors and highlighting " set t_Co=256 " Number of terminal colors set background=dark " Light or dark syntax on " Colorize code colorscheme paulg set spell spelllang=en_us " Enable running spell check set mouse= if has("gui_running") set guifont=Liberation\ Mono\ 9 set mouse=a " Enable mouse support set guioptions-=T " Hide toolbar set guioptions-=m " Hide menu set linespace=1 " Added pixels between vertical lines set guicursor=a:blinkon1350-blinkoff350 endif " " Search stuff " set ignorecase " Ignore case during search set smartcase " Be case sensitive if mixed-case search term set incsearch " Search as typed so far set showmatch " Show matching bracket set wildmenu " Enhanced command completion set nohlsearch " Highlight all search matches set nowrapscan " Don't wrap to top when search hits bottom " " Indents and Tabs " " (The help section for "tabstop" explains the viable options.) " It's simplest to have tabstop = shiftwidth = softtabstop. set tabstop=4 " One tab equals four... no, eight spaces (existing code) set shiftwidth=4 " Tab width in normal mode (autoindent or >>) set softtabstop=4 " Tab width in insert mode set noexpandtab " Convert tabs into spaces? set smarttab " Delete shiftwidth at start of line (not single spaces) set autoindent " Automatic indent set nosmartindent " Don't auto indent new lines set backspace=indent,eol,start " Allow backspace over autoindents & linebreaks " " Key Mappings " nmap h :set hlsearch! cursorline! nmap n :set nu! rnu! list! spell! nmap o ok nmap O Oj function ToggleMouseMode() if (&mouse == 'a') set mouse= echo "no mouse" else set mouse=a echo "mouse all" endif endfunction nmap m :call ToggleMouseMode() " " Interface/Display Preferences " set title " Show file name in window title bar set titlestring=vim\ %F set cmdheight=1 " 2 doesn't seem to avoid 'press to continue' set shortmess=atI " I=No vim intro msg; t=truncate long msg; a=Shorten msg set shm=at " Short messages. Again, trying to avoid 'press ' set laststatus=2 " Always show status line set showcmd " Display incomplete commands set noruler " Show column and line number in status line set statusline=%m\ \%F\ %r%y%=col\ %v\ line\ %l\/%L\ %p%% set showmode " Show insert, visual, or replace mode in cmd area set scrolloff=4 " Scroll to show 4 lines above or below cursor set noerrorbells " Don't beep at me set visualbell " Don't beep on error set rnu " Turn on relative line numbering set nu " Turn on line numbering set nocursorline " Highlight current cursor line " :help 21.3 " Default is viminfo='100,<50,s10,h " s doesn't seem to be documented. It's the KB saved in each register. set viminfo='500,f1,<200,:200,@200,/200,s20,h " Show long lines and trailing spaces " CTRL-K -> for → " CTRL-K .M for · " CTRL-K .3 for ⋯ " CTRL-K Tr for ▷ " CTRL-K >1 › " CTRL-K vv │ " (use :dig for a list of diagraphs) set list listchars=tab:│\ ,extends:→,trail:· " " Folding " set foldmethod=manual set foldlevel=99 set viewoptions-=options autocmd BufWinLeave *.* mkview autocmd BufWinEnter *.* silent loadview " " Misc " let html_use_css = 1 " Use CSS when exporting files with 2html set magic " Type of regular expression matching set printoptions=header:0,paper:letter set hidden " Switch buffers without saving AND without discarding changes. set autochdir " Change working dir to dir of edited file set nojoinspaces " Only one space between sentences of joined lines! " Look for ctags tag file: set tags=./tags,tags;$HOME " " Types of Files " " Find the filetype of the current buffer with ":set ft?". filetype on " Detect filetype filetype plugin on " Load plugins for detected filetype filetype indent on " Filetype specific autoindent " Don't decorate log files. autocmd BufNewfile,BufRead *.log set filetype=messages autocmd FileType messages setlocal nospell autocmd FileType messages setlocal nornu autocmd FileType messages setlocal nonu autocmd BufEnter *.go colorscheme paulg-colorful