2

First get a list of all buffer names with getbufinfo(), here filtering out non listed: let buf_list = getbufinfo({'buflisted': 1}) Second use map() to get the names: let buf_list = map(buf_list, 'v:val.name') Third filter out names using glob2regpat(), here variable pattern being for-example *.c: let buf_list = filter(buf_list, 'v:val =~# glob2regpat(...


2

Try this one: augroup DIR_CONFIG | au! au VimEnter * if getcwd() == expand('~/temp') | source my.vim | endif augroup END PS, as @eclipse has mentioned in the comments one could just add to vimrc: if getcwd() == expand('~/temp') | source my.vim | endif


2

In recent versions of vim (around patch 8.2.0915), search takes a skip argument which can be used to create a move forward/backward to syntax group motion. Here is a rudimentary implementation: function! SynMatches(syn) abort return synIDattr(synID(line('.'), col('.'), 1), "name") =~# a:syn endfunction function! SynMove(syn, dir) abort let l:...


1

However I am really confused because nothing really happened and nerdtree-visual-selection doesn't appear at the installation info window that appears. Normally every OP at StackOverflow is required to provide "a minimal complete and verifiable example", as otherwise every question is practically the same as "take three guesses where I could ...


1

Here's a simple mockup using job_start(); note that in general many things which are straightforward in single-threaded vim (e.g., modify the current buffer) are more complicated when dealing with asynchronous callbacks (e.g., the current buffer may have changed). There are lots of options, so here I'm using :help read-in-close-cb. function HandleText(...


1

Here is a quick starter implementation which simply moves forward until the syntax is matched. synID is generally quite slow, but fortunately, vim accelerates it in the forward direction using caching. nnoremap <plug>(forward) <space> function! s:forward_to(syn) abort let l:save_view = winsaveview() let [l:ol, l:oc] = [line('.'), col('.')] ...


1

Prepend runtimepath with ~/.vim, See :h :set^= :se[t] {option}^={value} *:set^=* Multiply the {value} to a number option, or prepend the {value} to a string option. When the option is a comma separated list, a comma is added, unless the value was empty. Also see |:set-args| above.


1

Here are some examples. (Note that your keywordAs already covers the bullet, you just need to highlight it as you want.) When the delimiters are always on the same line, this is probably the simplest way to go: syntax match Important /!!.*!!/ But to be more flexible, allowing delimiters anywhere, use a region: " Don't use Question; it's a `:help ...


1

Here is the file in question with commented lines that contain useful tips to create your own ale linter. I hope it can provide a useful template for others to use : " Description: norminette linter for C files. " " Get the norminette with : " " python3 -m pip install --upgrade pip setuptools " python3 -m pip install norminette &...


1

I know a reference to a plugin is not an ideal answer, but this is a tricky thing to accomplish generally and I maintain a plugin which seems to do exactly what you ask for so I'll mention it. The plugin match-up supports text objects a% and i% corresponding to pairs which were originally defined by matchit's % (matchit is a built-in plugin in vim which ...


Only top voted, non community-wiki answers of a minimum length are eligible