From 659ae7fab748ad1b71068df2b20621f2d1bccb9d Mon Sep 17 00:00:00 2001 From: Xinqi Bao Date: Tue, 6 Apr 2021 18:11:45 +0800 Subject: [PATCH] vimrc/bashrc: add config for fzf --- .bashrc | 3 +++ .vimrc | 12 ++++++++++-- .ycm_extra_conf.py | 5 +++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.bashrc b/.bashrc index e32561d..1938929 100644 --- a/.bashrc +++ b/.bashrc @@ -13,3 +13,6 @@ export PS1="[\[\e[36;1m\]\u@\h \[\e[32;1m\]\w\[\e[m\]]\[\e[33m\](\$(git branch 2 export EDITOR=vim export TERM=xterm-256color + +[ -f ~/.fzf.bash ] && source ~/.fzf.bash +export FZF_CTRL_T_OPTS="--preview 'bat --style=numbers --color=always --line-range :500 {}'" diff --git a/.vimrc b/.vimrc index 20f122f..6792882 100644 --- a/.vimrc +++ b/.vimrc @@ -38,7 +38,7 @@ set undodir=~/.vim/undodir set undofile "ColumnLimit -set colorcolumn=80 +set colorcolumn=120 highlight ColorColumn ctermbg=0 guibg=lightgrey set tags=tags~;,tags~ @@ -67,8 +67,11 @@ Plug 'vim-airline/vim-airline' Plug 'morhetz/gruvbox' Plug 'ycm-core/YouCompleteMe' -Plug 'kien/ctrlp.vim' Plug 'mbbill/undotree' +"Plug 'kien/ctrlp.vim' + +Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } +Plug 'junegunn/fzf.vim' Plug 'tpope/vim-fugitive' Plug 'preservim/nerdtree' @@ -96,6 +99,11 @@ autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif let g:ctrlp_user_command = ['.git/', 'git --git-dir=%s/.git ls-files -oc --exclude-standard'] let g:ctrlp_use_caching = 0 +"mapping for fzf.vim +nnoremap :GFiles +"as default / pair used to page down/up entire page +nnoremap :Tags + let g:ycm_global_ycm_extra_conf = '~/.vim/.ycm_extra_conf.py' let g:ycm_confirm_extra_conf = 0 let g:ycm_enable_diagnostic_signs = 0 diff --git a/.ycm_extra_conf.py b/.ycm_extra_conf.py index d99aaa3..4b9fb29 100644 --- a/.ycm_extra_conf.py +++ b/.ycm_extra_conf.py @@ -1,5 +1,10 @@ def Settings(**kwargs): return {'flags': [ + '-Wall', + #'-Wextra', + #'-Werror', + '-std=c++11', + '-x', 'c++', '-I.', '-I/usr/include/', '-Ilib', -- 2.20.1