Changing CtrlSpaceIgnoredFiles after the fact
I might be missing something obvious, but it seems to me that if one tries to change the g:CtrlSpaceIgnoredFlag variable in a running vim session that it will be ignored. I simply tried this:
- Set
g:CtrlSpaceIgnoredFlagin a vimscript file in thepluginfolder - Start vim
- do a
let g:CtrlSpaceIgnoredFlag=... - Open the FileList and refresh
In this scenario the changes are not taken into account.
You might wonder why I want to do this thing in the first place, and this is just the result of a bit of debugging. I use the localvimrc plugin so that I can have some project specific vim settings in my project folder, and the g:CtrlSpaceIgnoredFlag is exactly something that would naturally change from project to project. Obviously ignoring gitignore files is all well and good, but sometimes that is not all one wants to do.
Anyway, is this intended behaviour? Is the a more proper way you expect people to handle these types of situations that I simply didn't find in the helpfiles?
I am also on neovim v0.2.3-dev if that makes any difference.
I haven't looked into changing a variable like this while vim is still running...
A question I have is whether the CtrlSpace plugin also reads through all it's config variables while refreshing the FileList or only when it does it's main startup config-check to see how to run.
For clarification - you change which project you're working on while keeping vim running (as opposed to starting a new session)? Do you use the CtrlSpace Workspaces, or just keep the projects in distinct folders?
OK, I checked on this, and the CtrlSpace function only reads and implements its config variables on initial startup of the plugin. All that code is in the autoload section.
It reads the config on startup using its init function in context.vim#L71
The refresh of the file list only refreshes the list; not the variables: files.vim#L107
So your best bet/workaround with the plugin at this point is to restart the vim session in a new directory so that vim reads the localvimrc settings on startup. If you want CtrlSpace itself to re-read its variables, a pull request is wecome. :)