diff --git a/.config/fish/config.fish b/.config/fish/config.fish index 7f7db56..586f154 100644 --- a/.config/fish/config.fish +++ b/.config/fish/config.fish @@ -98,3 +98,12 @@ alias pypi_sanoma 'python setup.py sdist --formats=zip upload -r sanoma' alias youtube-dl 'youtube-dl -t -f bestvideo+bestaudio/best --merge-output-format mp4' alias weather 'ansiweather' +alias wttr 'curl -s wttr.in/Beverwijk | head -17' + +# https://www.reddit.com/r/vim/comments/7axmsb/i_cant_believe_how_good_fzf_is/?st=jgm7kba5&sh=590aa1e0 +function rgvim + set choice (rg -il $argv | fzf -0 -1 --ansi --preview "cat {} | rg $argv --context 3") + if [ $choice ] + vim "+/"(to_lower $argv) $choice + end +end diff --git a/.ignore b/.ignore new file mode 100644 index 0000000..6e92f57 --- /dev/null +++ b/.ignore @@ -0,0 +1 @@ +tags diff --git a/.vim/spell/nl.utf-8.add b/.vim/spell/nl.utf-8.add index 8a6bac0..bf63481 100644 --- a/.vim/spell/nl.utf-8.add +++ b/.vim/spell/nl.utf-8.add @@ -64,3 +64,10 @@ Vomar weekplanner calzone stoepkrijt +waterballonnen +Augustinus +fotoboekje +varkenshaassaté +sajoerboontjes +zonneluifel +stellingkast diff --git a/.vim/spell/nl.utf-8.add.spl b/.vim/spell/nl.utf-8.add.spl index 4ddf2d5..887ed30 100644 Binary files a/.vim/spell/nl.utf-8.add.spl and b/.vim/spell/nl.utf-8.add.spl differ diff --git a/.vimrc b/.vimrc index 30ce750..444e3d3 100644 --- a/.vimrc +++ b/.vimrc @@ -103,15 +103,50 @@ if executable('ag') "let g:ackprg = 'ag --nogroup --nocolor --column' let g:ackprg = 'ag --vimgrep' endif +" https://github.com/BurntSushi/ripgrep/releases +if executable('rg') +" let g:ackprg = 'rg --vimgrep' + set grepprg=rg\ --vimgrep +endif " fzf integration for fast fuzzy finding, better and faster than ctrl-p set rtp+=~/workspace/projects/others/fzf Plugin 'junegunn/fzf.vim' + +" Customize fzf colors to match your color scheme +let g:fzf_colors = +\ { 'fg': ['fg', 'Normal'], + \ 'bg': ['bg', 'Normal'], + \ 'hl': ['fg', 'Comment'], + \ 'fg+': ['fg', 'CursorLine', 'CursorColumn', 'Normal'], + \ 'bg+': ['bg', 'CursorLine', 'CursorColumn'], + \ 'hl+': ['fg', 'Statement'], + \ 'info': ['fg', 'PreProc'], + \ 'border': ['fg', 'Ignore'], + \ 'prompt': ['fg', 'Conditional'], + \ 'pointer': ['fg', 'Exception'], + \ 'marker': ['fg', 'Keyword'], + \ 'spinner': ['fg', 'Label'], + \ 'header': ['fg', 'Comment'] } + +" :Find term where term is the string you want to search, this will open up a +" window similar to :Files but will only list files that contain the term +" searched +" https://medium.com/@crashybang/supercharge-vim-with-fzf-and-ripgrep-d4661fc853d2 +command! -bang -nargs=* Find call fzf#vim#grep('rg --column --line-number --no-heading --fixed-strings --ignore-case --no-ignore --hidden --follow --glob "!**.git/*" --glob "!*.swp" --color "always" '.shellescape().'| tr -d "\017"', 1, 0) + +" Simply type ; to search through buffers, leader-o to search through file +" names, \t for tags, \c for (Git) commits and \f to search through contents +" of files nmap ; :Buffers -nmap f :Files +nmap o :Files nmap t :Tags nmap c :Commits +nmap f :Find +nmap l :Lines +nnoremap [f :lprevious +nnoremap ]f :lnext " Web Development/Filetype icons " Needs a font like found at @@ -331,8 +366,12 @@ Plugin 'digitaltoad/vim-pug' " Highlight nginx Plugin 'chr4/nginx.vim' -" Highlight jinja templates +" Highlight jinja templates (e.g., .j2 files) and do proper indenting Plugin 'lepture/vim-jinja' +au BufNewFile,BufRead *.j2 set ft=jinja + +" Highlight special comments better +Plugin 'jbgutierrez/vim-better-comments' " CSV filetype plugin "Plugin 'chrisbra/csv.vim' " apparently doesn't work this way ;) @@ -347,7 +386,8 @@ Plugin 'lepture/vim-jinja' Plugin 'ludovicchabant/vim-gutentags' " know when Gutentags is generating tags (prints 'TAGS' in status-line) set statusline+=%{gutentags#statusline()} -let g:gutentags_ctags_exclude = ["*.min.js", "*.min.css", "build", "vendor", ".git", "node_modules", "*.vim/bundle/*"] +let g:gutentags_ctags_exclude = ["*.min.*", "build", ".bundle", ".git", "log", "node_modules", "tmp", "vendor", "*.vim/bundle/*"] +"let g:gutentags_trace = 1 " All of your Plugins must be added before the following line call vundle#end() " required @@ -427,7 +467,7 @@ iab dayh strftime("== %Y%m%d %A ======") iab timeh strftime("## %Y%m%d %a %H:%M:%S") " Fly through buffers instead of cycling -nnoremap l :ls:b +" nnoremap l :ls:b " Close Location windows, if exist, switch to the previous view buffer, and then close the last switched buffer. nnoremap q :lcloseb#bd # diff --git a/bin/sanomanotes b/bin/sanomanotes index 7894d98..f265fb2 100755 --- a/bin/sanomanotes +++ b/bin/sanomanotes @@ -2,4 +2,4 @@ cd ~/mydocs/work/sanoma git pull #vim -c ":vsp planning_2015.todo" notes_2015.md notes_2014.md -vim -c "set nofoldenable" planning_2018.todo cs_notes.md cs_howtos.md dcp_notes.md dcp_howtos.md planning_2017.todo +vim -c "set nofoldenable" planning_2018.todo startpagina_notes.md cs_notes.md cs_howtos.md dcp_notes.md dcp_howtos.md planning_2017.todo diff --git a/install.sh b/install.sh index 0cbb7ec..30bf026 100644 --- a/install.sh +++ b/install.sh @@ -50,7 +50,7 @@ DATETIME=$(date +%Y%m%d_%H%M) cd # Symlink all the things -for TARGET in .bash_aliases .bashrc bin .gitconfig .gitmodules .hgauthors.txt .hgignore .hgrc .screenrc .terminfo .tmux.conf .vim .vimrc install.sh +for TARGET in .bash_aliases .bashrc bin .gitconfig .gitmodules .hgauthors.txt .hgignore .hgrc .ignore .screenrc .terminfo .tmux.conf .vim .vimrc install.sh do cd echo $TARGET