diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | vim/vimrc | 31 |
2 files changed, 26 insertions, 6 deletions
@@ -9,3 +9,4 @@ openai_key newsboat/cache.db vim/undodir vim/spell/* +vim/ephemera.vim @@ -43,10 +43,10 @@ set listchars=tab:»→,trail:␣ set shortmess+=c set tags+=./tags set background=dark -set scrolloff=0 set completeopt=menuone,longest -colorscheme gruber-darker +" colorscheme goes here, outside source control +source ~/.vim/ephemera.vim highlight SignColumn guibg=blue ctermbg=black " macro to go to end of sentence and add a line break (for @@ -98,6 +98,7 @@ Plug 'vim-test/vim-test' Plug 'ledger/vim-ledger' Plug 'fatih/vim-go', {'do': ':GoUpdateBinaries' } Plug 'tpope/vim-dispatch' +Plug 'tpope/vim-surround' Plug 'tpope/vim-commentary' Plug 'tpope/vim-unimpaired' Plug 'tpope/vim-fugitive' @@ -105,12 +106,12 @@ Plug 'SirVer/UltiSnips' Plug 'honza/vim-snippets' call plug#end() -" replace vimgrep with Ag -if executable('ag') - set grepprg=ag\ --vimgrep\ --nogroup\ --nocolor +" Make :grep use ripgrep +if executable('rg') + set grepprg=rg\ --color=never\ --vimgrep endif -" or search with ripgrep +" and search with ripgrep command! -bang -nargs=* Rg \ call fzf#vim#grep( \ 'rg --column --line-number --no-heading --color=always --ignore-case '.shellescape(<q-args>), 1, @@ -120,6 +121,24 @@ command! -bang -nargs=* Rg nnoremap <C-p>a :Rg +" Generate ctags for current working directory +nnoremap <leader>tt :silent !ctags -R . <CR>:redraw!<CR> + +" notes stuff - from https://www.edwinwenink.xyz/posts/43-notes_tagging/ +" Go to index of notes and set working directory to my notes +nnoremap <leader>ni :e $NOTES_DIR/index.md<CR>:cd $NOTES_DIR<CR> + +" 'Notes Grep' with ripgrep (see grepprg) +" -i case insensitive +" -g glob pattern +" ! to not immediately open first search result +command! -nargs=1 Ngrep :silent grep! "<args>" -i -g '*.md' $NOTES_DIR | execute ':redraw!' +nnoremap <leader>nn :Ngrep + +" Open quickfix list in a right vertical split (good for Ngrep results) +command! Vlist botright vertical copen | vertical resize 50 +nnoremap <leader>v : Vlist<CR> + " vim-test nmap <silent> tn :TestNearest<CR> nmap <silent> tf :TestFile<CR> |