Steve Losh avatar Steve Losh committed 63c73a1 Merge

Merge.

Comments (0)

Files changed (5)

 function weechat; weechat-curses $argv; end
 
 function collapse; sed -e 's/  */ /g'; end
-function cuts; cut -d' '; end
+function cuts; cut -d' ' $argv; end
 
 function v; vim $argv; end
 function V; vim . $argv; end
     ksdiff = difftool -y -t Kaleidoscope
     ksshow = "!sh -c 'git ksdiff $1^..$1;' -"
 
+    sl = "!sh -c 'git show --color=always $1 | less -R' -"
+
 [push]
     default = current
 
 
 # hg n .     -- show a summary of rev . without diff.
 # hg show .  -- show a summary of rev . with diff.
+# hg sl .    -- show a summary of rev . with diff, piped to less
 nlog = log --style=$HOME/lib/dotfiles/mercurial/templates/map-cmdline.nlog
 n = nlog -vr
 show = nlog --color=always -vpr
+sl = !"$HG" nlog --color=always -vpr $@ | less -R
 
 # Simple glog command that doesn't look bad and doesn't require my CLI templates.
 gl = glog -l10 --template='\033[0;33m{rev}\033[0m {desc|firstline|strip} \033[0;35m{branches}\033[0m \033[0;33m{tags}\033[0m\n\033[1;30m({date|age} by {author|person})\033[0m\n\n'
-\e[O: ''
-\e[I: ''
 " Resize splits when the window is resized
 au VimResized * :wincmd =
 
+" Leader
+let mapleader = ","
+let maplocalleader = "\\"
+
 " Cursorline {{{
 " Only show cursorline in the current window and in normal mode.
 
 
 " }}}
 " Trailing whitespace {{{
-" Save {{{
-
-" augroup its2012justfuckingsavealready
-"     au!
-"     au InsertLeave * :silent! wa
-"     au CursorHold * :silent! wa
-"     au CursorHoldI * :silent! wa
-" augroup END
-
-" }}}
 " Only shown when not in insert mode so I don't go insane.
 
 augroup trailing
 " Backups {{{
 
 set backup                        " enable backups
-set noswapfile                    " It's 2012, Vim.
+set noswapfile                    " it's 2013, Vim.
 
 set undodir=~/.vim/tmp/undo//     " undo files
 set backupdir=~/.vim/tmp/backup// " backups
 endif
 
 " }}}
-" Leader {{{
-
-let mapleader = ","
-let maplocalleader = "\\"
-
-" }}}
 " Color scheme {{{
 
 syntax on
 " Convenience mappings ---------------------------------------------------- {{{
 
 " Fuck you, help key.
-noremap  <F1> :set invfullscreen<CR>
-inoremap <F1> <ESC>:set invfullscreen<CR>a
+noremap  <F1> <nop>
+inoremap <F1> <nop>
 
 " Stop it, hash key.
 inoremap # X<BS>#
 " For some reason Vim no longer wants to talk to the OS X pasteboard through "*.
 " Computers are bullshit.
 function! g:FuckingCopyTheTextPlease()
-    normal! gv
-    silent '<,'>w !pbcopy
+    let old_z = @z
+    normal! gv"zy
+    call system('pbcopy', @z)
+    let @z = old_z
 endfunction
 noremap <leader>p :silent! set paste<CR>"*p:set nopaste<CR>
 noremap <leader>p :r!pbpaste<cr>
 vnoremap u <nop>
 vnoremap gu u
 
-" For some reason ctags refuses to ignore Python variables, so I'll just hack
-" the tags file with sed and strip them out myself.
-"
-" Sigh.
+" Rebuild Ctags (mnemonic RC -> CR -> <cr>)
 nnoremap <leader><cr> :silent !myctags<cr>:redraw!<cr>
 
 " Highlight Group(s)
 " Clean trailing whitespace
 nnoremap <leader>w mz:%s/\s\+$//<cr>:let @/=''<cr>`z
 
-" Send visual selection to gist.github.com as a private, filetyped Gist
-" Requires the gist command line too (brew install gist)
-" vnoremap <leader>G :w !gist -p -t %:e \| pbcopy<cr>
-" vnoremap <leader>UG :w !gist -p \| pbcopy<cr>
-
 " Send visual selection to paste.stevelosh.com
 vnoremap <c-p> :w !curl -sF 'sprunge=<-' 'http://paste.stevelosh.com' \| tr -d '\n ' \| pbcopy && open `pbpaste`<cr>
 
-" Insert the directory of the current buffer in command line mode
-cnoremap <expr> %% getcmdtype() == ':' ? expand('%:h').'/' : '%%'
-
 " Select entire buffer
 nnoremap vaa ggvGg_
 nnoremap Vaa ggVG
 " Panic Button
 nnoremap <f9> mzggg?G`z
 
-" Emacs bindings in command line mode
-cnoremap <c-a> <home>
-cnoremap <c-e> <end>
-
 " Diffoff
 nnoremap <leader>D :diffoff!<cr>
 
 nnoremap S i<cr><esc>^mwgk:silent! s/\v +$//<cr>:noh<cr>`w
 
 " HTML tag closing
-inoremap <C-_> <Space><BS><Esc>:call InsertCloseTag()<cr>a
+inoremap <C-_> <space><bs><esc>:call InsertCloseTag()<cr>a
 
 " Source
 vnoremap <leader>S y:execute @@<cr>:echo 'Sourced selection.'<cr>
 command! -bang WQ wq<bang>
 
 " I suck at typing.
-nnoremap <localleader>= ==
 vnoremap - =
 
 " Toggle paste
 " Unfuck my screen
 nnoremap U :syntax sync fromstart<cr>:redraw!<cr>
 
-" Drag Lines {{{
-
-" <m-j> and <m-k> to drag lines in any mode
-noremap ∆ :m+<CR>
-noremap ˚ :m-2<CR>
-inoremap ∆ <Esc>:m+<CR>
-inoremap ˚ <Esc>:m-2<CR>
-vnoremap ∆ :m'>+<CR>gv
-vnoremap ˚ :m-2<CR>gv
-
-" }}}
 " Easy filetype switching {{{
 
 nnoremap _md :set ft=markdown<CR>
 " Heresy
 inoremap <c-a> <esc>I
 inoremap <c-e> <esc>A
+cnoremap <c-a> <home>
+cnoremap <c-e> <end>
 
 " gi already moves to "last place you exited insert mode", so we'll map gI to
 " something similar: move to last change
 
 " Directional Keys {{{
 
-" It's 2012.
+" It's 2013.
 noremap j gj
 noremap k gk
 noremap gj j
 " Ack {{{
 
 nnoremap <leader>a :Ack!<space>
-let g:ackprg = 'ag --nogroup --nocolor --column'
+let g:ackprg = 'ag --smart-case --nogroup --nocolor --column'
 
 " }}}
 " Autoclose {{{
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.