As I write software I jot down minor annoyances in the development workflow or things I’d like to generally understand better. Each morning I spend 20 minutes addressing one or two problems and capture my new learnings here for posterity.
tabe create new tab
gt go to next tab
gT go to previous tab
{i}gt go to tab in position i
augroup vimrc-auto-mkdir
autocmd!
autocmd BufWritePre * call s:auto_mkdir(expand('<afile>:p:h'), v:cmdbang)
function! s:auto_mkdir(dir, force)
if !isdirectory(a:dir)
\ && (a:force
\ || input("'" . a:dir . "' does not exist. Create? [y/N]") =~? '^y\%[es]$')
call mkdir(iconv(a:dir, &encoding, &termencoding), 'p')
endif
endfunction
augroup END
$ git branch
foo-branch
$ git branch | cut -c 3-
foo-branch