From 08db411ea4f98349390583481cf55cc3fe70af62 Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Thu, 9 Aug 2018 14:52:49 -0700 Subject: [PATCH] update vimrc --- .vim/autoload/plug.vim | 11 ++++++--- .vimrc | 66 +++++++++++++++++++++++++++++++------------------- 2 files changed, 49 insertions(+), 28 deletions(-) diff --git a/.vim/autoload/plug.vim b/.vim/autoload/plug.vim index 9dd02c0..52c6b2a 100644 --- a/.vim/autoload/plug.vim +++ b/.vim/autoload/plug.vim @@ -96,7 +96,7 @@ let s:plug_src = 'https://github.com/junegunn/vim-plug.git' let s:plug_tab = get(s:, 'plug_tab', -1) let s:plug_buf = get(s:, 'plug_buf', -1) let s:mac_gui = has('gui_macvim') && has('gui_running') -let s:is_win = has('win32') || has('win64') +let s:is_win = has('win32') let s:nvim = has('nvim-0.2') || (has('nvim') && exists('*jobwait') && !s:is_win) let s:vim8 = has('patch-8.0.0039') && exists('*job_start') let s:me = resolve(expand(':p')) @@ -2426,8 +2426,13 @@ function! s:diff() \ . (cnts[1] ? printf(' %d plugin(s) have pending updates.', cnts[1]) : '')) if cnts[0] || cnts[1] - nnoremap :silent! call preview_commit() - nnoremap o :silent! call preview_commit() + nnoremap (plug-preview) :silent! call preview_commit() + if empty(maparg("\", 'n')) + nmap (plug-preview) + endif + if empty(maparg('o', 'n')) + nmap o (plug-preview) + endif endif if cnts[0] nnoremap X :call revert() diff --git a/.vimrc b/.vimrc index eb001b3..45438e2 100644 --- a/.vimrc +++ b/.vimrc @@ -55,6 +55,7 @@ set completeopt=menu,menuone,longest set t_Co=256 set t_Sf=ESC[3%dm set t_Sb=ESC[4%dm +"set t_SH= "set t_kb= " This is like HiglightTooLongLines below, but for modern vim. The problem is @@ -85,7 +86,7 @@ Plug 'hsitz/VimOrganizer' Plug 'mattn/calendar-vim' Plug 'sjbach/lusty' Plug 'scrooloose/nerdcommenter' -Plug 'scrooloose/nerdtree' +"Plug 'scrooloose/nerdtree' Plug 'rstacruz/sparkup' "Plug 'scrooloose/syntastic' Plug 'w0rp/ale' @@ -103,7 +104,9 @@ Plug 'b4winckler/vim-angry' Plug 'tristen/vim-sparkup' Plug 'vim-airline/vim-airline' Plug 'vim-airline/vim-airline-themes' -Plug 'kien/ctrlp.vim' +"Plug 'kien/ctrlp.vim' +Plug 'junegunn/fzf' +Plug 'junegunn/fzf.vim' Plug 'bling/vim-bufferline' Plug 'majutsushi/tagbar' Plug 'eagletmt/neco-ghc', {'for': 'haskell'} @@ -118,7 +121,7 @@ Plug 'tpope/vim-surround' Plug 'fatih/vim-go' "Plug 't-yuki/vim-go-coverlay' Plug 'tpope/vim-abolish' -Plug 'hylang/vim-hy' +Plug 'hylang/vim-hy', {'for': 'hy'} Plug 'jiangmiao/auto-pairs' Plug 'racer-rust/vim-racer', {'for': 'rust'} Plug 'let-def/vimbufsync' @@ -131,6 +134,7 @@ Plug 'Shougo/context_filetype.vim' Plug 'sheerun/vim-polyglot' Plug 'Shougo/denite.nvim' +Plug 'plytophogy/vim-virtualenv' "Plug 'vim-scripts/fish-syntax' "Plug 'kchmck/vim-coffee-script' "Plug 'rodjek/vim-puppet' @@ -140,7 +144,7 @@ Plug 'Shougo/denite.nvim' "Plug 'HerringtonDarkholme/yats.vim' Plug 'tpope/vim-fireplace' Plug 'junegunn/vim-easy-align' -Plug 'idris-hackers/idris-vim' +Plug 'idris-hackers/idris-vim', {'for': 'idris'} Plug 'autozimu/LanguageClient-neovim', { \ 'branch': 'next', \ 'do': 'bash install.sh', @@ -207,7 +211,7 @@ setlocal cursorline " " Change the source rank call deoplete#custom#option('sources', { - \ 'python': ['LanguageClient'], + \ 'python': ['LanguageClient', 'jedi'], \}) call deoplete#custom#source('buffer', 'rank', 1) let g:deoplete#sources#clang#libclang_path = '/usr/lib/llvm-6.0/lib/libclang.so' @@ -323,6 +327,16 @@ let g:UltiSnipsJumpBackwardTrigger="" let g:CommandTMaxFiles = 1000 let g:CommandTMaxDepth = 7 +" * FZF +let g:rg_command = ' + \ rg --column --line-number --no-heading --fixed-strings --ignore-case --no-ignore --hidden --follow --color "always" + \ -g "*.{js,json,php,md,styl,jade,html,config,py,cpp,c,go,hs,rb,conf}" + \ -g "!{.git,node_modules,vendor}/*" ' + +command! -bang -nargs=* RipGrep call fzf#vim#grep(g:rg_command .shellescape(), 1, 0) + +let g:fzf_buffers_jump = 1 + " * VimOrganizer " default Tag list. Will be changed in near future so " that these are defined by config lines in each .org @@ -551,7 +565,6 @@ function AutoTrimWhitespace() endif endfunction - function InstallEverything() GoUpdateBinaries BlackUpgrade @@ -568,7 +581,7 @@ endfunction " I don't know how I came up with gt for opening the tree, but it stuck. "nmap gt :NERDTreeToggle "nmap gt :VimFilerExplorer -winwidth=40 -toggle -direction=rightbelow -parent -status -force-hide -nmap gt :VimFiler -status -auto-cd -parent +nmap gt :VimFiler -status -auto-cd -parent -force-quit " The same for the TagList, useful for large C files. "nmap gb :TlistToggle nmap gb :TagbarToggle @@ -615,24 +628,24 @@ inoremap $ " Dealing with split windows is a pain. Make it less of a pain, by making " Ctrl-direction appropriate. -nnoremap j -nnoremap k -nnoremap l -nnoremap h -"nnoremap w -"nnoremap W -inoremap j -inoremap k -inoremap l -inoremap h +"nnoremap j +"nnoremap k +"nnoremap l +"nnoremap h +""nnoremap w +""nnoremap W +"inoremap j +"inoremap k +"inoremap l +"inoremap h -if has('nvim') - tnoremap - tnoremap j - tnoremap k - tnoremap l - tnoremap h -endif +"if has('nvim') + "tnoremap + "tnoremap j + "tnoremap k + "tnoremap l + "tnoremap h +"endif " Better fold mappings nnoremap @=(foldlevel('.')?'za':'l') @@ -651,7 +664,7 @@ nnoremap ss :SyntasticSetLoclist nnoremap fn :lnext " Prev quickfix. nnoremap fp :lprev -nnoremap aa :Denite -mode=normal -buffer-name=search-buffer grep +"nnoremap aa :Denite -mode=normal -buffer-name=search-buffer grep nnoremap ac :Denite -resume -mode=normal -buffer-name=search-buffer nnoremap aw :DeniteCursorWord -mode=normal -buffer-name=search-buffer grep call denite#custom#map('insert', '', '') @@ -664,6 +677,9 @@ call denite#custom#var('grep', 'separator', ['--']) call denite#custom#var('grep', 'final_opts', []) call denite#custom#option('search-buffer', 'highlight_matched_char', 'deniteMatchedChar') nnoremap g :Denite -buffer-name=search-buffer grep +nnoremap aa :RipGrep! +nnoremap :Files! `git rev-parse --show-toplevel` +nnoremap :Buffers " For C++ -- A is a great plugin which allows you to jump from the c file to the " header and vice-versa. Mneumonic here is headerheader. nnoremap hh :A