Why Your Text Editor Plugins Belong in a Lock File

(You lock your application dependencies, don’t you?) Then you could add that file to version control.

Going back to your old setup would be like snapping your fingers.

Just check out the previous commit and run the install command.

Sounds obvious in hindsight, right?I’ve kept my plugins in a plugin.

lock file for about a year now, and it has been wonderful.

It works exactly like you would expect.

I update my plugins every couple months.

If I run into an issue and don’t feel like dealing with it immediately then I can quickly revert.

For debugging, I can do a quick git diff to see which plugins were recently updated.

If one plugin is misbehaving, I pull the old version from my git history and continue on my way.

If I’m desperate to determine which plugin is misbehaving, I can even do a binary search (recursively revert half the versions and check if the problem still exists).

Creating and using your very own plugin.

lock file is really easy.

I have a few examples below for popular editors.

VIMUsing the popular VIM plugin manager vim-plugCreate your lock file…:PlugSnapshot plugin.

lockRestore from your lock file…:source plugin.

lockAtomCreate your lock file…apm list –installed –bare | xargs -L 1 echo apm install > plugin.

lockRestore from your lock file…sh plugin.

lockVS CodeThe insiders version of Visual Studio Code Supports this.

Disable auto extension updating (if you haven’t done so already)Create your lock file…code-insiders –list-extensions –show-versions | xargs -L 1 echo code-insiders –install-extension > plugin.

lockRestore from your lock file…sh plugin.

lockIf you have instructions for creating a plugin.

lock in other editors, please let me know in the comments!.

. More details

Leave a Reply