From afe3aa186f26739d35ad766e5a31cadcec07d4e9 Mon Sep 17 00:00:00 2001 From: DarkWiiPlayer Date: Tue, 17 Dec 2024 18:27:03 +0100 Subject: [PATCH] Get rid of nvim autoclose (messes with COQ) --- vim/plugin/shame.vim | 89 -------------------------------------------- 1 file changed, 89 deletions(-) diff --git a/vim/plugin/shame.vim b/vim/plugin/shame.vim index 40b128f..ac15ad3 100644 --- a/vim/plugin/shame.vim +++ b/vim/plugin/shame.vim @@ -160,85 +160,6 @@ endfunction command! -bar RangerChooser call RangeChooser() -" --- AUTO CLOSE --- - -function! s:autoClose_HelperOpen(open, close) - let next_c = getline(".")[col(".")-1] - if match(next_c, "\s") - return a:open.a:close."\" - else - return a:open - end -endfunc - -function! s:autoClose_HelperClose(open, close) - if getline(".")[col(".")-1] ==# a:close - return "\" - elseif getline(line(".")+1) - if match(getline(line(".")+1), "\M^\s*".escape(a:close, "\\")) - return "\\\f".a:close."\" - end - else - return a:close - end -endfunc - -function! s:autoClose_HelperDouble(open) - if getline(".")[col(".")-1] ==# a:open " Step over - return "\" - else - return a:open.a:open."\" - end -endfunc - -function! s:autoClose_HelperEnter() - if exists("b:autoClose_Pairs") - let next_c = getline(".")[col(".")-1] - let prev_c = getline(".")[col(".")-2] - - if (next_c !=# "") && (prev_c !=# "") - if exists("b:autoClose_Pairs[prev_c]") - if (next_c ==# b:autoClose_Pairs[prev_c]) - return "\m'\\`'\" - end - end - end - end - return "\" -endfunc - -function! s:autoClose_HelperSpace() - if exists("b:autoClose_Pairs") - let next_c = getline(".")[col(".")-1] - let prev_c = getline(".")[col(".")-2] - - if (next_c !=# "") && (prev_c !=# "") - if exists("b:autoClose_Pairs[prev_c]") - if (next_c ==# b:autoClose_Pairs[prev_c]) - return "\\h\" - end - end - end - end - return "\" -endfunc - -function! s:autoClose_AddPair(open, close) - if !exists("b:autoClose_Pairs") - let b:autoClose_Pairs = {} - end - let b:autoClose_Pairs[a:open] = a:close - - if a:open!=#a:close - exe "inoremap ".a:open." autoClose_HelperOpen('".a:open."', '".a:close."')" - exe "inoremap ".a:close." autoClose_HelperClose('".a:open."', '".a:close."')" - else - exe "inoremap ".a:open." autoClose_HelperDouble('".a:open."')" - end - inoremap autoClose_HelperEnter() - inoremap autoClose_HelperSpace() -endfunc - function! MatchingLines(pattern) let list = [] let pattern = a:pattern @@ -667,16 +588,6 @@ endif " === FILETYPE SPECIFIC STUFF === -" --- GENERIC STUFF --- -au BufNewFile,BufRead * :call init_generic_file() - -function! s:init_generic_file() - call s:autoClose_AddPair("[", "]") - call s:autoClose_AddPair("(", ")") - call s:autoClose_AddPair("{", "}") - call s:autoClose_AddPair('"', '"') -endfunc - " --- VIMSCRIPT STUFF --- au BufNewFile,BufRead *.vim,*vimrc :call init_vim_file()