From 17e319a4455f3135ed3cc759dee8ba5034fde75b Mon Sep 17 00:00:00 2001 From: Nathan Reiner Date: Thu, 15 Aug 2024 20:28:13 +0200 Subject: update vim config --- .local/share/nvim/site/autoload/brackify.vim | 39 ---------------------------- 1 file changed, 39 deletions(-) delete mode 100644 .local/share/nvim/site/autoload/brackify.vim (limited to '.local/share/nvim/site/autoload/brackify.vim') diff --git a/.local/share/nvim/site/autoload/brackify.vim b/.local/share/nvim/site/autoload/brackify.vim deleted file mode 100644 index ca2a834..0000000 --- a/.local/share/nvim/site/autoload/brackify.vim +++ /dev/null @@ -1,39 +0,0 @@ -function! CharAtIdx(str, idx) abort - return strcharpart(a:str, a:idx, 1) -endfunction - -function! CursorCharIdx() abort - let cursor_byte_idx = col('.') - if cursor_byte_idx == 1 - return 0 - endif - - let pre_cursor_text = getline('.')[:col('.')-2] - return strchars(pre_cursor_text) -endfunction - -function brackify#putbracket(bracket) - let cur_char_idx = CursorCharIdx() - let cur_char = CharAtIdx(getline('.'), cur_char_idx + 1) - - if cur_char != a:bracket - let line = getline('.')[:col('.') - 1] . a:bracket . getline('.')[col('.'):] - call setline(line("."), line) - endif -endfunction - -function brackify#putquotes(quote) - let cur_char_idx = CursorCharIdx() - let cur_char = CharAtIdx(getline('.'), cur_char_idx + 1) - - if cur_char != a:quote - let line = getline('.')[:col('.') - 1] . a:quote . a:quote . getline('.')[col('.'):] - call setline(line("."), line) - - if col('.') > 1 - call cursor(getpos('.')[1], col('.') + 1) - endif - else - call cursor(getpos('.')[1], col('.') + 1) - endif -endfunction -- cgit v1.2.3-70-g09d2