-
Notifications
You must be signed in to change notification settings - Fork 317
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
Messing with users vim settings (switchbuf) #309
Comments
You should be able to override the setting by configuring it in the "after" directory (see Like many things in software design, what you are observing here is a trade-off. Ideally, plug-ins wouldn't override user settings. In this case, it does in order to deliver a better user experience for most of the users (who would otherwise complain about stuff opening in new splits etc), and only because there is the "escape hatch" of the "after" directory that exists for users who disagree. Nothing has changed that would make Command-T open in a split; it's probably some interaction with settings in your vimrc or other plug-ins. The most critical part of the logic for opening is here: command-t/autoload/commandt.vim Lines 159 to 173 in c5882de
If you find that it doesn't work properly with your set-up and there is some reason why you can't change your set-up you can override the settings listed under Lines 616 to 626 in c5882de
|
Thanks for your concise and timely response! I understand it can be overridden in the Personally I disagree with the decision, I'm likely biased because this isn't my use case, but I think the fact that this isn't default vim behavior is a strong argument against the decision, or at very least the implementation. I understand you are attempting to make life easier for the majority, but under the current implementation it's at the expense of making life much more difficult (and confusing) for everyone else. I can see i'm not going to be able to convince you that those that want this behavior should just set Have a var The present solution has other flaws, such as if What do you think? |
In the mean time for those who don't want to use a file in the
This will wait until after CommandT has loaded and then run |
Alternatively, you can set switchbuf explicitly to the default behavior:
This will behave the same as Also, for anyone using Ack.vim or any plugin that uses the quickfix window, this will impact their buffer opening behavior. |
Whoops,.. well now I feel dumb!
I must have typo'd Closing as this stupidly simple solution solves the main issue. |
Try to avoid people running into this issue: #289 If people end up complaining about this will have to document how to avoid this (ie. by setting up a non-default setting in `~/.vim/vimrc`, or setting back to the empty default in an "after" file).
See 237 and 246
I believe it is incorrect to have made this the default behavior, at least in the manner it has been implemented.
The current implementation is changing a users vim settings in a way that cannot be prevented in vimrc, only overridden after the fact.
If a user wants
switchbuf=''
then at present command-t changes this toswitchbuf=usetab
. The only way to override this behavior is to then change it back again after command-t has loaded.The argument can also be made that it isn't a plugins job to change a users vim settings to what it thinks are the best defaults, at least not unless those vim settings are absolutely required for the correct functioning of the plugin, which doesn't apply in this case.
If
usetab
is to remain as default for command-t (which personally I don't think it should, after all it isn't the vim default for a reason) then it should be implemented in a way which doesn't alter users existing built in vim settings. Or at the very least in a way that allows the user to prevent this behavior in their standardvimrc
without resorting to auto-commands that must be run after command-t has loaded.--- edit---
On a side note, has something changed that prevents Command-T from opening in the current window?
Mine seems to have started opening in a split, I wonder if it's a change to the code or to my vimrc..?
The text was updated successfully, but these errors were encountered: