From eef626690f910c95169943082eab4680ae0562b9 Mon Sep 17 00:00:00 2001 From: Alpha Chen Date: Thu, 16 Dec 2021 13:54:08 -0800 Subject: [PATCH] [vim] a few tweaks - adjust tab completion in insert mode - fix fzf since I'm on M1 now --- .vimrc | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.vimrc b/.vimrc index 325d412..8c69c89 100644 --- a/.vimrc +++ b/.vimrc @@ -121,7 +121,14 @@ augroup END " :help ins-completion function! CleverTab() - if strpart( getline('.'), 0, col('.')-1 ) =~ '^\s*$' + " https://vim.fandom.com/wiki/Autocomplete_with_TAB_when_typing_words + " if col('.')>1 && strpart( getline('.'), col('.')-2, 3 ) =~ '^\w' + " return "\" + + " if strpart( getline('.'), 0, col('.')-1 ) =~ '^\s*$' + " return "\" + + if col('.') <= 1 || strpart(getline('.'), col('.')-2, 1) =~ '\s' return "\" " https://vim.fandom.com/wiki/Smart_mapping_for_tab_completion @@ -203,8 +210,8 @@ nnoremap d :Dispatch " fzf if executable('fzf') - if isdirectory('/usr/local/opt/fzf/plugin') - set rtp+=/usr/local/opt/fzf + if isdirectory('/opt/homebrew/opt/fzf/plugin') + set rtp+=/opt/homebrew/opt/fzf elseif isdirectory('/home/alpha/.fzf') set rtp+=~/.fzf endif