diff --git a/_bin/screengrab b/_bin/screengrab index 8600300..578f764 100755 --- a/_bin/screengrab +++ b/_bin/screengrab @@ -1,7 +1,7 @@ #!/bin/sh mkdir -p ${HOME}/screenshot TARGET="${HOME}/screenshot/grab-$(date +'%Y%m%d%H%M%S').png" -maim -s -n -p 1 -f png -m 10 -u | tee $TARGET | xclip -selection clipboard -t image/png +maim -s -n -o -p 1 -f png -m 10 -u | tee $TARGET | xclip -selection clipboard -t image/png [ -s ${TARGET} ] || rm ${TARGET} diff --git a/_config/nvim/init.vim b/_config/nvim/init.vim index 85d9671..5eee1db 100644 --- a/_config/nvim/init.vim +++ b/_config/nvim/init.vim @@ -18,8 +18,8 @@ let maplocalleader=" " set autoread " automatically reload changed files set wildmenu " handy auto complete menu -set list -set listchars=tab:·\ ,trail:▂,extends:»,precedes:« +"set list +"set listchars=tab:·\ ,trail:▂,extends:»,precedes:« set infercase " completion recognizes capitalization set smartcase set ignorecase @@ -52,7 +52,7 @@ Plug 'dylanaraps/wal.vim' Plug 'cakebaker/scss-syntax.vim' Plug 'calviken/vim-gdscript3' Plug 'ianks/vim-tsx' -Plug 'leafgarland/typescript-vim' +Plug 'leafgarland/typescript-vim', {'for': 'typescript'} Plug 'lepture/vim-jinja' Plug 'posva/vim-vue' @@ -62,6 +62,7 @@ Plug 'tpope/vim-abolish' Plug 'tpope/vim-surround' Plug 'tpope/vim-dispatch' Plug 'tpope/vim-vinegar' +Plug 'tpope/vim-sleuth' Plug 'tpope/vim-commentary', "{{{ nmap c Commentary xmap c Commentary @@ -74,16 +75,16 @@ Plug 'tpope/vim-fugitive', "{{{ map \gs :Gstatus "}}} Plug 'carlitux/deoplete-ternjs', {'do': 'npm install -g tern'} -Plug 'w0rp/ale', "{{{ - let g:ale_linters = { - \ 'c': ['clang'], - \ 'cpp': ['clangx'], - \ 'php': ['phpcs'], - \ 'javascript': ['eslint'], - \} - let g:ale_python_pylint_options = '--load-plugins pylint_django' - let g:ale_sign_error = '⬤' -"}}} +"Plug 'w0rp/ale', "{{{ +" let g:ale_linters = { +" \ 'c': ['clang'], +" \ 'cpp': ['clangx'], +" \ 'php': ['phpcs'], +" \ 'javascript': ['eslint'], +" \} +" let g:ale_python_pylint_options = '--load-plugins pylint_django' +" let g:ale_sign_error = '⬤' +""}}} Plug 'vim-airline/vim-airline-themes' Plug 'vim-airline/vim-airline', "{{{ let g:airline_symbols = {} @@ -98,23 +99,74 @@ Plug 'mattn/gist-vim' Plug 'easymotion/vim-easymotion', "{{{ map (easymotion-prefix) "}}} -if has('nvim') - Plug 'Shougo/deoplete.nvim', {'do': ':UpdateRemotePlugins'} -else - Plug 'Shougo/deoplete.nvim' - Plug 'roxma/nvim-yarp' - Plug 'roxma/vim-hug-neovim-rpc' -endif -let g:deoplete#enable_at_startup = 1 -let g:deoplete#enable_smart_case = 1 -let g:deoplete#sources#syntax#min_keyword_length = 2 -Plug 'Shougo/neosnippet-snippets' -Plug 'Shougo/neosnippet.vim', "{{{ - let g:neosnippet#snippets_directory = '~/.vim/bundle/'.expand(fnamemodify($MYVIMRC, ':p:h').'/snippets/') - let g:neosnippet#enable_snipmate_compatibility = 1 -"}}} +Plug 'mhartington/nvim-typescript', {'do': './install.sh'} + +" if has('nvim') +" Plug 'Shougo/deoplete.nvim', {'do': ':UpdateRemotePlugins'} +" else +" Plug 'Shougo/deoplete.nvim' +" Plug 'roxma/nvim-yarp' +" Plug 'roxma/vim-hug-neovim-rpc' +" endif +" let g:deoplete#enable_at_startup = 1 +" let g:deoplete#enable_smart_case = 1 +" let g:deoplete#sources#syntax#min_keyword_length = 2 +" Plug 'Shougo/denite.nvim' +"Plug 'Shougo/neosnippet-snippets' +"Plug 'Shougo/neosnippet.vim', "{{{ +" let g:neosnippet#snippets_directory = '~/.vim/bundle/'.expand(fnamemodify($MYVIMRC, ':p:h').'/snippets/') +" let g:neosnippet#enable_snipmate_compatibility = 1 +""}}} Plug 'junegunn/fzf', {'dir': '~/.fzf', 'do': './install --all'} Plug 'junegunn/fzf.vim', "{{{ + function! s:buflist() + redir => ls + silent ls + redir END + return split(ls,'\n') + endfunction + + function! s:bufopen(e) + execute 'buffer' matchstr(a:e, '^[ 0-9]*') + endfunction + + nnoremap :call fzf#run({ + \ 'source': reverse(buflist()), + \ 'sink': function('bufopen'), + \ 'options': '+m', + \ 'down': len(buflist()) + 2 + \}) + + + function! s:FuzzyFiles() + let gitparent=system('git rev-parse --show-toplevel')[:-2] + let rootdir='.' + + if empty(matchstr(gitparent, '^fatal:.*')) + silent call fzf#run({ + \ 'dir': gitparent, + \ 'source': '(git ls-tree -r --name-only HEAD | rg --files)', + \ 'sink': 'e', + \}) + else + silent call fzf#run({ + \ 'dir': '.', + \ 'source': 'rg --files', + \ 'sink': 'e', + \}) + endif + endfunction + + command! -bang -nargs=* Rg + \ call fzf#vim#grep( + \ 'rg --column --line-number --no-heading --color=always '.shellescape(), 1, + \ 0 ? fzf#vim#with_preview('up:60%') + \ : fzf#vim#with_preview('right:50%:hidden', '?'), + \ 0) + + nnoremap ; :call FuzzyFiles() + nnoremap / :Rg + "}}} call plug#end() @@ -138,7 +190,7 @@ nnoremap zn ]s " next misspelling nnoremap zp [s " prev misspelling nnoremap zf 1z= " replace misspelling with first suggestion nnoremap z! :set local spell! " toggle spellcheck -nnoremap ve :e $MYVIMRC " quick open this file +nnoremap ve :e $MYVIMRC " quick open this (literally this) file if executable('rg') set grepprg='rg\ --vimgrep' " use ripgrep if available endif @@ -166,6 +218,13 @@ function! NetrwMapping() noremap \e :bd endfunction +" close if final buffer is netrw or the quickfix +augroup finalcountdown + au! + autocmd WinEnter * if winnr('$') == 1 && getbufvar(winbufnr(winnr()), "&filetype") == "netrw" || &buftype == 'quickfix' |q|endif + nmap - :Lexplore +augroup END + " read .vimlocal if available if filereadable(expand('~/.vimlocal')) source ~/.vimlocal diff --git a/xinitrc b/xinitrc index 056e98b..dc00630 100644 --- a/xinitrc +++ b/xinitrc @@ -1,2 +1,3 @@ +cd $ setxkbmap -option caps:swapescape & exec i3 diff --git a/zshrc b/zshrc index 8594d09..fa22630 100644 --- a/zshrc +++ b/zshrc @@ -32,3 +32,13 @@ done [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh [ -f ~/.zshrc.local ] && source ~/.zshrc.local [ -f ~/.aliases ] && source ~/.aliases + +# tabtab source for serverless package +# uninstall by removing these lines or running `tabtab uninstall serverless` +[[ -f /home/mark/code/ereloom.io/node_modules/tabtab/.completions/serverless.zsh ]] && . /home/mark/code/ereloom.io/node_modules/tabtab/.completions/serverless.zsh +# tabtab source for sls package +# uninstall by removing these lines or running `tabtab uninstall sls` +[[ -f /home/mark/code/ereloom.io/node_modules/tabtab/.completions/sls.zsh ]] && . /home/mark/code/ereloom.io/node_modules/tabtab/.completions/sls.zsh +# tabtab source for slss package +# uninstall by removing these lines or running `tabtab uninstall slss` +[[ -f /home/mark/code/ereloom.io/node_modules/tabtab/.completions/slss.zsh ]] && . /home/mark/code/ereloom.io/node_modules/tabtab/.completions/slss.zsh \ No newline at end of file