Skip to content

Commit

Permalink
More.
Browse files Browse the repository at this point in the history
  • Loading branch information
sjl committed Apr 8, 2013
1 parent 80d8db0 commit 2fd60e3
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 57 deletions.
6 changes: 3 additions & 3 deletions fish/config.fish
Expand Up @@ -48,7 +48,7 @@ function pbpb; pbp | pb; end
function weechat; weechat-curses $argv; end function weechat; weechat-curses $argv; end


function collapse; sed -e 's/ */ /g'; 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
function V; vim . $argv; end function V; vim . $argv; end
Expand Down Expand Up @@ -122,8 +122,8 @@ function fish_user_key_bindings
bind \cn accept-autosuggestion bind \cn accept-autosuggestion


# Ignore iterm2 escape sequences. Vim will handle them if needed. # Ignore iterm2 escape sequences. Vim will handle them if needed.
bind \e\[I true # bind \e\[I true
bind \e\[O true # bind \e\[O true
# ]] # ]]
end end


Expand Down
2 changes: 2 additions & 0 deletions gitconfig
Expand Up @@ -70,6 +70,8 @@
ksdiff = difftool -y -t Kaleidoscope ksdiff = difftool -y -t Kaleidoscope
ksshow = "!sh -c 'git ksdiff $1^..$1;' -" ksshow = "!sh -c 'git ksdiff $1^..$1;' -"


sl = "!sh -c 'git show --color=always $1 | less -R' -"

[push] [push]
default = current default = current


Expand Down
2 changes: 2 additions & 0 deletions hgrc
Expand Up @@ -180,9 +180,11 @@ i, = incoming --graph --style=$HOME/lib/dotfiles/mercurial/templates/map-cmdline


# hg n . -- show a summary of rev . without diff. # hg n . -- show a summary of rev . without diff.
# hg show . -- show a summary of rev . with 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 nlog = log --style=$HOME/lib/dotfiles/mercurial/templates/map-cmdline.nlog
n = nlog -vr n = nlog -vr
show = nlog --color=always -vpr 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. # 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' 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'
Expand Down
2 changes: 0 additions & 2 deletions inputrc
@@ -1,2 +0,0 @@
\e[O: ''
\e[I: ''
69 changes: 17 additions & 52 deletions vim/vimrc
Expand Up @@ -71,6 +71,10 @@ au FocusLost * :silent! wall
" Resize splits when the window is resized " Resize splits when the window is resized
au VimResized * :wincmd = au VimResized * :wincmd =


" Leader
let mapleader = ","
let maplocalleader = "\\"

" Cursorline {{{ " Cursorline {{{
" Only show cursorline in the current window and in normal mode. " Only show cursorline in the current window and in normal mode.


Expand All @@ -92,16 +96,6 @@ augroup END


" }}} " }}}
" Trailing whitespace {{{ " 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. " Only shown when not in insert mode so I don't go insane.


augroup trailing augroup trailing
Expand Down Expand Up @@ -163,7 +157,7 @@ set colorcolumn=+1
" Backups {{{ " Backups {{{


set backup " enable 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 undodir=~/.vim/tmp/undo// " undo files
set backupdir=~/.vim/tmp/backup// " backups set backupdir=~/.vim/tmp/backup// " backups
Expand All @@ -180,12 +174,6 @@ if !isdirectory(expand(&directory))
call mkdir(expand(&directory), "p") call mkdir(expand(&directory), "p")
endif endif


" }}}
" Leader {{{

let mapleader = ","
let maplocalleader = "\\"

" }}} " }}}
" Color scheme {{{ " Color scheme {{{


Expand Down Expand Up @@ -242,8 +230,8 @@ inoremap <c-l> <c-k>l*
" Convenience mappings ---------------------------------------------------- {{{ " Convenience mappings ---------------------------------------------------- {{{


" Fuck you, help key. " Fuck you, help key.
noremap <F1> :set invfullscreen<CR> noremap <F1> <nop>
inoremap <F1> <ESC>:set invfullscreen<CR>a inoremap <F1> <nop>
" Stop it, hash key. " Stop it, hash key.
inoremap # X<BS># inoremap # X<BS>#
Expand All @@ -270,8 +258,10 @@ nnoremap <leader>) :tabnext<cr>
" For some reason Vim no longer wants to talk to the OS X pasteboard through "*. " For some reason Vim no longer wants to talk to the OS X pasteboard through "*.
" Computers are bullshit. " Computers are bullshit.
function! g:FuckingCopyTheTextPlease() function! g:FuckingCopyTheTextPlease()
normal! gv let old_z = @z
silent '<,'>w !pbcopy normal! gv"zy
call system('pbcopy', @z)
let @z = old_z
endfunction endfunction
noremap <leader>p :silent! set paste<CR>"*p:set nopaste<CR> noremap <leader>p :silent! set paste<CR>"*p:set nopaste<CR>
noremap <leader>p :r!pbpaste<cr> noremap <leader>p :r!pbpaste<cr>
Expand All @@ -282,10 +272,7 @@ vnoremap <leader>y :<c-u>call g:FuckingCopyTheTextPlease()<cr>
vnoremap u <nop> vnoremap u <nop>
vnoremap gu u vnoremap gu u
" For some reason ctags refuses to ignore Python variables, so I'll just hack " Rebuild Ctags (mnemonic RC -> CR -> <cr>)
" the tags file with sed and strip them out myself.
"
" Sigh.
nnoremap <leader><cr> :silent !myctags<cr>:redraw!<cr> nnoremap <leader><cr> :silent !myctags<cr>:redraw!<cr>
" Highlight Group(s) " Highlight Group(s)
Expand All @@ -296,17 +283,9 @@ nnoremap <F8> :echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") . '> t
" Clean trailing whitespace " Clean trailing whitespace
nnoremap <leader>w mz:%s/\s\+$//<cr>:let @/=''<cr>`z 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 " 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> 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 " Select entire buffer
nnoremap vaa ggvGg_ nnoremap vaa ggvGg_
nnoremap Vaa ggVG nnoremap Vaa ggVG
Expand Down Expand Up @@ -340,10 +319,6 @@ inoremap <C-u> <esc>mzgUiw`za
" Panic Button " Panic Button
nnoremap <f9> mzggg?G`z nnoremap <f9> mzggg?G`z
" Emacs bindings in command line mode
cnoremap <c-a> <home>
cnoremap <c-e> <end>
" Diffoff " Diffoff
nnoremap <leader>D :diffoff!<cr> nnoremap <leader>D :diffoff!<cr>
Expand All @@ -366,7 +341,7 @@ nnoremap J mzJ`z
nnoremap S i<cr><esc>^mwgk:silent! s/\v +$//<cr>:noh<cr>`w nnoremap S i<cr><esc>^mwgk:silent! s/\v +$//<cr>:noh<cr>`w
" HTML tag closing " HTML tag closing
inoremap <C-_> <Space><BS><Esc>:call InsertCloseTag()<cr>a inoremap <C-_> <space><bs><esc>:call InsertCloseTag()<cr>a
" Source " Source
vnoremap <leader>S y:execute @@<cr>:echo 'Sourced selection.'<cr> vnoremap <leader>S y:execute @@<cr>:echo 'Sourced selection.'<cr>
Expand Down Expand Up @@ -396,7 +371,6 @@ command! -bang Wq wq<bang>
command! -bang WQ wq<bang> command! -bang WQ wq<bang>


" I suck at typing. " I suck at typing.
nnoremap <localleader>= ==
vnoremap - = vnoremap - =
" Toggle paste " Toggle paste
Expand All @@ -411,17 +385,6 @@ nnoremap <leader>i :set list!<cr>
" Unfuck my screen " Unfuck my screen
nnoremap U :syntax sync fromstart<cr>:redraw!<cr> 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 {{{ " Easy filetype switching {{{


nnoremap _md :set ft=markdown<CR> nnoremap _md :set ft=markdown<CR>
Expand Down Expand Up @@ -518,6 +481,8 @@ vnoremap L g_
" Heresy " Heresy
inoremap <c-a> <esc>I inoremap <c-a> <esc>I
inoremap <c-e> <esc>A 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 " gi already moves to "last place you exited insert mode", so we'll map gI to
" something similar: move to last change " something similar: move to last change
Expand All @@ -535,7 +500,7 @@ nnoremap <leader>C :let &scrolloff=999-&scrolloff<cr>
" Directional Keys {{{ " Directional Keys {{{


" It's 2012. " It's 2013.
noremap j gj noremap j gj
noremap k gk noremap k gk
noremap gj j noremap gj j
Expand Down Expand Up @@ -1072,7 +1037,7 @@ augroup END
" Ack {{{ " Ack {{{


nnoremap <leader>a :Ack!<space> nnoremap <leader>a :Ack!<space>
let g:ackprg = 'ag --nogroup --nocolor --column' let g:ackprg = 'ag --smart-case --nogroup --nocolor --column'


" }}} " }}}
" Autoclose {{{ " Autoclose {{{
Expand Down

0 comments on commit 2fd60e3

Please sign in to comment.