From b1a8f70058b6473bcad3c74491898a85b140121f Mon Sep 17 00:00:00 2001 From: Max Hohlfeld Date: Wed, 16 Aug 2023 14:05:48 +0200 Subject: [PATCH] fix: nvim tab and c-i keys --- roles/nvim/files/init_pc.lua | 19 +++++-------------- roles/xmonad/files/alacritty.yml | 3 ++- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/roles/nvim/files/init_pc.lua b/roles/nvim/files/init_pc.lua index 94ab92e..b5d79c7 100644 --- a/roles/nvim/files/init_pc.lua +++ b/roles/nvim/files/init_pc.lua @@ -73,6 +73,9 @@ map('n', 'w', 'w', { noremap = true }) map('n', 'q', 'wq', { noremap = true }) map('n', '', 'let @/ = ""', { noremap = true }) +-- fix interpreting C-I as Tab +map('n', '', '', { noremap = true }) + -- Splits map('n', '', 'h', { noremap = true }) map('n', '', 'j', { noremap = true }) @@ -218,12 +221,6 @@ ls.config.set_config({ require("luasnip.loaders.from_lua").load({ paths = "~/.config/nvim/lua/snippets" }) -local has_words_before = function() - unpack = unpack or table.unpack - local line, col = unpack(vim.api.nvim_win_get_cursor(0)) - return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil -end - -- Completion local cmp = require('cmp') cmp.setup { @@ -236,20 +233,14 @@ cmp.setup { [''] = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Insert, select = false }), [''] = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Insert, select = true }), [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - elseif ls.expand_or_locally_jumpable() then + if ls.expand_or_locally_jumpable() then ls.expand_or_jump() - elseif has_words_before() then - cmp.complete() else fallback() end end, { "i", "s" }), [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif ls.locally_jumpable(-1) then + if ls.locally_jumpable(-1) then ls.jump(-1) else fallback() diff --git a/roles/xmonad/files/alacritty.yml b/roles/xmonad/files/alacritty.yml index 99921a5..7e74579 100644 --- a/roles/xmonad/files/alacritty.yml +++ b/roles/xmonad/files/alacritty.yml @@ -2,7 +2,8 @@ env: TERM: xterm-256color key_bindings: - - { key: N, mods: Control|Shift, action: SpawnNewInstance } + - { key: N, mods: Control|Shift, action: SpawnNewInstance } + - { key: I, mods: Control, chars: "\x1b[105;5u" } font: normal: