d4d26f2b7941

vim: tweaks
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Thu, 03 Mar 2011 09:28:33 -0500
parents 3269b4a6ff1f
children 26dcdc89026f
branches/tags (none)
files vim/.vimrc vim/colors/molokai.vim

Changes

--- a/vim/.vimrc	Mon Feb 28 17:10:33 2011 -0500
+++ b/vim/.vimrc	Thu Mar 03 09:28:33 2011 -0500
@@ -88,6 +88,10 @@
 " Useful Abbreviations -------------------------------------------------------- {{{
 
 iabbrev ldis ಠ_ಠ
+iabbrev sl/ http://stevelosh.com/
+iabbrev bb/ http://bitbucket.org/
+iabbrev bbs/ http://bitbucket.org/sjl/
+iabbrev sl@ steve@stevelosh.com
 
 " }}}
 " Searching and Movement ------------------------------------------------------ {{{
@@ -290,8 +294,10 @@
 " Faster Esc
 inoremap jk <ESC>
 
-" Easier buffer swapping
-nnoremap ` <C-^>
+" Marks and Quotes
+noremap ' `
+noremap æ '
+noremap ` <C-^>
 
 " Scratch
 nmap <leader><tab> :Sscratch<cr><C-W>x<C-j>:resize 15<cr>
@@ -302,7 +308,6 @@
 inoremap <expr> <C-p> pumvisible() ? '<C-n>' : '<C-n><C-r>=pumvisible() ? "\<lt>up>" : ""<CR>'
 inoremap <expr> <C-n> pumvisible() ? '<C-n>' : '<C-n><C-r>=pumvisible() ? "\<lt>Down>" : ""<CR>'
 
-
 " Make selecting inside an HTML tag less dumb
 nnoremap Vit vitVkoj
 nnoremap Vat vatV
@@ -452,11 +457,9 @@
 inoremap <s-cr> <esc>A:<cr>
 
 " }}}
-" Error toggle ---------------------------------------------------------------- {{{
+" Error toggles --------------------------------------------------------------- {{{
 
-nmap <silent> <f3> :ErrorsToggle<cr>
 command! ErrorsToggle call ErrorsToggle()
-
 function! ErrorsToggle() " {{{
   if exists("w:is_error_window")
     unlet w:is_error_window
@@ -468,12 +471,27 @@
   endif
 endfunction " }}}
 
+command! -bang -nargs=? QFixToggle call QFixToggle(<bang>0)
+function! QFixToggle(forced) " {{{
+  if exists("g:qfix_win") && a:forced == 0
+    cclose
+    unlet g:qfix_win
+  else
+    copen 10
+    let g:qfix_win = bufnr("$")
+  endif
+endfunction " }}}
+
+nmap <silent> <f3> :ErrorsToggle<cr>
+nmap <silent> <f4> :QFixToggle<cr>
+
 " }}}
 " Open quoted ----------------------------------------------------------------- {{{
 
 nnoremap <silent> <c-o> :OpenQuoted<cr>
 command! OpenQuoted call OpenQuoted()
 
+" Open the file in the current (or next) set of quotes.
 function! OpenQuoted() " {{{
     let @r = ''
 
@@ -502,29 +520,32 @@
 if has('gui_running')
     set guifont=Menlo:h12
 
+    " Remove all the UI cruft
     set go-=T
     set go-=l
     set go-=L
     set go-=r
     set go-=R
 
+    " PeepOpen
     if has("gui_macvim")
         macmenu &File.New\ Tab key=<nop>
         map <leader>t <Plug>PeepOpen
         map <leader><leader> ,w<Plug>PeepOpen
     end
 
+    " Only map Sparkup to ⌘+e when running in MacVim.
     let g:sparkupExecuteMapping = '<D-e>'
 
     highlight SpellBad term=underline gui=undercurl guisp=Orange
 
+    " Use a line-drawing char for pretty vertical splits.
     set fillchars=vert:│
 
+    " Different cursors for different modes.
     set guicursor=n-c:block-Cursor-blinkon0
     set guicursor+=v:block-vCursor-blinkon0
     set guicursor+=i-ci:ver20-iCursor
-else
-    set nocursorline
 endif
 
 " }}}
--- a/vim/colors/molokai.vim	Mon Feb 28 17:10:33 2011 -0500
+++ b/vim/colors/molokai.vim	Thu Mar 03 09:28:33 2011 -0500
@@ -13,14 +13,14 @@
 set background=dark
 let g:colors_name="molokai"
 
-hi Normal          guifg=#F8F8F2 guibg=#1C1E1F
-hi Folded          guifg=#666666 guibg=#1C1E1F
+hi Normal          guifg=#F8F8F2 guibg=#1B1E1F
+hi Folded          guifg=#666666 guibg=bg
 hi Comment         guifg=#5c7176
 hi CursorLine                    guibg=#232728
 hi CursorColumn                  guibg=#232728
 hi ColorColumn                   guibg=#232728
-hi LineNr          guifg=#AAAAAA guibg=#1C1E1F
-hi FoldColumn      guifg=#AAAAAA guibg=#1C1E1F
+hi LineNr          guifg=#AAAAAA guibg=bg
+hi FoldColumn      guifg=#AAAAAA guibg=bg
 
 hi Boolean         guifg=#AE81FF
 hi Character       guifg=#E6DB74
@@ -102,12 +102,12 @@
 hi WarningMsg      guifg=#FFFFFF guibg=#333333 gui=bold
 hi WildMenu        guifg=#66D9EF guibg=#000000
 
-hi MyTagListFileName guifg=#F92672 guibg=#1C1E1F gui=bold
+hi MyTagListFileName guifg=#F92672 guibg=bg gui=bold
 
 
 " Invisible character colors
-highlight NonText    guifg=#444444 guibg=#1C1E1F
-highlight SpecialKey guifg=#444444 guibg=#1C1E1F
+highlight NonText    guifg=#444444 guibg=bg
+highlight SpecialKey guifg=#444444 guibg=bg
 
 "
 " Support for 256-color terminal