-
Notifications
You must be signed in to change notification settings - Fork 6
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
Educate just doesn’t switch on automatically #20
Comments
Can you please post your vim RC code for how you are setting |
Here it is (complete vimrc is on https://gitlab.com/mcepl/vimdir/-/blob/master/vimrc ): " for vim-textobj-quote
function! TextObjSettings()
if exists(":Educate")
if &spelllang =~ 'cs'
call textobj#quote#init({ 'double':'„“', 'single':'‚‘', 'educate': 1 })
elseif &spelllang =~ 'en'
call textobj#quote#init({ 'double':'“”', 'single':'‘’', 'educate': 1 })
endif
exe "Educate"
endif
endfunction
map <silent> <leader>qc <Plug>ReplaceWithCurly
let g:textobj#quote#educate = 1
autocmd OptionSet spelllang call TextObjSettings()
autocmd BufEnter *.rst call TextObjSettings()
noremap <buffer> <Leader>sq call TextObjSettings() |
Why are you running |
One of many desperate attempts to switch |
@mcepl FWIW, I installed this plugin the other day and had the same problem. Found this issue when googling the problem. I could activate Since I use coc.nvim, I just switched to using the coc-pairs plugin instead. Hope that helps! |
@mcepl Have you tried testing this creating a MWE with just this plugin and nothing else? |
No |
@mcepl Do you mean you don't have auto-pairs or you do? If the latter (as your comma suggests) then I think we can narrow this down to that. If the former, please don't just limit the test to disabling auto-pairs, strip all other plugins to a bare minimum config with just this plugin and see if it still fails. |
Sorry, the comma was a mistake. |
You are right, this is a clash with https://github.com/tmsvg/pear-tree , when I removed that, Educate is suddenly automatically on. Thank you. |
Hmm. I would actually be inclined to keep this open. If we are clashing with multiple other plugins (in this case both plugins doing a similar thing) we (or they) might be doing something wrong. I don't think these necessarily need to conflict, or at least could do so more gracefully. |
OK |
Hey @tmsvg or @jiangmiao do either of you happen to have an idea off the top of your head why a plugin like this would conflict or what should be done about it. I imagine there is a hook somewhere both plugins are trying to grab and that we should check if it has been previously utilized, but I'm not quite sure where to start. |
vim-textobj-quote and the other plugins mentioned here (auto-pairs, pear-tree) are using I'm not sure how that could be fixed in a proper way, but as a workaround, I started to make sure only one of these plugins take control for a given key. For example, the auto-pairs plugin can be configured per file type to handle only a subset of keypresses instead of its default list:
In other words, I can describe that I'm fine to only auto-pair I wonder if there's a good way to somehow let these mappings to be chained 🤔 E.g. let vim-textobj-quote to replace straight quote |
I'm sure we could figure out some sort of handoff, bit it might take some fiddling and cooperation for both sides with a hook / callback of some sort since the trigger event isn't quite what the other side normally handles. |
No matter whether I rely on default (which is supposed to be that
educate
is on), or whether I add'educate': 1
explicitly to the configuration of the plugin), it is always off, and I have to run command:Edcuate
every time I start new instance of vim (neovim from the master branch of the git, or vim 8.2.0348, but I have observed it for some time already).I don’t see any error messages anywhere.
The text was updated successfully, but these errors were encountered: