diff options
| author | Thomas Vanbesien <tvanbesi@proton.me> | 2026-06-07 15:05:38 +0200 |
|---|---|---|
| committer | Thomas Vanbesien <tvanbesi@proton.me> | 2026-06-07 17:26:25 +0200 |
| commit | 6219ff44003259ca45d5760b15e68779f670587f (patch) | |
| tree | 51f25797aab806b2097c5e93342e8e256ab2fce2 /init.lua | |
| parent | bc1fb28a9226237800dfeb1112e04dfeebccb15d (diff) | |
| download | nvim-config-6219ff44003259ca45d5760b15e68779f670587f.tar.gz nvim-config-6219ff44003259ca45d5760b15e68779f670587f.zip | |
misc(nvim): add Ctrl+K mapping to kill command line
Diffstat (limited to 'init.lua')
| -rw-r--r-- | init.lua | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -170,6 +170,11 @@ vim.keymap.set({ "c", "i" }, "<M-h>", "<Space><BS><Left>") vim.keymap.set({ "c", "i" }, "<M-l>", "<Space><BS><Right>") vim.keymap.set("c", "<M-H>", "<C-Left>") vim.keymap.set("c", "<M-L>", "<C-Right>") +-- Kill text from cursor to end of line, akin to Readline's kill-line +vim.keymap.set("c", "<C-k>", function() + local pos = vim.fn.getcmdpos() -- 1-based byte index of the cursor + vim.fn.setcmdline(vim.fn.getcmdline():sub(1, pos - 1), pos) +end, { desc = "Kill from cursor to end of line" }) -- Non incremental history search, works when the completion menu is active vim.keymap.set("c", "<C-p>", function() return vim.fn.pumvisible() == 1 and "<C-e><Up>" or "<Up>" |
