Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trigger a custom autocmd after sourcing #50

Merged
merged 1 commit into from
Feb 6, 2017
Merged

Conversation

MaienM
Copy link

@MaienM MaienM commented Feb 5, 2017

This can be used to automatically perform commands that might be needed to properly apply loaded settings, but that are not/should not be part of the local vimrc.

Example for my own setup: I use .lvimrc to set the indent style for a project. However, these changes are not automatically picked up by some of the installed plugins (example: https://github.com/nathanaelkane/vim-indent-guides), so I need to perform a command to update these. I could (and I do currently) include this command in the .lvimrc, but I feel like this doesn't really belong these, as it is in no way specific to that project. If I can instead do this as an autocommand I can avoid having to include this in every .lvimrc, limiting the contents of those to stuff that is actually specific to that project. As a bonus, it would also allow me to use sandbox mode again for most of my .lvimrc files.

This can be used to automatically perform commands after a local vimrc is sourced
@embear
Copy link
Owner

embear commented Feb 5, 2017

I really like this idea! I'll merge soon.

@embear embear merged commit 821c2d3 into embear:master Feb 6, 2017
@embear
Copy link
Owner

embear commented Feb 6, 2017

I changed the autocommand to LocalVimRCPre, LocalVimRC and LocalVimRCPost and added some documentation.

@MaienM MaienM deleted the patch-1 branch February 6, 2017 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants