diff options
| author | typebrook <typebrook@gmail.com> | 2019-03-12 17:47:06 +0800 |
|---|---|---|
| committer | typebrook <typebrook@gmail.com> | 2019-03-12 17:47:06 +0800 |
| commit | 2fddc277815b8e09ef80279d94578735481ec435 (patch) | |
| tree | e73ad022e895cd6b6c41cc571c0ff51b6653d2e4 | |
| parent | c738efc6a2022eff8cd9367dafe653f02bb0db4e (diff) | |
update
| -rw-r--r-- | alias | 1 | ||||
| -rw-r--r-- | tigrc | 2 | ||||
| -rw-r--r-- | vimrc | 35 |
3 files changed, 36 insertions, 2 deletions
| @@ -71,6 +71,7 @@ alias tg='tig grep' | |||
| 71 | alias tr='tig refs' | 71 | alias tr='tig refs' |
| 72 | alias tl='tig log' | 72 | alias tl='tig log' |
| 73 | alias ty='tig stash' | 73 | alias ty='tig stash' |
| 74 | alias rl='git reflog --pretty=raw | tig --pretty=raw' | ||
| 74 | 75 | ||
| 75 | # Android | 76 | # Android |
| 76 | alias debug='./gradlew app:installDebug && adb shell am start -n adb shell am start -n com.geothings.geobingan/.MainActivity_' | 77 | alias debug='./gradlew app:installDebug && adb shell am start -n adb shell am start -n com.geothings.geobingan/.MainActivity_' |
| @@ -49,7 +49,7 @@ set blame-view-line-number = yes,interval=5 | |||
| 49 | # status view | 49 | # status view |
| 50 | bind status s ?git stash | 50 | bind status s ?git stash |
| 51 | bind status S @git stash save "%(prompt Enter stash name: )" | 51 | bind status S @git stash save "%(prompt Enter stash name: )" |
| 52 | bind status p ?git stash pop | 52 | bind status p !git checkout --patch -- %(file) |
| 53 | bind status D ?rm %(file) | 53 | bind status D ?rm %(file) |
| 54 | bind status a ?git commit --amend | 54 | bind status a ?git commit --amend |
| 55 | bind status j :/^[MADRU?] | 55 | bind status j :/^[MADRU?] |
| @@ -13,9 +13,42 @@ set siso=999 | |||
| 13 | let g:vim_markdown_conceal = 0 | 13 | let g:vim_markdown_conceal = 0 |
| 14 | 14 | ||
| 15 | nmap <c-c> :q<cr> | 15 | nmap <c-c> :q<cr> |
| 16 | nnoremap <leader>r :.w !bash<cr> | 16 | nnoremap <leader>t :.w !bash<cr> |
| 17 | nnoremap <leader>tt :TableFormat<cr> | 17 | nnoremap <leader>tt :TableFormat<cr> |
| 18 | 18 | ||
| 19 | let g:vim_markdown_folding_disabled = 1 | ||
| 20 | source ~/.vim_runtime/vimrcs/redir.vim | ||
| 21 | |||
| 22 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | ||
| 23 | " => Redirect the output of a Vim or external command into a scratch buffer | ||
| 24 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | ||
| 25 | " Copy from : https://gist.github.com/romainl/eae0a260ab9c135390c30cd370c20cd7 | ||
| 26 | " Usage: | ||
| 27 | " :Redir hi ............. show the full output of command ':hi' in a scratch window | ||
| 28 | " :Redir !ls -al ........ show the full output of command ':!ls -al' in a scratch window | ||
| 29 | " | ||
| 30 | function! Redir(cmd) | ||
| 31 | for win in range(1, winnr('$')) | ||
| 32 | if getwinvar(win, 'scratch') | ||
| 33 | execute win . 'windo close' | ||
| 34 | endif | ||
| 35 | endfor | ||
| 36 | if a:cmd =~ '^!' | ||
| 37 | let output = system(matchstr(a:cmd, '^!\zs.*')) | ||
| 38 | else | ||
| 39 | redir => output | ||
| 40 | execute a:cmd | ||
| 41 | redir END | ||
| 42 | endif | ||
| 43 | vnew | ||
| 44 | let w:scratch = 1 | ||
| 45 | setlocal buftype=nofile bufhidden=wipe nobuflisted noswapfile | ||
| 46 | call setline(1, split(output, "\n")) | ||
| 47 | endfunction | ||
| 48 | |||
| 49 | command! -nargs=1 -complete=command Redir silent call Redir(<q-args>) | ||
| 50 | nnoremap <leader>r :Redir | ||
| 51 | |||
| 19 | 52 | ||
| 20 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | 53 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
| 21 | " => Make Alt key works on Gnome terminal | 54 | " => Make Alt key works on Gnome terminal |