Jim Stewart
  • Member for 5 years, 7 months
  • Last seen more than a month ago
How to identify all the loaded ftplugins for the current file?
Accepted answer
8 votes

I don't know of a direct way to get a list of only the things loaded for the current buffer based on filetype, but :scriptnames will list everything that's been loaded, including system/default ...

View answer
How to parse a string to a list?
Accepted answer
3 votes

You can do this with eval: let S = '[''123'', ''456'', ''789'']' let L = eval(S) Generally, using eval is something you should be wary of. Don't run it on untrusted data. But this does solve your ...

View answer
How to jump to the line of a diff?
3 votes

I'm a little surprised that gf doesn't already support this, but it doesn't. There's a plugin that does, though: gf-diff (GitHub mirror). Someone also wrote a blog post with a more ad-hoc solution, ...

View answer
Empty first tab lost when using sessions
Accepted answer
3 votes

This is indeed a bug in Vim. I filed a GitHub issue, and someone on the vim-dev mailing list addressed it. Here's a patch that fixes it in Vim 8.0.52: diff --git a/src/ex_docmd.c b/src/ex_docmd.c ...

View answer
arbitrary length regex?
3 votes

This will match any number of digits before the d: :%s/%\d*d/XXX/g \d matches any digit, * matches 0 or more times. See :h pattern.txt for all things regex.

View answer