Skip to content

fix(keymaps): remap <C-L> functionality into <C-c> - #2191

Open
nathanzeng wants to merge 1 commit into
nvim-lua:masterfrom
nathanzeng:ctrl-c
Open

nathanzeng wants to merge 1 commit into
nvim-lua:masterfrom
nathanzeng:ctrl-c

Conversation

@nathanzeng

@nathanzeng nathanzeng commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Problem:
We use <C-L> for window navigation, but it is also the only way to clear multicursors when in neovim 0.13.

Solution:
Create a mapping for <C-c> that performs <C-c> as well as <C-L> default behavior.

NOTE: probably wait for 0.13 stable release to merge this.

Comment thread init.lua

-- Clear highlights on search when pressing <Esc> in normal mode
-- See `:help hlsearch`
vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm could go either way on removing this, but I just didn't think it made sense to have two mappings cover the same thing

Comment thread init.lua
Comment on lines +241 to +249
vim.keymap.set(
'n',
'<C-c>',
'<Cmd>nohlsearch'
.. '<Bar>diffupdate'
.. '<Bar>call nvim_buf_clear_namespace(0, nvim_create_namespace("nvim.multicursor"), 0, -1)'
.. '<Bar>normal! <C-L><C-c><CR>',
{ desc = 'Clear pending command and search highlighting, update diffs, remove multicursors' }
)

@nathanzeng nathanzeng Nov 30, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is not friendly enough, I could see if we could get an upstream feature for a <Plug> mapping for CTRL-L behavior

Problem:
We use `<C-L>` for window navigation, but it is also the only way to clear multicursors when in neovim 0.13.

Solution:
Create a mapping for `<C-c>` that performs `<C-c>` as well as `<C-L>` default behavior.

NOTE: probably wait for 0.13 stable release to merge this.
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

Successfully merging this pull request may close these issues.

1 participant