i use arch btw
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Only dismiss notifications if no ongoing search

+14 -11
+14 -11
nvim/.config/nvim/lua/keymaps.lua
··· 9 9 -- map('n', 'g#', "g#<Cmd>lua require('hlslens').start()<CR>", silent) 10 10 -- map('n', '<Esc>', '<Cmd>noh<CR>', silent) 11 11 12 - map('n', '<C-k>', '<C-w><C-k>') 13 - map('n', '<C-j>', '<C-w><C-j>') 14 - map('n', '<C-l>', '<C-w><C-l>') 15 - map('n', '<C-h>', '<C-w><C-h>') 12 + map("n", "<C-k>", "<C-w><C-k>") 13 + map("n", "<C-j>", "<C-w><C-j>") 14 + map("n", "<C-l>", "<C-w><C-l>") 15 + map("n", "<C-h>", "<C-w><C-h>") 16 16 17 17 -- why does this not work :( 18 18 --map('i', '<Esc>', 'pumvisible() ? "<C-e><Esc>" : "<Esc>"', { silent = true, expr = true } ) 19 19 --map('i', '<C-c>', 'pumvisible() ? "<C-e><C-c>" : "<C-c>"', { silent = true, expr = true } ) 20 20 --map('i', '<BS>', 'pumvisible() ? "<C-e><BS>" : "<BS>"', { silent = true, expr = true } ) 21 21 --map('i', '<CR>', 'pumvisible() ? (complete_info().selected == -1 ? "<C-e><CR>" : "<C-y>") : "<CR>', { silent = true, expr = true } ) 22 - vim.cmd('ino <silent><expr> <Esc> pumvisible() ? "\\<C-e><Esc>" : "\\<Esc>"') 23 - vim.cmd('ino <silent><expr> <C-c> pumvisible() ? "\\<C-e><C-c>" : "\\<C-c>"') 24 - vim.cmd('ino <silent><expr> <BS> pumvisible() ? "\\<C-e><BS>" : "\\<BS>"') 25 - vim.cmd('ino <silent><expr> <CR> pumvisible() ? (complete_info().selected == -1 ? "\\<C-e><CR>" : "\\<C-y>") : "\\<CR>"') 22 + vim.cmd('ino <silent><expr> <Esc>pumvisible() ? "\\<C-e><Esc>" : "\\<Esc>"') 23 + vim.cmd('ino <silent><expr> <C-c>pumvisible() ? "\\<C-e><C-c>" : "\\<C-c>"') 24 + vim.cmd('ino <silent><expr> <BS>pumvisible() ? "\\<C-e><BS>" : "\\<BS>"') 25 + vim.cmd('ino <silent><expr> <CR>pumvisible() ? (complete_info().selected == -1 ? "\\<C-e><CR>" : "\\<C-y>") : "\\<CR>"') 26 26 27 27 --map('n', '<leader>s', '<cmd>SwapSplit<CR>') 28 28 29 - map('n', '<Esc>', function() 30 - vim.cmd.nohlsearch() 31 - require('noice').cmd('dismiss') 29 + map("n", "<Esc>", function() 30 + if vim.v.hlsearch == 1 then 31 + vim.cmd.nohlsearch() 32 + else 33 + require("noice").cmd("dismiss") 34 + end 32 35 end, silent)