# HG changeset patch # User Steve Losh # Date 1334255102 14400 # Node ID 02bd6c042190085f84e467d2115d6db4d3e9aedc # Parent cb94d1d947f52042257228ef0d03758723111aae Moar. diff -r cb94d1d947f5 -r 02bd6c042190 vim/.vimrc --- a/vim/.vimrc Thu Apr 12 13:14:20 2012 -0400 +++ b/vim/.vimrc Thu Apr 12 14:25:02 2012 -0400 @@ -350,6 +350,7 @@ nnoremap _md :set ft=markdown nnoremap _hd :set ft=htmldjango nnoremap _jt :set ft=htmljinja +nnoremap _js :set ft=javascript nnoremap _cw :set ft=confluencewiki nnoremap _pd :set ft=python.django nnoremap _d :set ft=diff @@ -1719,34 +1720,21 @@ " Handle the focus gained/lost signals in each mode separately. " - " The goal should be to do what you need and restore the state to what it - " was before, so it functions like an autocommand. This is easy for some - " modes and hard/impossible for others. - " - " If you don't need one it's best to map it to to be explicit (and - " prevent problems, especially in insert mode). + " The goal is to fire the autocmd and restore the state as cleanly as + " possible. This is easy for some modes and hard/impossible for others. " " EXAMPLES: - " nnoremap :echom "FOCUS LOST" - " nnoremap :echom "FOCUS GAINED" + nnoremap :doautocmd FocusLost % + nnoremap :doautocmd FocusGained % - " onoremap :echom "FOCUS LOST" - " onoremap :echom "FOCUS GAINED" - - " vnoremap :echom "FOCUS LOST"gv - " vnoremap :echom "FOCUS GAINED"gv + onoremap :doautocmd FocusLost % + onoremap :doautocmd FocusGained % - " inoremap :echom "FOCUS LOST"a - " inoremap :echom "FOCUS GAINED"a + vnoremap :doautocmd FocusLost %gv + vnoremap :doautocmd FocusGained %gv - nnoremap :wa - nnoremap - onoremap :wa - onoremap - vnoremap :wagv - vnoremap - inoremap :waa - inoremap + inoremap :doautocmd FocusLost % + inoremap :doautocmd FocusGained % endif " }}}