Xinqi Bao's Git

vimrc/bashrc: add config for fzf
authorXinqi Bao <[email protected]>
Tue, 6 Apr 2021 10:11:45 +0000 (18:11 +0800)
committerXinqi Bao <[email protected]>
Tue, 6 Apr 2021 10:11:45 +0000 (18:11 +0800)
.bashrc
.vimrc
.ycm_extra_conf.py

diff --git a/.bashrc b/.bashrc
index e32561d..1938929 100644 (file)
--- 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 (file)
--- 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 <C-p> :GFiles<CR>
+"as default <C-f>/<C-b> pair used to page down/up entire page
+nnoremap <C-f> :Tags<CR>
+
 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
index d99aaa3..4b9fb29 100644 (file)
@@ -1,5 +1,10 @@
 def Settings(**kwargs):
     return {'flags': [
+        '-Wall',
+        #'-Wextra',
+        #'-Werror',
+        '-std=c++11',
+        '-x', 'c++',
         '-I.',
         '-I/usr/include/',
         '-Ilib',