-
Notifications
You must be signed in to change notification settings - Fork 620
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
Allow overwriting insert mode maps #1030
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
According to `:h hasmapto()` if we don't pass the mode as an argument then only normal, visual and operator-pending modes are checked. Lets pass the mode explicitly to allow overwriting insert mode mappings.
amitbeka
pushed a commit
to amitbeka/vimwiki
that referenced
this pull request
Nov 9, 2020
Mapping `<Tab>` and `<S-Tab>` at insert mode sometimes collide with other plugins which utilize these for completions (e.g. coc example mapping). Since for many users the case for completion is more frequent than table editing, this patch enables changing these mappings using the options `g:vimwiki_tbl_next_cell` and `g:vimwiki_tbl_prev_cell`. This patch makes it easier of those using multiple plugins and have no desire or knowledge in debugging the collision. It complements vimwiki#1030 by providing a more direct and documented method for setting custom keymappings. Signed-off-by: Amit Beka <--->
6 tasks
amitbeka
pushed a commit
to amitbeka/vimwiki
that referenced
this pull request
Nov 15, 2020
Mapping `<Tab>` and `<S-Tab>` at insert mode sometimes collide with other plugins which utilize these for completions (e.g. coc example mapping). Since for many users the case for completion is more frequent than table editing, this patch enables changing these mappings using the options `<Plug>VimwikiTableNextCell` and `<Plug>VimwikiTablePrevCell`. This patch makes it easier of those using multiple plugins and have no desire or knowledge in debugging the collision. It complements vimwiki#1030 by providing a more direct and documented method for setting custom keymappings. Signed-off-by: Amit Beka <--->
amitbeka
pushed a commit
to amitbeka/vimwiki
that referenced
this pull request
Nov 18, 2020
Mapping `<Tab>` and `<S-Tab>` at insert mode sometimes collide with other plugins which utilize these for completions (e.g. coc example mapping). Since for many users the case for completion is more frequent than table editing, this patch enables changing these mappings using the options `<Plug>VimwikiTableNextCell` and `<Plug>VimwikiTablePrevCell`. This patch makes it easier of those using multiple plugins and have no desire or knowledge in debugging the collision. It complements vimwiki#1030 by providing a more direct and documented method for setting custom keymappings. Signed-off-by: Amit Beka <--->
tinmarino
pushed a commit
that referenced
this pull request
Nov 19, 2020
Mapping `<Tab>` and `<S-Tab>` at insert mode sometimes collide with other plugins which utilize these for completions (e.g. coc example mapping). Since for many users the case for completion is more frequent than table editing, this patch enables changing these mappings using the options `<Plug>VimwikiTableNextCell` and `<Plug>VimwikiTablePrevCell`. This patch makes it easier of those using multiple plugins and have no desire or knowledge in debugging the collision. It complements #1030 by providing a more direct and documented method for setting custom keymappings. Signed-off-by: Amit Beka <---> Co-authored-by: Amit Beka <--->
deepredsky
pushed a commit
to deepredsky/vimwiki
that referenced
this pull request
Jan 16, 2021
According to `:h hasmapto()` if we don't pass the mode as an argument then only normal, visual and operator-pending modes are checked. Lets pass the mode explicitly to allow overwriting insert mode mappings.
jls83
pushed a commit
to jls83/vimwiki
that referenced
this pull request
Jan 17, 2023
According to `:h hasmapto()` if we don't pass the mode as an argument then only normal, visual and operator-pending modes are checked. Lets pass the mode explicitly to allow overwriting insert mode mappings.
jls83
pushed a commit
to jls83/vimwiki
that referenced
this pull request
Jan 17, 2023
Mapping `<Tab>` and `<S-Tab>` at insert mode sometimes collide with other plugins which utilize these for completions (e.g. coc example mapping). Since for many users the case for completion is more frequent than table editing, this patch enables changing these mappings using the options `<Plug>VimwikiTableNextCell` and `<Plug>VimwikiTablePrevCell`. This patch makes it easier of those using multiple plugins and have no desire or knowledge in debugging the collision. It complements vimwiki#1030 by providing a more direct and documented method for setting custom keymappings. Signed-off-by: Amit Beka <---> Co-authored-by: Amit Beka <--->
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
According to
:h hasmapto()
if we don't pass the mode as an argument then only normal, visual and operator-pending modes are checked.Lets pass the mode explicitly to allow overwriting insert mode mappings.
I think this will fix: #1021
Original PR that introduced
vimwiki#u#map_key()
: #686With this minimal
.vimrc | init.vim
:Notice I want to remap
<C-T>
in insert mode. We should only need to remap<Plug>VimwikiIncreaseLvlSingleItem
to another key (<F13>
in this case) and vimwiki should not apply this:call vimwiki#u#map_key('i', '<C-T>', '<Plug>VimwikiIncreaseLvlSingleItem')
fromftplugin/vimwiki.vim
.Without this patch this is not happening,
:verbose imap <C-T>
:With the patch:
I searched all vimwiki codebase and noticed all
vimwiki#u#map_key
calls always have the mode as first argument, so I think this is a safe fix. Writing a test is above my knowledge/time.Steps for submitting a pull request:
dev
branch!doc/vimwiki.txt
if applicable,including the Changelog and Contributors sections.