From b4540002f270371f2777fde2ffa6de5fac2342dd Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Thu, 3 Jan 2013 10:57:25 -0800 Subject: [PATCH] Vimrc file cleanup and tweaks --- vimrc | 43 +++++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/vimrc b/vimrc index 0d6ef28..9be55f5 100644 --- a/vimrc +++ b/vimrc @@ -42,15 +42,14 @@ set lcs+=nbsp:・ " show non-breaking spaces set ignorecase " ignore case in searches set smartcase " case-sensitive search if pattern contains a capital set incsearch " show search matches as you type -set hlsearch " highlight search matches set gdefault " apply searches globally to a line by default set laststatus=2 " always show status line " This is basically default status line, with a few exceptions: -" 1. Show buffer number before filename (b%n:) -" 2. Show filetype before ruler -set statusline=% " toggle paste mode with F2 +set pastetoggle= " toggle paste mode with F12 " completion menu set wildmenu @@ -114,11 +113,15 @@ if &t_Co > 2 || has('gui_running') syntax on " turn on syntax highlighting endif -set bg=dark +if has('gui_running') + set bg=light +else + set bg=dark +endif " use solarized colorscheme if the terminal can support it (or we're in a GUI) -let g:solarized_termtrans=1 -let g:solarized_visibility='low' +let g:solarized_termtrans = 1 +let g:solarized_visibility = 'low' colorscheme solarized " tell SnipMate who I am @@ -127,7 +130,9 @@ let g:snips_author = 'Eryn Wells ' " set the Gundo preview window on the bottom let g:gundo_preview_bottom = 1 -nmap :GundoToggle +map :GundoToggle +map :NERDTreeToggle +map :setlocal invlist inoremap jj @@ -149,6 +154,9 @@ nnoremap j nnoremap k nnoremap l +nnoremap :bn +nnoremap :bp + function! StripTrailingWhitespace() " save last search let _s=@/ @@ -166,21 +174,19 @@ let mapleader=',' " strip all trailing whitespace in the current file nnoremap W :call StripTrailingWhitespace() " edit and source my .vimrc -nmap ev :tabnew $MYVIMRC +nmap ev :e $MYVIMRC nmap sv :source $MYVIMRC " hide search terms -nmap :nohlsearch +nmap :setlocal invhlsearch " find all nmap fa :%s/\v nmap sn :e ~/.vim/bundle/snipmate/snippets/=&filetype.snippets " Toggle position highlighting -nmap cl :set invcursorline -nmap cc :set invcursorcolumn +nmap cl :setlocal invcursorline +nmap cc :setlocal invcursorcolumn -" Toggle listmode -map :set invlist " Command-T should open files in tabs when I hit ; move opening files in " buffers to @@ -190,9 +196,6 @@ let g:CommandTAcceptSelectionTabMap='' if has('autocmd') filetype plugin indent on - " Markdown files can also have the .md extension - autocmd BufAdd,BufEnter,BufFilePost *.md :setlocal ft=markdown - " Jump to last known cursor position unless it's the first line, or past the " end of the file autocmd BufReadPost * @@ -201,8 +204,8 @@ if has('autocmd') \ endif " Clean whitespace before saving: Python, C, HTML, and Objective-C - autocmd BufWritePre *.py,*.h,*.c,*.html,*.m - \ :call StripTrailingWhitespace() + autocmd BufWritePre *.py,*.h,*.c,*.html,*.m,*.mm,*.cc,*.hh + \ call StripTrailingWhitespace() endif if has('unix')