Permalink
Browse files

Merge.

  • Loading branch information...
2 parents c306764 + 92b7e1f commit 16e00eff43a8ac09a1b5b3180ff715d4d492ff40 @sjl committed Nov 19, 2012
View
@@ -3,7 +3,7 @@ b0da16490f168f68072973b45dbc27a74fb7b529 mercurial/histedit
4d95cb18a3b420154ef978c53de1d2e692f8343d mercurial/templates
64981213be2efd939e6e6e109e2b32c24e95fd95 vim/bundle/AnsiEsc.vim
9895285042a2fd5691b2f6582aa979e4d1bdffea vim/bundle/ack
-9e4a52112a78ce74db15ce9af3d81dacc982a1d3 vim/bundle/badwolf
+b8e07a24e77d3bad16a89bde409f97ccc307486a vim/bundle/badwolf
8533fffd9fbb690dfc8e334f91a10c72e35a6dce vim/bundle/clam
dc349bb7d30f713d770fc1fa0fe209e6aab82dc8 vim/bundle/commentary
3c6182371db8e8ede3789d21b52386569eda2208 vim/bundle/ctrlp
@@ -27,7 +27,7 @@ c6197a10ace82e0fe0c08e5cf5c017b7069a978e vim/bundle/sparkup
6eec2c131213850ed65fd6da494dfd1a0d620a4e vim/bundle/strftimedammit
7ee7f774dd1288ea2e7c57b63cb069a07d425ca0 vim/bundle/supertab
1a73f607f8f5477d6942df2eb6e7245c4864f4d3 vim/bundle/surround
-c2a16e88f8d2d5bb4cfaaa1a1e952a674d001dd0 vim/bundle/syntastic
+0a7b21d6021a3a565db066e7b8f7f158c918037c vim/bundle/syntastic
2dee007ddae8156735cbae7f0cd4e0a24ba7287b vim/bundle/tslime
1dae3b9a0e6fd9d05698bd45d501e232787f317a vim/bundle/vitality
8ebc225b364887c0557ab47ab2ca752a70123bee vim/bundle/yankring
View
View
@@ -147,6 +147,7 @@ prepend_to_path "/opt/subversion/bin"
prepend_to_path "$HOME/lib/hg/hg"
prepend_to_path "$HOME/Library/Haskell/bin"
prepend_to_path "/usr/local/Cellar/ruby/1.9.3-p194/bin"
+prepend_to_path "/Applications/Postgres.app/Contents/MacOS/bin"
set BROWSER open
View
@@ -20,7 +20,7 @@
l = log -18 --color=always --all --topo-order --pretty='format:%Cgreen%h%Creset %s%Cred%d%Creset %C(black bold)(by %an)%Creset'
ll = log --color=always --all --topo-order --pretty='format:%Cgreen%h%Creset %s%Cred%d%Creset %C(black bold)(by %an)%Creset'
gl = log -12 --color=always --all --graph --topo-order --pretty='format:%Cgreen%h%Creset %s %C(black bold)(by %an)%Creset%C(yellow bold)%d%Creset%n'
- gll = log --color=always --all --graph --topo-order --pretty='format:%Cgreen%h%Creset %s %C(black bold)(by %an)%Creset%C(yellow bold)%d%Creset%n'
+ gll = log --color=always --all --graph --topo-order --pretty='format:%Cgreen%h%Creset %s %C(black bold)(%cr by %an)%Creset%C(yellow bold)%d%Creset%n'
pull = pull --ff-only
up = merge --ff-only
@@ -0,0 +1 @@
+autocmd BufNewFile,BufRead *.ls set filetype=lispyscript
@@ -0,0 +1,8 @@
+if exists("b:did_lispyscript_ftplugin")
+ finish
+endif
+
+
+setlocal iskeyword+=-,>,?,=,!,<,>,+,*,/,%,&,|
+
+let b:did_lispyscript_ftplugin = 1
@@ -0,0 +1,35 @@
+" For now we'll just use normal Lisp indenting because it's 1 AM and I want to
+" go to bed.
+"
+" TODO: Steal VimClojure's magic indenting.
+
+if exists("b:did_indent")
+ finish
+endif
+let b:did_indent = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+setlocal expandtab nosmartindent
+
+setlocal softtabstop=2
+setlocal shiftwidth=2
+
+setlocal indentkeys=!,o,O
+
+setlocal autoindent
+setlocal indentexpr=
+setlocal lisp
+
+" Special words go here.
+setlocal lispwords=function,macro,do,->,var
+setlocal lispwords+=if,cond,when,unless
+setlocal lispwords+=try
+setlocal lispwords+=loop,each,each2d,eachKey,reduce,map,for
+
+" Custom:
+setlocal lispwords+=defn
+
+let &cpo = s:save_cpo
+
@@ -0,0 +1,58 @@
+if exists("b:current_syntax")
+ finish
+endif
+
+syntax keyword lispyscriptDefFunction function
+
+syntax keyword lispyscriptDefMacro macro
+
+syntax keyword lispyscriptKeyword do -> new object str var
+syntax keyword lispyscriptKeyword array arrayInit arrayInit2d
+syntax keyword lispyscriptTesting assert testGroup testRunner
+syntax keyword lispyscriptTemplating template template-repeat template-repeat-key
+
+syntax keyword lispyscriptOperator undefined? null? true? false? zero? boolean?
+syntax keyword lispyscriptOperator number? string? object? array? function?
+syntax keyword lispyscriptOperator = ! != > < <= >= + - * / % &&
+syntax match lispyscriptOperator "\v([ \t()]|^)\zs\|\|\ze([ \t()]|$)"
+
+syntax keyword lispyscriptConstant null undefined
+
+syntax keyword lispyscriptBoolean true false
+
+syntax keyword lispyscriptRepeat loop each each2d eachKey reduce map for
+
+syntax keyword lispyscriptConditional if cond when unless
+
+syntax keyword lispyscriptException try catch throw
+
+syntax keyword lispyscriptImport include
+
+syntax match lispyscriptComment "\v;.*$"
+
+syntax match lispyscriptNumber "\v<-?\d+(\.\d+)?>"
+
+syntax region lispyscriptString start=+"+ skip=+\\\\\|\\"+ end=+"\|$+
+
+" Custom words go here...
+syntax keyword lispyscriptKeyword defn
+syntax keyword lispyscriptKeyword onload
+
+highlight link lispyscriptKeyword Keyword
+highlight link lispyscriptTesting Keyword
+highlight link lispyscriptTemplating Keyword
+highlight link lispyscriptDefFunction Keyword
+highlight link lispyscriptDefMacro Keyword
+highlight link lispyscriptOperator Operator
+highlight link lispyscriptConditional Conditional
+highlight link lispyscriptException Exception
+highlight link lispyscriptImport Include
+highlight link lispyscriptBoolean Boolean
+highlight link lispyscriptRepeat Repeat
+highlight link lispyscriptNumber Number
+highlight link lispyscriptComment Comment
+highlight link lispyscriptString String
+highlight link lispyscriptConstant Constant
+
+let b:current_syntax = "lispyscript"
+
@@ -115,3 +115,8 @@ repos
plugin's
VCS
Vimscript's
+namespacing
+autocommands
+autocommand
+reindent
+Javascript
View
137 vim/vimrc
@@ -251,11 +251,6 @@ nnoremap K :q<cr>
" Toggle line numbers
nnoremap <leader>n :setlocal number!<cr>
-" Front and center
-" Use :sus for the rare times I want to actually background Vim.
-nnoremap <c-z> zMzvzz25<c-e>
-vnoremap <c-z> <esc>zv`<ztgv
-
" Sort lines
nnoremap <leader>s vip:!sort<cr>
vnoremap <leader>s :!sort<cr>
@@ -537,13 +532,6 @@ noremap <C-l> <C-w>l
noremap <leader>v <C-w>v
" }}}
-" Highlight word {{{
-
-nnoremap <silent> <leader>h1 :execute 'match InterestingWord1 /\<<c-r><c-w>\>/'<cr>
-nnoremap <silent> <leader>h2 :execute '2match InterestingWord2 /\<<c-r><c-w>\>/'<cr>
-nnoremap <silent> <leader>h3 :execute '3match InterestingWord3 /\<<c-r><c-w>\>/'<cr>
-
-" }}}
" Visual Mode */# from Scrooloose {{{
function! s:VSetSearch()
@@ -579,6 +567,18 @@ vnoremap <Space> za
" cursor happens to be.
nnoremap zO zCzO
+" "Focus" the current line. Basically:
+"
+" 1. Close all folds.
+" 2. Open just the folds containing the current line.
+" 3. Move the line to a little bit (15 lines) above the center of the screen.
+" 4. Pulse the cursor line. My eyes are bad.
+"
+" This mapping wipes out the z mark, which I never use.
+"
+" I use :sus for the rare times I want to actually background Vim.
+nnoremap <c-z> mzzMzvzz15<c-e>`z:Pulse<cr>
+
function! MyFoldText() " {{{
let line = getline(v:foldstart)
@@ -777,14 +777,16 @@ augroup ft_haskell
augroup END
" }}}
-" HTML and HTMLDjango {{{
+" HTML, Django, Jinja, Dram {{{
let g:html_indent_tags = ['p', 'li']
augroup ft_html
au!
au BufNewFile,BufRead *.html setlocal filetype=htmldjango
+ au BufNewFile,BufRead *.dram setlocal filetype=htmldjango
+
au FileType html,jinja,htmldjango setlocal foldmethod=manual
" Use <localleader>f to fold the current tag.
@@ -862,7 +864,7 @@ augroup END
augroup ft_markdown
au!
- au BufNewFile,BufRead *.m*down setlocal filetype=markdown
+ au BufNewFile,BufRead *.m*down setlocal filetype=markdown foldlevel=1
" Use <localleader>1/2/3 to add headings.
au Filetype markdown nnoremap <buffer> <localleader>1 yypVr=:redraw<cr>
@@ -1653,7 +1655,7 @@ function! s:HgDiff() " {{{
diffupdate
endfunction " }}}
command! -nargs=0 HgDiff call s:HgDiff()
-nnoremap <leader>hd :HgDiff<cr>
+" nnoremap <leader>hd :HgDiff<cr>
function! s:HgBlame() " {{{
let fn = expand('%:p')
@@ -1675,7 +1677,7 @@ function! s:HgBlame() " {{{
syncbind
endfunction " }}}
command! -nargs=0 HgBlame call s:HgBlame()
-nnoremap <leader>hb :HgBlame<cr>
+" nnoremap <leader>hb :HgBlame<cr>
" }}}
" Ack motions {{{
@@ -1741,25 +1743,118 @@ function! BlockColor() " {{{
call matchdelete(77883)
call matchdelete(77884)
call matchdelete(77885)
+ call matchdelete(77886)
else
let g:blockcolor_state = 1
call matchadd("BlockColor1", '^ \{4}.*', 1, 77881)
call matchadd("BlockColor2", '^ \{8}.*', 2, 77882)
call matchadd("BlockColor3", '^ \{12}.*', 3, 77883)
call matchadd("BlockColor4", '^ \{16}.*', 4, 77884)
call matchadd("BlockColor5", '^ \{20}.*', 5, 77885)
+ call matchadd("BlockColor6", '^ \{24}.*', 6, 77886)
endif
endfunction " }}}
" Default highlights {{{
-hi def BlockColor1 guibg=#222222
-hi def BlockColor2 guibg=#2a2a2a
-hi def BlockColor3 guibg=#353535
-hi def BlockColor4 guibg=#3d3d3d
-hi def BlockColor5 guibg=#444444
+hi def BlockColor1 guibg=#222222 ctermbg=234
+hi def BlockColor2 guibg=#2a2a2a ctermbg=235
+hi def BlockColor3 guibg=#353535 ctermbg=236
+hi def BlockColor4 guibg=#3d3d3d ctermbg=237
+hi def BlockColor5 guibg=#444444 ctermbg=238
+hi def BlockColor6 guibg=#4a4a4a ctermbg=239
" }}}
nnoremap <leader>B :call BlockColor()<cr>
" }}}
+" Pulse Line {{{
+
+function! s:Pulse() " {{{
+ let current_window = winnr()
+ windo set nocursorline
+ execute current_window . 'wincmd w'
+ setlocal cursorline
+
+ redir => old_hi
+ silent execute 'hi CursorLine'
+ redir END
+ let old_hi = split(old_hi, '\n')[0]
+ let old_hi = substitute(old_hi, 'xxx', '', '')
+
+ let steps = 9
+ let width = 1
+ let start = width
+ let end = steps * width
+ let color = 233
+
+ for i in range(start, end, width)
+ execute "hi CursorLine ctermbg=" . (color + i)
+ redraw
+ sleep 6m
+ endfor
+ for i in range(end, start, -1 * width)
+ execute "hi CursorLine ctermbg=" . (color + i)
+ redraw
+ sleep 6m
+ endfor
+
+ execute 'hi ' . old_hi
+endfunction " }}}
+command! -nargs=0 Pulse call s:Pulse()
+
+" }}}
+" Highlight Word {{{
+"
+" This mini-plugin provides a few mappings for highlighting words temporarily.
+"
+" Sometimes you're looking at a hairy piece of code and would like a certain
+" word or two to stand out temporarily. You can search for it, but that only
+" gives you one color of highlighting. Now you can use <leader>N where N is
+" a number from 1-6 to highlight the current word in a specific color.
+
+function! HiInterestingWord(n) " {{{
+ " Save our location.
+ normal! mz
+
+ " Yank the current word into the z register.
+ normal! "zyiw
+
+ " Calculate an arbitrary match ID. Hopefully nothing else is using it.
+ let mid = 86750 + a:n
+
+ " Clear existing matches, but don't worry if they don't exist.
+ silent! call matchdelete(mid)
+
+ " Construct a literal pattern that has to match at boundaries.
+ let pat = '\V\<' . escape(@z, '\') . '\>'
+
+ " Actually match the words.
+ call matchadd("InterestingWord" . a:n, pat, 1, mid)
+
+ " Move back to our original location.
+ normal! `z
+endfunction " }}}
+
+" Mappings {{{
+
+nnoremap <silent> <leader>1 :call HiInterestingWord(1)<cr>
+nnoremap <silent> <leader>2 :call HiInterestingWord(2)<cr>
+nnoremap <silent> <leader>3 :call HiInterestingWord(3)<cr>
+nnoremap <silent> <leader>4 :call HiInterestingWord(4)<cr>
+nnoremap <silent> <leader>5 :call HiInterestingWord(5)<cr>
+nnoremap <silent> <leader>6 :call HiInterestingWord(6)<cr>
+
+" }}}
+" Default Highlights {{{
+
+hi def InterestingWord1 guifg=#000000 ctermfg=16 guibg=#ffa724 ctermbg=214
+hi def InterestingWord2 guifg=#000000 ctermfg=16 guibg=#aeee00 ctermbg=154
+hi def InterestingWord3 guifg=#000000 ctermfg=16 guibg=#8cffba ctermbg=121
+hi def InterestingWord4 guifg=#000000 ctermfg=16 guibg=#b88853 ctermbg=137
+hi def InterestingWord5 guifg=#000000 ctermfg=16 guibg=#ff9eb8 ctermbg=211
+hi def InterestingWord6 guifg=#000000 ctermfg=16 guibg=#ff2c4b ctermbg=195
+
+" }}}
+
+" }}}
" }}}
" Environments (GUI/Console) ---------------------------------------------- {{{

0 comments on commit 16e00ef

Please sign in to comment.