Skip to content
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

[Bug] Disabling default mappings not working Neovim #147

Open
Dani-v-tue opened this issue Mar 12, 2024 · 2 comments
Open

[Bug] Disabling default mappings not working Neovim #147

Dani-v-tue opened this issue Mar 12, 2024 · 2 comments

Comments

@Dani-v-tue
Copy link

Hello,

When I try to disable custom keymaps and set my own mapping for <cr> it breaks since the keymaps do not get disabled.

for example:

vim.g.bullets_set_mappings = 0
vim.keymap.set('i', '<cr>', 'test')

This remap will work fine in most files, except .md and .txt (that I tested)

The issue resolves itself when I uninstall the plugin.

Does anyone perhaps know what is causing this?

@Dani-v-tue Dani-v-tue changed the title Disabling default mappings not working Neovim [Bug] Disabling default mappings not working Neovim Mar 12, 2024
@harshad1
Copy link
Collaborator

That variable does not actually control the various remappings.

All it does is control whether these are set:


  if g:bullets_set_mappings
    " Automatic bullets
    call s:add_local_mapping(1, 'imap', '<cr>', '<Plug>(bullets-newline)')
    call s:add_local_mapping(1, 'inoremap', '<C-cr>', '<cr>')

    call s:add_local_mapping(1, 'nmap', 'o', '<Plug>(bullets-newline)')

    " Renumber bullet list
    call s:add_local_mapping(1, 'vmap', 'gN', '<Plug>(bullets-renumber)')
    call s:add_local_mapping(1, 'nmap', 'gN', '<Plug>(bullets-renumber)')

    " Toggle checkbox
    call s:add_local_mapping(1, 'nmap', '<leader>x', '<Plug>(bullets-toggle-checkbox)')

    " Promote and Demote outline level
    call s:add_local_mapping(1, 'imap', '<C-t>', '<Plug>(bullets-demote)')
    call s:add_local_mapping(1, 'nmap', '>>', '<Plug>(bullets-demote)')
    call s:add_local_mapping(1, 'vmap', '>', '<Plug>(bullets-demote)')
    call s:add_local_mapping(1, 'imap', '<C-d>', '<Plug>(bullets-promote)')
    call s:add_local_mapping(1, 'nmap', '<<', '<Plug>(bullets-promote)')
    call s:add_local_mapping(1, 'vmap', '<', '<Plug>(bullets-promote)')
  end

@harshad1
Copy link
Collaborator

We need to add a proper function to set / unset the various automatic mappings on etc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants