From cceef58d9d83c3602b87f7d2fed80a2198cfc84d Mon Sep 17 00:00:00 2001 From: Ryan Ong Date: Tue, 3 Mar 2020 17:30:43 -0500 Subject: [PATCH 1/2] replace ctrlp and ag.vim with fzf and ack.vim --- Brewfile | 2 ++ vimrc | 50 ++++++++++++++++++++++++-------------------------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/Brewfile b/Brewfile index d6cfdac..2f2ba50 100644 --- a/Brewfile +++ b/Brewfile @@ -1,2 +1,4 @@ tap 'thoughtbot/formulae' brew 'rcm' +brew 'fzf' +brew 'ripgrep' diff --git a/vimrc b/vimrc index 847e01c..6be362f 100644 --- a/vimrc +++ b/vimrc @@ -68,50 +68,48 @@ if count(g:vimified_packages, 'general') map \ :NERDTreeToggle map \| :NERDTreeFind - Plugin 'ctrlpvim/ctrlp.vim' - let g:ctrlp_match_window = 'bottom,order:ttb,min:1,max:10,results:10' - let g:ctrlp_clear_cache_on_exit = 0 - let g:ctrlp_max_files = 0 - - nnoremap f :CtrlP - noremap b :CtrlPBuffer + Plugin 'junegunn/fzf' + if executable('rg') + let $FZF_DEFAULT_COMMAND= 'rg -a --files' + else + let $FZF_DEFAULT_COMMAND= 'ag -g ""' + endif - Plugin 'FelikZ/ctrlp-py-matcher' - let g:ctrlp_match_func = { 'match': 'pymatcher#PyMatch' } + let $FZF_DEFAULT_OPTS= '--color dark,hl:33,hl+:37,fg+:235,bg+:136,fg+:254,info:254,prompt:37,spinner:108,pointer:235,marker:235' + nnoremap :FZF + nnoremap f :FZF + nnoremap ] :Tags =expand("") - if executable('rg') - " Use Ripgrep over Grep - set grepprg=rg\ --vimgrep\ --no-heading - set grepformat=%f:%l:%c:%m,%f:%l:%m + Plugin 'junegunn/fzf.vim' + let g:fzf_layout = {'down': '40%'} + let g:fzf_tags_command = 'ripper-tags -R' + noremap b :Buffers - let g:ctrlp_user_command = 'rg --hidden -i --files %s' - let g:ackprg = 'rg --vimgrep' - elseif executable('ag') - " Use Ag over Grep - set grepprg=ag\ --nogroup\ --nocolor + Plugin 'mileszs/ack.vim' - let g:ctrlp_user_command = 'ag %s -i --nocolor --nogroup --ignore ".git" --ignore ".DS_Store" --hidden -g ""' + if executable('ag') let g:ackprg = 'ag --vimgrep' - else - nnoremap F :ClearCtrlPCache\|:CtrlP endif - Plugin 'rking/ag.vim' - function! AgGrep() + if executable('rg') + let g:ackprg = 'rg --vimgrep' + endif + + function! AckGrep() let command = g:ackprg.' -i '.expand('') cexpr system(command) cw endfunction - function! AgVisual() + function! AckVisual() normal gv"xy let command = g:ackprg.' -i '.@x cexpr system(command) cw endfunction - map a :call AgGrep() - vmap a :call AgVisual() + map a :call AckGrep() + vmap a :call AckVisual() " File Renaming (credit: garybernhardt) function! RenameFile() From 0af1bbd2b04fd41fd075526886fdbfb7c8218bb6 Mon Sep 17 00:00:00 2001 From: Ryan Ong Date: Wed, 4 Mar 2020 11:33:36 -0500 Subject: [PATCH 2/2] update neovim hook compatibility and update theme --- hooks/post-up | 10 ++++++---- vimrc | 7 +++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/hooks/post-up b/hooks/post-up index c8e5f25..a80ca7d 100755 --- a/hooks/post-up +++ b/hooks/post-up @@ -1,8 +1,10 @@ #!/bin/sh +mkdir -p $HOME/.vim/bundle/ $HOME/.config +ln -sf $HOME/.vim $HOME/.config/nvim +ln -sf $HOME/.vimrc $HOME/.vim/init.vim + if [ ! -e $HOME/.vim/bundle/Vundle.vim ]; then - mkdir -p $HOME/.vim/bundle/ - git clone https://github.com/gmarik/Vundle.vim.git $HOME/.vim/bundle/Vundle.vim + git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim fi -vim -u $HOME/.vimrc +PluginInstall +qa - -vim -u $HOME/.vimrc +PluginClean! +qa - +vim -u $HOME/.vimrc +PluginInstall +PluginClean! +qall diff --git a/vimrc b/vimrc index 6be362f..89a8e08 100644 --- a/vimrc +++ b/vimrc @@ -1,5 +1,4 @@ set nocompatible -filetype on filetype off let mapleader = ',' @@ -569,7 +568,7 @@ endif " """"""""""""""""""""""""""""""""""""""" if count(g:vimified_packages, 'colour') || count(g:vimified_packages, 'color') - Plugin 'chriskempson/tomorrow-theme', {'rtp': 'vim/'} + Plugin 'chriskempson/base16-vim' :hi TabLineFill term=bold cterm=bold ctermbg=237 endif @@ -614,8 +613,8 @@ if count(g:vimified_packages, 'coding') endif if count(g:vimified_packages, 'colour') || count(g:vimified_packages, 'color') - colorscheme Tomorrow-Night-Eighties -endif + colorscheme base16-tomorrow-night +end " " Options