aboutsummaryrefslogtreecommitdiffstats
path: root/vim
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2023-06-02 15:15:38 +0100
committerMatthew Lemon <y@yulqen.org>2023-06-02 15:15:38 +0100
commitd2785b309b96cb45a8cf9920d9e7eeca1cf7077e (patch)
tree2a7d0d8f4dd32ba44986304b92f3f58f2c773f3d /vim
parenta384ef51c0ac325dc4d5c2ad8ffc4502931067e8 (diff)
Added vim-fugitive and fzf
Diffstat (limited to 'vim')
-rw-r--r--vim/vimrc20
1 files changed, 20 insertions, 0 deletions
diff --git a/vim/vimrc b/vim/vimrc
index 9d64ac9..9e6034a 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -7,6 +7,7 @@ let maplocalleader = "\\"
let mapleader = ","
set nocompatible
+set scrolloff=1
set history=799
set wildignore=**/__pycache*/**
set wildoptions=pum
@@ -81,6 +82,9 @@ if (exists("*strftime"))
noremap <silent> <leader>time "=strftime("%X")<CR>p7h
endif
+"keymap for Fern
+nnoremap ;f :Fern . -drawer<cr>
+
call plug#begin()
"Plug 'vim-scripts/AutoComplPop'
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
@@ -96,10 +100,26 @@ Plug 'fatih/vim-go', {'do': ':GoUpdateBinaries' }
Plug 'tpope/vim-dispatch'
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-unimpaired'
+Plug 'tpope/vim-fugitive'
Plug 'SirVer/UltiSnips'
Plug 'honza/vim-snippets'
call plug#end()
+" replace vimgrep with Ag
+if executable('ag')
+ set grepprg=ag\ --vimgrep\ --nogroup\ --nocolor
+endif
+
+" or 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,
+ \ <bang>0 ? fzf#vim#with_preview('up:60%')
+ \ : fzf#vim#with_preview('right:50%:hidden', '?'),
+ \ <bang>0)
+
+nnoremap <C-p>a :Rg
+
" vim-test
nmap <silent> tn :TestNearest<CR>
nmap <silent> tf :TestFile<CR>