this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Update NVim config

+117 -83
+1 -1
bin/git-cleanup
··· 1 1 #!/bin/sh 2 2 3 - git branch --merged master | grep -v '^\*' | grep -v master | xargs -n1 git branch -d 3 + git branch --merged master | grep -v '^\*' | grep -v master | xargs -n1 git branch -D
+5 -6
bin/tmux-airline
··· 1 1 #!/bin/bash 2 2 3 - SEP= 3 + SEP=$(echo -e "\ue0b2") 4 4 SEPE=$(echo -e "\ue0b3") 5 5 6 - CLOCK=⌚ 7 - CALENDAR=📆 8 - MUSIC=♫ 6 + CLOCK=$(echo -e "\u23f0") 7 + MUSIC=$(echo -e "\u266b") 9 8 10 9 WIDTH="${1}" 11 10 ··· 22 21 UNAME="#[fg=colour15,bg=colour08,nobold,noitalics,nounderscore]$SEP#[fg=colour00,bg=colour15,bold,noitalics,nounderscore] $(uname -n)" 23 22 fi 24 23 25 - DATE="#[fg=colour08,nobold,noitalics,nounderscore]$SEP#[fg=colour00,bg=colour08,nobold,noitalics,nounderscore] $CALENDAR $(date +'%d.%m.%y')" 26 - TIME="#[fg=colour00,bg=colour08,nobold,noitalics,nounderscore]$SEPE#[fg=colour00,bg=colour08,nobold,noitalics,nounderscore] $CLOCK $(date +'%H:%M')" 24 + DATE="#[fg=colour08,nobold,noitalics,nounderscore]$SEP#[fg=colour00,bg=colour08,nobold,noitalics,nounderscore] $(date +'%d.%m.%y')" 25 + TIME="#[fg=colour00,bg=colour08,nobold,noitalics,nounderscore]$SEPE#[fg=colour00,bg=colour08,nobold,noitalics,nounderscore] $(date +'%H:%M')" 27 26 28 27 echo "$MPD $DATE $TIME $UNAME " | sed 's/ *$/ /g'
+3
fish/bundle
··· 1 1 hauleth/agnoster 2 + fishery/getopts 3 + fishery/rbenv 4 + fishery/z
+3 -2
fish/config.fish
··· 11 11 # channel. 12 12 set -gx NIX_PATH nixpkgs=$HOME/.nix-defexpr/channels/nixpkgs 13 13 14 - # theme base16-ocean dark 14 + for file in $HOME/.config/fish/conf.d/*.fish 15 + source $file 16 + end 15 17 16 18 enable direnv hook fish 17 19 enable hub alias -s 18 20 enable jump shell fish 19 - enable rbenv init - 20 21 enable thefuck --alias
-1
nix/config.nix
··· 5 5 all = pkgs.buildEnv { 6 6 name = "all"; 7 7 paths = [ 8 - pkgs.nix 9 8 pkgs.nixops 10 9 editors 11 10 scm
+74 -39
nvim/autoload/plug.vim
··· 28 28 " " Using a non-master branch 29 29 " Plug 'rdnetto/YCM-Generator', { 'branch': 'stable' } 30 30 " 31 + " " Using a tagged release; wildcard allowed (requires git 1.9.2 or above) 32 + " Plug 'fatih/vim-go', { 'tag': '*' } 33 + " 31 34 " " Plugin options 32 35 " Plug 'nsf/gocode', { 'tag': 'v.20150303', 'rtp': 'vim' } 33 36 " ··· 128 131 endfunction 129 132 130 133 function! s:define_commands() 131 - command! -nargs=+ -bar Plug call s:Plug(<args>) 134 + command! -nargs=+ -bar Plug call plug#(<args>) 132 135 if !executable('git') 133 136 return s:err('`git` executable not found. Most commands will not be available. To suppress this message, prepend `silent!` to `call plug#begin(...)`.') 134 137 endif ··· 222 225 if has_key(plug, 'for') 223 226 let types = s:to_a(plug.for) 224 227 if !empty(types) 228 + augroup filetypedetect 225 229 call s:source(s:rtp(plug), 'ftdetect/**/*.vim', 'after/ftdetect/**/*.vim') 230 + augroup END 226 231 endif 227 232 for type in types 228 233 call s:assoc(lod.ft, type, name) ··· 392 397 endfunction 393 398 394 399 function! s:doautocmd(...) 395 - execute 'doautocmd' ((v:version > 703 || has('patch442')) ? '<nomodeline>' : '') join(a:000) 400 + if exists('#'.join(a:000, '#')) 401 + execute 'doautocmd' ((v:version > 703 || has('patch442')) ? '<nomodeline>' : '') join(a:000) 402 + endif 396 403 endfunction 397 404 398 405 function! plug#load(...) ··· 410 417 for name in a:000 411 418 call s:lod([name], ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin']) 412 419 endfor 413 - if exists('#BufRead') 414 - doautocmd BufRead 415 - endif 420 + call s:doautocmd('BufRead') 416 421 return 1 417 422 endfunction 418 423 ··· 448 453 endif 449 454 call s:source(rtp, a:2) 450 455 endif 451 - if exists('#User#'.name) 452 - call s:doautocmd('User', name) 453 - endif 456 + call s:doautocmd('User', name) 454 457 endfor 455 458 endfunction 456 459 ··· 458 461 let syn = 'syntax/'.a:pat.'.vim' 459 462 call s:lod(a:names, ['plugin', 'after/plugin'], syn, 'after/'.syn) 460 463 execute 'autocmd! PlugLOD FileType' a:pat 461 - if exists('#filetypeplugin#FileType') 462 - doautocmd filetypeplugin FileType 463 - endif 464 - if exists('#filetypeindent#FileType') 465 - doautocmd filetypeindent FileType 466 - endif 464 + call s:doautocmd('filetypeplugin', 'FileType') 465 + call s:doautocmd('filetypeindent', 'FileType') 467 466 endfunction 468 467 469 468 function! s:lod_cmd(cmd, bang, l1, l2, args, names) 470 469 call s:lod(a:names, ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin']) 470 + call s:doautocmd('BufRead') 471 471 execute printf('%s%s%s %s', (a:l1 == a:l2 ? '' : (a:l1.','.a:l2)), a:cmd, a:bang, a:args) 472 472 endfunction 473 473 474 474 function! s:lod_map(map, names, prefix) 475 475 call s:lod(a:names, ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin']) 476 + call s:doautocmd('BufRead') 476 477 let extra = '' 477 478 while 1 478 479 let c = getchar(0) ··· 484 485 call feedkeys(a:prefix . substitute(a:map, '^<Plug>', "\<Plug>", '') . extra) 485 486 endfunction 486 487 487 - function! s:Plug(repo, ...) 488 + function! plug#(repo, ...) 488 489 if a:0 > 1 489 490 return s:err('Invalid number of arguments (1..2)') 490 491 endif ··· 717 718 silent! execute 'f' fnameescape(name) 718 719 endfunction 719 720 721 + function! s:chsh(swap) 722 + let prev = [&shell, &shellredir] 723 + if !s:is_win && a:swap 724 + set shell=sh shellredir=>%s\ 2>&1 725 + endif 726 + return prev 727 + endfunction 728 + 720 729 function! s:bang(cmd, ...) 721 730 try 731 + let [sh, shrd] = s:chsh(a:0) 722 732 " FIXME: Escaping is incomplete. We could use shellescape with eval, 723 733 " but it won't work on Windows. 724 - let cmd = a:0 > 0 ? s:with_cd(a:cmd, a:1) : a:cmd 734 + let cmd = a:0 ? s:with_cd(a:cmd, a:1) : a:cmd 725 735 let g:_plug_bang = '!'.escape(cmd, '#!%') 726 736 execute "normal! :execute g:_plug_bang\<cr>\<cr>" 727 737 finally 728 738 unlet g:_plug_bang 739 + let [&shell, &shellredir] = [sh, shrd] 729 740 endtry 730 741 return v:shell_error ? 'Exit status: ' . v:shell_error : '' 731 742 endfunction ··· 831 842 endfunction 832 843 833 844 function! s:check_ruby() 834 - silent! ruby require 'thread'; VIM::command('let g:plug_ruby = 1') 835 - if get(g:, 'plug_ruby', 0) 836 - unlet g:plug_ruby 837 - return 1 845 + silent! ruby require 'thread'; VIM::command("let g:plug_ruby = '#{RUBY_VERSION}'") 846 + if !exists('g:plug_ruby') 847 + redraw! 848 + return s:warn('echom', 'Warning: Ruby interface is broken') 838 849 endif 839 - redraw! 840 - return s:warn('echom', 'Warning: Ruby interface is broken') 850 + let ruby_version = split(g:plug_ruby, '\.') 851 + unlet g:plug_ruby 852 + return s:version_requirement(ruby_version, [1, 8, 7]) 841 853 endfunction 842 854 843 855 function! s:update_impl(pull, force, args) abort ··· 964 976 call s:log4(name, 'Checking out '.spec.commit) 965 977 let out = s:checkout(spec) 966 978 elseif has_key(spec, 'tag') 967 - call s:log4(name, 'Checking out '.spec.tag) 968 - let out = s:system('git checkout -q '.s:esc(spec.tag).' 2>&1', spec.dir) 979 + let tag = spec.tag 980 + if tag =~ '\*' 981 + let tags = s:lines(s:system('git tag --list '.string(tag).' --sort -version:refname 2>&1', spec.dir)) 982 + if !v:shell_error && !empty(tags) 983 + let tag = tags[0] 984 + call s:log4(name, printf('Latest tag for %s -> %s', spec.tag, tag)) 985 + call append(3, '') 986 + endif 987 + endif 988 + call s:log4(name, 'Checking out '.tag) 989 + let out = s:system('git checkout -q '.s:esc(tag).' 2>&1', spec.dir) 969 990 else 970 991 let branch = s:esc(get(spec, 'branch', 'master')) 971 992 call s:log4(name, 'Merging origin/'.branch) ··· 977 998 call s:log4(name, 'Updating submodules. This may take a while.') 978 999 let out .= s:bang('git submodule update --init --recursive 2>&1', spec.dir) 979 1000 endif 980 - let msg = printf('%s %s: %s', v:shell_error ? 'x': '-', name, get(s:lines(out), -1, '')) 1001 + let msg = printf('%s %s: %s', v:shell_error ? 'x': '-', name, s:lastline(out)) 981 1002 if v:shell_error 982 1003 call add(s:update.errors, name) 983 1004 call s:regress_bar() ··· 1145 1166 1146 1167 let has_tag = has_key(spec, 'tag') 1147 1168 if !new 1148 - let error = s:git_validate(spec, 0) 1169 + let [error, _] = s:git_validate(spec, 0) 1149 1170 if empty(error) 1150 1171 if pull 1151 1172 let fetch_opt = (has_tag && !empty(globpath(spec.dir, '.git/shallow'))) ? '--depth 99999999' : '' ··· 1809 1830 1810 1831 function! s:system(cmd, ...) 1811 1832 try 1812 - let [sh, shrd] = [&shell, &shellredir] 1813 - if !s:is_win 1814 - set shell=sh shellredir=>%s\ 2>&1 1815 - endif 1833 + let [sh, shrd] = s:chsh(1) 1816 1834 let cmd = a:0 > 0 ? s:with_cd(a:cmd, a:1) : a:cmd 1817 1835 return system(s:is_win ? '('.cmd.')' : cmd) 1818 1836 finally ··· 1860 1878 let err = printf('Invalid branch: %s (expected: %s). Try PlugUpdate.', 1861 1879 \ branch, a:spec.branch) 1862 1880 endif 1881 + if empty(err) 1882 + let commits = len(s:lines(s:system(printf('git rev-list origin/%s..HEAD', a:spec.branch), a:spec.dir))) 1883 + if !v:shell_error && commits 1884 + let err = join([printf('Diverged from origin/%s by %d commit(s).', a:spec.branch, commits), 1885 + \ 'Reinstall after PlugClean.'], "\n") 1886 + endif 1887 + endif 1863 1888 endif 1864 1889 else 1865 1890 let err = 'Not found' 1866 1891 endif 1867 - return err 1892 + return [err, err =~# 'PlugClean'] 1868 1893 endfunction 1869 1894 1870 1895 function! s:rm_rf(dir) ··· 1875 1900 1876 1901 function! s:clean(force) 1877 1902 call s:prepare() 1878 - call append(0, 'Searching for unused plugins in '.g:plug_home) 1903 + call append(0, 'Searching for invalid plugins in '.g:plug_home) 1879 1904 call append(1, '') 1880 1905 1881 1906 " List of valid directories 1882 1907 let dirs = [] 1908 + let errs = {} 1883 1909 let [cnt, total] = [0, len(g:plugs)] 1884 1910 for [name, spec] in items(g:plugs) 1885 - if !s:is_managed(name) || empty(s:git_validate(spec, 0)) 1911 + if !s:is_managed(name) 1886 1912 call add(dirs, spec.dir) 1913 + else 1914 + let [err, clean] = s:git_validate(spec, 1) 1915 + if clean 1916 + let errs[spec.dir] = s:lines(err)[0] 1917 + else 1918 + call add(dirs, spec.dir) 1919 + endif 1887 1920 endif 1888 1921 let cnt += 1 1889 1922 call s:progress_bar(2, repeat('=', cnt), total) ··· 1907 1940 if !has_key(allowed, f) && isdirectory(f) 1908 1941 call add(todo, f) 1909 1942 call append(line('$'), '- ' . f) 1943 + if has_key(errs, f) 1944 + call append(line('$'), ' ' . errs[f]) 1945 + endif 1910 1946 let found = filter(found, 'stridx(v:val, f) != 0') 1911 1947 end 1912 1948 endwhile 1913 1949 1914 - normal! G 1950 + 4 1915 1951 redraw 1916 1952 if empty(todo) 1917 1953 call append(line('$'), 'Already clean.') ··· 1920 1956 for dir in todo 1921 1957 call s:rm_rf(dir) 1922 1958 endfor 1923 - call append(line('$'), 'Removed.') 1959 + call append(3, ['Removed.', '']) 1924 1960 else 1925 - call append(line('$'), 'Cancelled.') 1961 + call append(3, ['Cancelled.', '']) 1926 1962 endif 1927 1963 endif 1928 - normal! G 1964 + 4 1929 1965 endfunction 1930 1966 1931 1967 function! s:upgrade() ··· 1972 2008 for [name, spec] in items(g:plugs) 1973 2009 if has_key(spec, 'uri') 1974 2010 if isdirectory(spec.dir) 1975 - let err = s:git_validate(spec, 1) 2011 + let [err, _] = s:git_validate(spec, 1) 1976 2012 let [valid, msg] = [empty(err), empty(err) ? 'OK' : err] 1977 2013 else 1978 2014 let [valid, msg] = [0, 'Not found. Try PlugInstall.'] ··· 2207 2243 2208 2244 let &cpo = s:cpo_save 2209 2245 unlet s:cpo_save 2210 -
+20 -10
nvim/init.vim
··· 13 13 Plug 'sheerun/vim-polyglot' 14 14 Plug 'dag/vim-fish' 15 15 Plug 'hauleth/vim-ketos' 16 + Plug 'slashmili/alchemist.vim' 16 17 17 18 " Git 18 19 Plug 'mhinz/vim-signify' ··· 73 74 74 75 " Display tabs and trailing spaces visually 75 76 set list 76 - set listchars=tab:→\ ,trail:· 77 + set listchars=tab:→\ ,trail:·,nbsp:␣ 77 78 78 79 " Show current mode down the bottom 79 80 set noshowmode ··· 111 112 set splitbelow 112 113 113 114 set lazyredraw 115 + 116 + set timeoutlen=500 114 117 " }}} 115 118 " Identation {{{ 116 119 set shiftwidth=2 ··· 172 175 " Leader {{{ 173 176 let mapleader = "\<space>" 174 177 " }}} 178 + " Store relative line number jumps in the jumplist {{{ 179 + " Treat long lines as break lines (useful when moving around in them). 180 + noremap <expr> j v:count > 1 ? 'm`' . v:count . 'j' : 'gj' 181 + noremap <expr> k v:count > 1 ? 'm`' . v:count . 'k' : 'gk' 182 + " }}} 175 183 " ESC {{{ 176 184 inoremap jk <ESC> 177 185 " }}} ··· 209 217 nnoremap Q K 210 218 " }}} 211 219 " Simplify switching to Command mode {{{ 212 - nnoremap ; : 213 - nnoremap : ; 214 - vnoremap ; : 215 - vnoremap : ; 220 + noremap ; : 221 + noremap : ; 222 + noremap q; q: 216 223 " }}} 217 224 " Fast paste from system clipboard {{{ 218 225 inoremap <C-R><C-R> <C-R>* ··· 241 248 " }}} 242 249 " Search {{{ 243 250 " Easier change and replace word 244 - noremap c* *``cgn 245 - noremap c# #``cgN 246 - noremap cg* g*``cgn 247 - noremap cg# g#``cgN 251 + nnoremap c. *Ncgn 252 + 253 + noremap <leader>, :nohlsearch<CR> 248 254 249 255 " Search for selection 250 256 vnoremap // y/<C-r>"<CR> ··· 252 258 " Git {{{ 253 259 nnoremap U <nop> 254 260 nnoremap Us :<C-u>Gstatus<CR> 261 + nnoremap Up :<C-u>Git push<CR> 255 262 nnoremap Ud :<C-u>Gdiff<CR> 256 263 nnoremap UB :<C-u>Gblame<CR> 257 264 nnoremap Ub :<C-u>Promiscuous<CR> ··· 267 274 " Tabs {{{ 268 275 nnoremap <C-w>t :<C-u>tabnew <bar> Dirvish<CR> 269 276 " }}} 277 + " Yank to the end of line {{{ 278 + nnoremap Y y$ 279 + " }}} 270 280 " }}} 271 281 " Configuration {{{ 272 282 " Grep {{{ ··· 291 301 " Neomake {{{ 292 302 augroup syntax_check 293 303 au! 294 - autocmd BufWritePost * silent Neomake 304 + autocmd BufEnter,BufWritePost * silent Neomake 295 305 augroup END 296 306 297 307 let g:neomake_warning_sign = {
-7
nvim/plugin/numbers.vim
··· 1 - " Line numbers are good 2 - augroup numbers 3 - au BufEnter,WinEnter * set number 4 - au BufEnter,WinEnter * set relativenumber 5 - au BufLeave,WinLeave * set nonumber 6 - au BufLeave,WinLeave * set norelativenumber 7 - augroup END
+2 -2
nvim/plugin/vsearch.vim
··· 10 10 let @@ = temp 11 11 endfunction 12 12 13 - vnoremap * :<C-u>call <SID>VSetSearch()<CR>/<CR> 14 - vnoremap # :<C-u>call <SID>VSetSearch()<CR>?<CR> 13 + " vnoremap * :<C-u>call <SID>VSetSearch()<CR>/<CR> 14 + " vnoremap # :<C-u>call <SID>VSetSearch()<CR>?<CR>
+4 -4
nvim/plugin/whirl.vim
··· 14 14 augroup END 15 15 16 16 if mapcheck('+', 'n') ==# '' 17 - nnoremap <silent> + :<C-U>exe 'Dirvish %:p'.repeat(':h',v:count1)<CR> 18 - endif 19 - if mapcheck('-', 'n') ==# '' 20 - nnoremap <silent> - :<C-U>Dirvish<CR> 17 + nnoremap <silent> + :<C-U>Dirvish<CR> 21 18 endif 19 + " if mapcheck('-', 'n') ==# '' 20 + " nnoremap <silent> - :<C-U>Dirvish<CR> 21 + " endif 22 22 let &cpo = s:save_cpo
-11
nvim/pythonx/nvim_clipboard.py
··· 1 - import xerox 2 - 3 - class NvimClipboard(object): 4 - def __init__(self, vim): 5 - self.provides = ['clipboard'] 6 - 7 - def clipboard_get(self): 8 - return xerox.paste().split('\n') 9 - 10 - def clipboard_set(self, lines): 11 - xerox.copy(u'\n'.join([line.decode('utf-8') for line in lines]))
+5
tmux/init.tmux
··· 29 29 set -g @sidebar-tree-command 'tree -aCI "tmp|bundle|coverage|target|node_modules|.git|log"' 30 30 set -g @sidebar-tree-width '50' 31 31 32 + set -g @continuum-restore 'on' 33 + 32 34 # List of plugins 33 35 set -g @plugin 'tmux-plugins/tpm' 34 36 set -g @plugin 'tmux-plugins/tmux-sensible' 35 37 36 38 set -g @plugin 'tmux-plugins/tmux-yank' 37 39 set -g @plugin 'tmux-plugins/tmux-sidebar' 40 + set -g @plugin 'tmux-plugins/tmux-resurrect' 41 + set -g @plugin 'tmux-plugins/tmux-continuum' 42 + set -g @plugin 'Morantron/tmux-fingers' 38 43 39 44 # Initialize TMUX plugin manager 40 45 run "$HOME/.tmux/plugins/tpm/tpm"