From d2785b309b96cb45a8cf9920d9e7eeca1cf7077e Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Fri, 2 Jun 2023 15:15:38 +0100 Subject: Added vim-fugitive and fzf --- vim/vimrc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'vim/vimrc') 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 time "=strftime("%X")p7h endif +"keymap for Fern +nnoremap ;f :Fern . -drawer + 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(), 1, + \ 0 ? fzf#vim#with_preview('up:60%') + \ : fzf#vim#with_preview('right:50%:hidden', '?'), + \ 0) + +nnoremap a :Rg + " vim-test nmap tn :TestNearest nmap tf :TestFile -- cgit v1.2.3