New answers tagged

2

As the OP noted and can be found in What's the functional difference between the key notations "\<xxx>" and '<xxx>'?, we need :help expr-quote here: " note that I prefer nnoremap nnoremap <expr> <space>t ManageTerminal() function ManageTerminal() if bufname('terminal') ==# 'terminal' if expand('%:t') =...


0

Adding another simple example to elaborate the previous solutions. " ------------------------------------- " These are representative functions function! Test0() echom "This is Test0" endfunction function! Test1() echom "This is Test1" endfunction function! Test2() echom "This is Test2" endfunction " ------...


1

function! s:get_char(num) abort if a:num == 0 return matchstr(getline('.'), '.\%' . col('.') . 'c') else return matchstr(getline('.'), '\%' . col('.') . 'c.') endif endfunction Without corner cases and can handle wide characters. Then function! s:is_surrounded(match_list) return index(a:match_list, s:get_char(0) . s:get_char(1)) >= 0 ...


Top 50 recent answers are included