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

<C-space> not toggling box on line #2

Closed
thecarlhall opened this issue Apr 23, 2022 · 11 comments
Closed

<C-space> not toggling box on line #2

thecarlhall opened this issue Apr 23, 2022 · 11 comments

Comments

@thecarlhall
Copy link
Contributor

I've tried using <C-space> to toggle a checkbox but it doesn't do anything for me. Checking :map shows n <C-Space> *@:TadaBox<CR> as the only mapping for ctrl-space. When I run :TadaBox it works fine. When I add, nmap <silent> <leader>r :TadaBox<CR> to .vimrc, this works fine. Any suggestions of what else I should test? Love the plugin!

@dewyze
Copy link
Owner

dewyze commented Apr 24, 2022

Hey @thecarlhall glad to hear you like it!

That's no good if it's not working. Can you give me a minimally failing snippet I can debug with?

@bjoe2k4
Copy link

bjoe2k4 commented Apr 24, 2022

<C-Space> has a lot of gotchas on Windows terminal. Seems rather complex to me as also openssh may be involved.

Some context: microsoft/terminal#2865

I've also remapped to something else and it works fine.

@thecarlhall
Copy link
Contributor Author

For context, I'm on Mac using Alacritty w/ tmux and tested with Terminal w/o tmux.

Minimal failing snippet:

- Inbox:
  - A test task

There's a lot of folks on the internet calling out this keybinding in many places. One fix I've just found from vimwiki was to add this to .vimrc:
nmap <silent> <C-@> :TadaBox<CR>

@dewyze
Copy link
Owner

dewyze commented Apr 25, 2022

Hmm, @thecarlhall I use Alacritty on Mac w/tmux coincidentally too, I tried on every single character in that string and it worked fine.

Any suggestions on what to try?

@thecarlhall
Copy link
Contributor Author

Ha! I haven't yet found anything else trapping this key sequence. Adding the nmap above fixed this on 2 machines (macOS 11 & 12). <C-V> <C-space> shows ^@, so I think the sequence is making through to vim.

I cleaned out my .vimrc to the below text for testing, but still couldn't get C-space to call TadaBox until adding the nmap line from above. The mystery continues...

set nocompatible
filetype plugin indent on

call plug#begin('~/.vim/bundle')
Plug 'dewyze/vim-tada'
call plug#end()

@thecarlhall
Copy link
Contributor Author

Extra data point: I see the issue in Alacritty, Terminal, and now Kitty. I'm starting to wonder if this is deeper than the terminal emulator, or in a custom setting I can't/haven't found.

@dewyze
Copy link
Owner

dewyze commented Apr 26, 2022

Alright, so the issue is I am using Neovim, but you are talking about vim. I found that vim doesn't have the <C-Space> but it is the same as <C-@>. Link. Try setting:

let g:tada_map_box = '<C-@>`

@dewyze
Copy link
Owner

dewyze commented Apr 26, 2022

If that works for you, I'll see if I can add to the config to detect vim or neovim and set it accordingly.

@thecarlhall
Copy link
Contributor Author

Nailed it! You're also correct in that I'm using Vim (8.2) rather than NeoVim. Thanks for helping me nail this down.

@dewyze
Copy link
Owner

dewyze commented May 13, 2022

@thecarlhall I think this should fix it, let me know: bcf07ac

@thecarlhall
Copy link
Contributor Author

Works great! I removed let g:tada_map_box = '<C-@>' from .vimrc, and fetched & rebased your main branch. All is well now 😄

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

3 participants