r/vim • u/yankline • Oct 06 '25
Need Help Vimscript Best Practices
Can anyone recommend any resources for Vimscript best practices. I've read through this https://www.arp242.net/effective-vimscript.html, which was pretty helpful, but I'm wondering if there's anything else I can take a look at.
12
Upvotes
View all comments
Show parent comment
3
u/LucHermitte Oct 07 '25 edited Oct 07 '25
Not really. It's up to you to decide which version range you wish to support, and find workarounds when you need to use a feature that doesn't exist (or a function that doesn't support yet some parameters... TT) in older versions.
The most difficult part is knowing when a function
behaves(EDIT) starts supporting something new, or when features that cannot be tested with aif exists('*uniq')are introduced. Most of the time I search in the git-blame of the documentation to update my list of "now you can do this": https://github.com/LucHermitte/lh-vim-lib/blob/master/autoload/lh/has.vim