# HG changeset patch # User Steve Losh # Date 1331221121 18000 # Node ID bdcdc5452cc37e1f79111c3f22a3eb8f866327c7 # Parent 5111987c92352ef3a4529bf057539dfb3f1163c0 Force correct background color on SpellCap. diff -r 5111987c9235 -r bdcdc5452cc3 .hgsub --- a/.hgsub Tue Mar 06 12:13:42 2012 -0500 +++ b/.hgsub Thu Mar 08 10:38:41 2012 -0500 @@ -18,7 +18,6 @@ vim/bundle/slimv = [hg]https://bitbucket.org/sjl/slimv vim/bundle/threesome = [hg]https://bitbucket.org/sjl/threesome.vim vim/bundle/vim-makegreen = [git]git://github.com/sjl/vim-makegreen.git -vim/bundle/vim-coffee-script = [git]https://github.com/kchmck/vim-coffee-script.git vim/bundle/supertab = [git]git://github.com/ervandew/supertab.git vim/bundle/linediff = [git]git://github.com/AndrewRadev/linediff.vim.git vim/bundle/indent-object = [git]git://github.com/michaeljsmith/vim-indent-object.git @@ -29,5 +28,6 @@ vim/bundle/powerline = [git]git://github.com/Lokaltog/vim-powerline.git vim/bundle/yankring = [git]git://github.com/vim-scripts/YankRing.vim.git vim/bundle/badwolf = [hg]https://bitbucket.org/sjl/badwolf/ +vim/bundle/tslime = [git]git://github.com/sjl/tslime.vim.git keymando/Plugins/abbrev = [git]git://github.com/keymando/abbrev.git diff -r 5111987c9235 -r bdcdc5452cc3 .hgsubstate --- a/.hgsubstate Tue Mar 06 12:13:42 2012 -0500 +++ b/.hgsubstate Thu Mar 08 10:38:41 2012 -0500 @@ -2,7 +2,7 @@ 4d95cb18a3b420154ef978c53de1d2e692f8343d mercurial/templates d2bb7878622e4c16203acf1c92a0f4bc7ac58003 vim/bundle/AnsiEsc.vim a41d5d52c39a31128e969e69acf800b198cb07f9 vim/bundle/ack -a9983b93bc23cbe81b9a5c92d5876251c47a7ac7 vim/bundle/badwolf +6073c4e56185776c0fc6a363612d729c6975404c vim/bundle/badwolf 93cb20dbfbab723e1557801469ae70f4f46499da vim/bundle/ctrlp 667a668e114e9ec0e5d4cbcb0962d835b23614c4 vim/bundle/easymotion 03e138c3496926b193402f4e1542f0a99924f999 vim/bundle/fugitive @@ -16,14 +16,14 @@ d6da78f985e99d8388cd55db2587b19abc0628c2 vim/bundle/powerline d27022dc0bf2302cf31015d1ca0a2f80d55f3596 vim/bundle/python-mode fa3563dda862c1dc46ddac32d8a9f939e9077379 vim/bundle/rainbow-parentheses -6cbccd24e335319cddd96b152f6d480912375039 vim/bundle/slimv +9bbaa62571c2324160c8b901bf2cadfd69f7afce vim/bundle/slimv c6197a10ace82e0fe0c08e5cf5c017b7069a978e vim/bundle/sparkup 6eec2c131213850ed65fd6da494dfd1a0d620a4e vim/bundle/strftimedammit -ac395b57fec47f034cba151d01669d134ac7041b vim/bundle/supertab +b8a34a485dfdda1f88a2290c8e4b611556cc2fc4 vim/bundle/supertab 4eb2cdfccc016889acfa3b5d63e8f390a87863cf vim/bundle/surround 2616623bb9208c4bf2559b6aa5c1eff53644a0f7 vim/bundle/syntastic bbc5193de145ba5334cf02693d959f475a3e850b vim/bundle/threesome -b944e534bd6bbfc4fd56d4ee1a8aa831188387b0 vim/bundle/vim-coffee-script +8b551fcb75170ffb5554a3b8bb456b4d8bae1020 vim/bundle/tslime 62b72580aba57cb5185bd077ac7a905c1c6893ea vim/bundle/vim-commentary 6362ba99c825afc046818807267d5c1143b5c887 vim/bundle/vim-javascript f21fbd8759d7fa6c3cb1bbb9fe05eae90422f01a vim/bundle/vim-makegreen diff -r 5111987c9235 -r bdcdc5452cc3 keymando/keymandorc.rb --- a/keymando/keymandorc.rb Tue Mar 06 12:13:42 2012 -0500 +++ b/keymando/keymandorc.rb Thu Mar 08 10:38:41 2012 -0500 @@ -10,9 +10,8 @@ # Application Switching ------------------------------------------------------------ map "", lambda { activate('Firefox') } map "", lambda { activate('Pixelmator') } -map "", lambda { activate('Pixen') } -map "", lambda { activate('MacVim') } -map "", lambda { activate('iTerm') } +map "", lambda { activate('Pixen') } +map "", lambda { activate('iTerm') } map "", lambda { activate('Rdio') } map "", lambda { activate('Twitter') } diff -r 5111987c9235 -r bdcdc5452cc3 tmux/tmux.conf --- a/tmux/tmux.conf Tue Mar 06 12:13:42 2012 -0500 +++ b/tmux/tmux.conf Thu Mar 08 10:38:41 2012 -0500 @@ -91,8 +91,10 @@ # Copy mode setw -g mode-keys vi -bind [ copy-mode +bind ` copy-mode +unbind [ unbind p bind p paste-buffer bind -t vi-copy v begin-selection bind -t vi-copy y copy-selection +bind -t vi-copy Escape cancel diff -r 5111987c9235 -r bdcdc5452cc3 vim/.vimrc --- a/vim/.vimrc Tue Mar 06 12:13:42 2012 -0500 +++ b/vim/.vimrc Thu Mar 08 10:38:41 2012 -0500 @@ -14,6 +14,7 @@ " }}} " Basic options ----------------------------------------------------------- {{{ + set encoding=utf-8 set modelines=0 set autoindent @@ -235,22 +236,17 @@ " Made D behave nnoremap D d$ -" Keep search matches in the middle of the window and pulse the line when moving -" to them. +" Don't move on * +nnoremap * * + +" Keep search matches in the middle of the window. nnoremap n nzzzv nnoremap N Nzzzv -" Don't move on * -nnoremap * * - " Same when jumping around nnoremap g; g;zz nnoremap g, g,zz -" Window resizing -nnoremap 5> -nnoremap 5< - " Easier to type, and I never use the default behavior. noremap H ^ noremap L g_ @@ -260,10 +256,10 @@ inoremap A " Open a Quickfix window for the last search. -nnoremap / :execute 'vimgrep /'.@/.'/g %':copen +nnoremap ? :execute 'vimgrep /'.@/.'/g %':copen " Ack for the last search. -nnoremap ? :execute "Ack! '" . substitute(substitute(substitute(@/, "\\\\<", "\\\\b", ""), "\\\\>", "\\\\b", ""), "\\\\v", "", "") . "'" +nnoremap / :execute "Ack! '" . substitute(substitute(substitute(@/, "\\\\<", "\\\\b", ""), "\\\\>", "\\\\b", ""), "\\\\v", "", "") . "'" " Fix linewise visual selection of various text objects nnoremap VV V @@ -272,23 +268,6 @@ nnoremap Vab vabV nnoremap VaB vaBV -" Error navigation {{{ -" -" Location List QuickFix Window -" (e.g. Syntastic) (e.g. Ack) -" ---------------------------------- -" Next | M-j M-Down | -" Previous | M-k M-Up | -" ---------------------------------- -" -nnoremap ∆ :lnextzvzz -nnoremap ˚ :lpreviouszvzz -inoremap ∆ :lnextzvzz -inoremap ˚ :lpreviouszvzz -nnoremap :cnextzvzz -nnoremap :cpreviouszvzz - -" }}} " Directional Keys {{{ " It's 2011. @@ -330,9 +309,6 @@ set foldlevelstart=0 -" Make the current location sane. -nnoremap zvzt - " Space to toggle folds. nnoremap za vnoremap za @@ -408,9 +384,6 @@ au BufNewFile,BufRead *.cljs set filetype=clojurescript au FileType clojurescript call TurnOnClojureFolding() - - " Send current toplevel form to dtach. - au FileType clojurescript nnoremap \ee mz:call SelectToplevelForm():call SendToDtach(1)`z augroup END " }}} @@ -437,7 +410,6 @@ au Syntax cram setlocal foldlevel=1 augroup END - " }}} " CSS and LessCSS {{{ @@ -539,15 +511,6 @@ " Use t to fold the current templatetag. au FileType html,jinja,htmldjango nmap t viikojozf - " Use Shift-Return to turn this: - " | - " - " into this: - " - " | - " - au FileType html,jinja,htmldjango nnoremap vitavitoi - " Smarter pasting au FileType html,jinja,htmldjango nnoremap p :YRPaste 'p'v`]=`] au FileType html,jinja,htmldjango nnoremap P :YRPaste 'P'v`]=`] @@ -561,7 +524,7 @@ au FileType jinja,htmldjango inoremap {%%} " Django variables - au FileType jinja,htmldjango inoremap {{}} + au FileType jinja,htmldjango inoremap {{}} augroup END " }}} @@ -678,7 +641,7 @@ au FileType python if exists("python_space_error_highlight") | unlet python_space_error_highlight | endif " Jesus, Python. Five characters of punctuation for a damn string? - au FileType python inoremap _(u'') + au FileType python inoremap _(u'') au FileType python inoremap """""" augroup END @@ -712,16 +675,6 @@ augroup END " }}} -" Scheme {{{ - -augroup ft_scheme - au! - - " Send current toplevel form to dtach. - au FileType scheme nnoremap \ee mz:call SelectToplevelForm():call SendToDtach(1)`z -augroup END - -" }}} " Vagrant {{{ augroup ft_vagrant @@ -762,9 +715,9 @@ " the tags file with sed and strip them out myself. " " Sigh. -nnoremap :silent !/usr/local/bin/ctags -R . && sed -i .bak -E -e '/^[^ ]+ [^ ]+.py .+v$/d' tags +nnoremap :silent !/usr/local/bin/ctags -R . && sed -i .bak -E -e '/^[^ ]+ [^ ]+.py .+v$/d' tags:redraw! -" Highlight Group +" Highlight Group(s) nnoremap :echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") . '> trans<' \ . synIDattr(synID(line("."),col("."),0),"name") . "> lo<" \ . synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . ">" @@ -802,14 +755,6 @@ " HTML tag closing inoremap :call InsertCloseTag()a -" Align text -nnoremap Al :left -nnoremap Ac :center -nnoremap Ar :right -vnoremap Al :left -vnoremap Ac :center -vnoremap Ar :right - " Less chording nnoremap ; : @@ -821,9 +766,6 @@ vnoremap S y:execute @@ nnoremap S ^vg_y:execute @@ -" Replaste -nnoremap "_ddPV`]= - " Marks and Quotes noremap ' ` noremap æ ' @@ -833,9 +775,6 @@ " Great for pasting Python lines into REPLs. nnoremap vv ^vg_ -" Calculator -inoremap yiW==0 - " Better Completion set completeopt=longest,menuone,preview @@ -860,35 +799,35 @@ " Toggle paste set pastetoggle= -" Quickreturn -inoremap A -inoremap A: - " Toggle [i]nvisible characters nnoremap i :set list! " Drag Lines {{{ -noremap :m+ -noremap :m-2 -inoremap :m+ -inoremap :m-2 -vnoremap :m'>+gv -vnoremap :m-2gv +" and to drag lines in any mode +noremap ∆ :m+ +noremap ˚ :m-2 +inoremap ∆ :m+ +inoremap ˚ :m-2 +vnoremap ∆ :m'>+gv +vnoremap ˚ :m-2gv " }}} " Easy filetype switching {{{ + nnoremap _md :set ft=markdown nnoremap _hd :set ft=htmldjango nnoremap _jt :set ft=htmljinja nnoremap _cw :set ft=confluencewiki nnoremap _pd :set ft=python.django nnoremap _d :set ft=diff + " }}} " Insert Mode Completion {{{ inoremap inoremap +inoremap " }}} " Quick editing {{{ @@ -901,6 +840,7 @@ nnoremap em vj:e ~/.mutt/muttrc nnoremap ez vj:e ~/lib/dotfiles/zsh4j nnoremap ek vj:e ~/lib/dotfiles/keymando/keymandorc.rb +nnoremap et vj:e ~/.tmux.conf " }}} @@ -909,7 +849,7 @@ " Ack {{{ -map a :Ack! +nnoremap a :Ack! " }}} " Autoclose {{{ @@ -921,7 +861,11 @@ nmap c CommentaryLine xmap c Commentary -au FileType htmldjango setlocal commentstring={#\ %s\ #} + +augroup plugin_commentary + au! + au FileType htmldjango setlocal commentstring={#\ %s\ #} +augroup END " }}} " Ctrl-P {{{ @@ -948,14 +892,14 @@ \ "jar|class|swp|swo|log|so|o|pyc|jpe?g|png|gif|mo|po" . \ ")$' | " . \ "egrep -v '^(\\./)?(" . - \ "deploy/|lib/|classes/|libs/|deploy/vendor/|.git/|.hg/|.svn/|.*migrations/" . + \ "deploy/|lib/|classes/|libs/|deploy/vendor/|.git/|.hg/|.svn/|.*migrations/" . \ ")'" -let my_ctrlp_user_command = "" . +let my_ctrlp_user_command = "" . \ "find %s '(' -type f -or -type l ')' -maxdepth 15 -not -path '*/\\.*/*' | " . \ ctrlp_filter_greps -let my_ctrlp_git_command = "" . +let my_ctrlp_git_command = "" . \ "cd %s && git ls-files | " . \ ctrlp_filter_greps @@ -1007,6 +951,7 @@ " Gundo {{{ nnoremap :GundoToggle + let g:gundo_debug = 1 let g:gundo_preview_bottom = 1 let g:gundo_tree_statusline = "Gundo" @@ -1056,8 +1001,10 @@ au Filetype nerdtree nnoremap K :q augroup END -let NERDTreeHighlightCursorline=1 -let NERDTreeIgnore = ['.vim$', '\~$', '.*\.pyc$', 'pip-log\.txt$', 'whoosh_index', 'xapian_index', '.*.pid', 'monitor.py', '.*-fixtures-.*.json', '.*\.o$', 'db.db', 'tags.bak'] +let NERDTreeHighlightCursorline = 1 +let NERDTreeIgnore = ['.vim$', '\~$', '.*\.pyc$', 'pip-log\.txt$', 'whoosh_index', + \ 'xapian_index', '.*.pid', 'monitor.py', '.*-fixtures-.*.json', + \ '.*\.o$', 'db.db', 'tags.bak'] let NERDTreeMinimalUI = 1 let NERDTreeDirArrows = 1 @@ -1146,15 +1093,15 @@ command! ScratchToggle call ScratchToggle() -function! ScratchToggle() " {{{ - if exists("w:is_scratch_window") - unlet w:is_scratch_window - exec "q" - else - exec "normal! :Sscratch\\J:resize 13\" - let w:is_scratch_window = 1 - endif -endfunction " }}} +function! ScratchToggle() + if exists("w:is_scratch_window") + unlet w:is_scratch_window + exec "q" + else + exec "normal! :Sscratch\\J:resize 13\" + let w:is_scratch_window = 1 + endif +endfunction nnoremap :ScratchToggle @@ -1213,6 +1160,14 @@ let g:threesome_wrap = "nowrap" " }}} +" tslime {{{ + +let g:tslime_ensure_trailing_newlines = 1 +let g:tslime_normal_mapping = 't' +let g:tslime_visual_mapping = 't' +let g:tslime_vars_mapping = 'T' + +" }}} " VimClojure {{{ let vimclojure#HighlightBuiltins = 1 @@ -1228,7 +1183,6 @@ omap H YRMapsExpression("", "^") endfunction - " }}} " }}} @@ -1282,9 +1236,9 @@ " Show the stack of syntax hilighting classes affecting whatever is under the " cursor. -function! SynStack() "{{{ +function! SynStack() echo join(map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")'), " > ") -endfunc "}}} +endfunc nnoremap :call SynStack() @@ -1293,7 +1247,7 @@ set diffopt-=iwhite let g:diffwhitespaceon = 1 -function! ToggleDiffWhitespace() "{{{ +function! ToggleDiffWhitespace() if g:diffwhitespaceon set diffopt-=iwhite let g:diffwhitespaceon = 0 @@ -1302,7 +1256,7 @@ let g:diffwhitespaceon = 1 endif diffupdate -endfunc "}}} +endfunc nnoremap dw :call ToggleDiffWhitespace() @@ -1343,30 +1297,6 @@ nnoremap < xgEp " }}} -" Dtach {{{ - -function! SendToDtach(visual) - if a:visual - silent '<,'>w !dtach -s /tmp/target - silent !echo \| dtach -s /tmp/target - else - normal! ^vg_ - silent '<,'>w !dtach -s /tmp/target - execute "normal! " - endif -endfunction - -function! SelectToplevelForm() - " lol - silent! normal vabababababababababababababababababababababababababab -endfunction - - -nnoremap ee :call SendToDtach(0) -vnoremap ee :call SendToDtach(1) -nnoremap eb mqggvG:call SendToDtach(1)`q - -" }}} " Nyan! {{{ function! NyanMe() " {{{ @@ -1487,7 +1417,7 @@ " }}} " Hg {{{ -function! s:HgDiff() +function! s:HgDiff() " {{{ diffthis let fn = expand('%:p') @@ -1506,11 +1436,11 @@ diffthis diffupdate -endf +endfunction " }}} command! -nargs=0 HgDiff call s:HgDiff() nnoremap hd :HgDiff -function! s:HgBlame() +function! s:HgBlame() " {{{ let fn = expand('%:p') wincmd v @@ -1528,7 +1458,7 @@ wincmd l setlocal scrollbind syncbind -endf +endfunction " }}} command! -nargs=0 HgBlame call s:HgBlame() nnoremap hb :HgBlame @@ -1544,8 +1474,8 @@ " Note: If the text covered by a motion contains a newline it won't work. Ack " searches line-by-line. -nnoremap \a :set opfunc=AckMotiong@ -xnoremap \a :call AckMotion(visualmode()) +nnoremap A :set opfunc=AckMotiong@ +xnoremap A :call AckMotion(visualmode()) function! s:CopyMotionForType(type) if a:type ==# 'v' @@ -1583,7 +1513,7 @@ echo 'Shell command ' . command . ' executed.' endfunction " }}} command! -complete=shellcmd -nargs=+ Shell call s:ExecuteInShell() -nnoremap ! :Shell +nnoremap ! :Shell " }}} " Indent Guides {{{ @@ -1637,6 +1567,8 @@ " Environments (GUI/Console) ---------------------------------------------- {{{ if has('gui_running') + " GUI Vim + set guifont=Menlo\ Regular\ for\ Powerline:h12 " Remove all the UI cruft @@ -1648,8 +1580,6 @@ highlight SpellBad term=underline gui=undercurl guisp=Orange - " Use a line-drawing char for pretty vertical splits. - " Different cursors for different modes. set guicursor=n-c:block-Cursor-blinkon0 set guicursor+=v:block-vCursor-blinkon0 @@ -1686,9 +1616,8 @@ end else " Console Vim - let &t_SI = "\]50;CursorShape=1\x7" - let &t_EI = "\]50;CursorShape=0\x7" + " Use a bar-shaped cursor for insert mode, even through tmux. if exists('$TMUX') let &t_SI = "\Ptmux;\\]50;CursorShape=1\x7\\\" let &t_EI = "\Ptmux;\\]50;CursorShape=0\x7\\\" @@ -1696,6 +1625,20 @@ let &t_SI = "\]50;CursorShape=1\x7" let &t_EI = "\]50;CursorShape=0\x7" endif + + " Save on losing focus. + if exists('$TMUX') + " let &t_ti = "\Ptmux;\" . &t_ti . "\e[?1004h" . "\\\" + " let &t_te = "\Ptmux;\" . "\e[?1004l" . &t_te . "\\\" + + " noremap [O :echom "TEST" + else + " if &term =~ "xterm.*" + " let &t_ti = &t_ti . "\e[?1004h" + " let &t_te = "\e[?1004l" . &t_te + " noremap [O :echom "TEST" + " endif + endif endif " }}}