-
Notifications
You must be signed in to change notification settings - Fork 37
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
Add support for setting custom mappings #93
Add support for setting custom mappings #93
Conversation
Base upon the failed test of the commit 15a35b5, I dont know how to allows the users to use the I had issues with Coc (conquere of completion) with the autocomplete (also binded to the key), and solved it with:
with the exposed function in the
This PR was originally to solve this issue and let the people customize the configuration; I should probably split the PR in two, as you prefere. |
e911697
to
352560e
Compare
Hi @mdedonno1337, thank you for submitting this PR! This is something that was requested by a few people due to conflicts with other plugins, so I'm sure it will be very helpful for a lot of people and hopefully motivating! (#43, #77, #57, #85, #74) AFAIK, the idiomatic way to expose a mapping from a plugin and allow for user customization is using For example, in the plugin we will have: inoremap <silent> <Plug>(bullets-insert-new-bullet) <C-]><C-R>=<SID>insert_new_bullet()<cr>
let s:bullets_bindings_default = [
\['imap', '<cr>', '<Plug>(bullets-insert-new-bullet)'], Then in their vimrc users can add: imap <silent><expr> <CR> pumvisible() ? "\<C-y>" : "\<Plug>(bullets-insert-new-bullet)" (notice that I switched Here are some really good articles highlighting the use of
Here are some other plugins using Maybe it would be better if instead of exposing a 2D array for the user to customize, which locks them into the specific ways we use mappings ( |
Thanks for the feedback! |
352560e
to
a451f0a
Compare
a451f0a
to
ac6d3e8
Compare
really happy to see this work being done. any updates @dkarter or @mdedonno1337? |
Thanks for the interest! Still on my todo list... |
looking forward for this, thanks for the PR! 🚀 |
Rework insert mode cr mapping to accept completion if menu visible See bullets-vim/bullets.vim#43 And bullets-vim/bullets.vim#93
Oh, I didn’t notice this one existed before making #128. I’m surprised I implemented that in a very similar way. I guess it’s a good sign 😅 ? |
I agree, @wenzel-hoffman! Closing this for now @mdedonno1337 if the current solution doesn't fit your need we can discuss further. Thanks for your efforts! |
This PR implements the functionnality to set custom mappings.
This option can be used by setting the
g:bullets_bindings
variable in the vim rc file as follow (for example):Note that the
ToggleCheckbox
is binded toCtrl-T
in this case for example.This allows to set only a part of the bindinds, as the users whiches.
Moreover, the doc is not set at the moment but should be done before merging if this feature is OK for you.