mirror of
https://github.com/He4eT/dotfiles.git
synced 2026-05-04 15:37:22 +00:00
nvim: keymaps for the interface wiping
This commit is contained in:
parent
62f8330560
commit
919030514d
1 changed files with 15 additions and 4 deletions
|
|
@ -199,13 +199,24 @@ end, {
|
||||||
vim.keymap.set('n', '<leader>d', vim.diagnostic.open_float, { desc = 'Open floating [d]iagnostic message' })
|
vim.keymap.set('n', '<leader>d', vim.diagnostic.open_float, { desc = 'Open floating [d]iagnostic message' })
|
||||||
vim.keymap.set('n', '<leader>D', vim.diagnostic.setloclist, { desc = 'Open [D]iagnostics list' })
|
vim.keymap.set('n', '<leader>D', vim.diagnostic.setloclist, { desc = 'Open [D]iagnostics list' })
|
||||||
|
|
||||||
-- Highlight
|
|
||||||
vim.keymap.set({ 'n' }, '<BS>', ':nohl<CR>', { silent = true, desc = 'Hide highlight' })
|
|
||||||
vim.keymap.set({ 'n' }, '<ESC>', ':nohl<CR>', { silent = true, desc = 'Hide highlight' })
|
|
||||||
|
|
||||||
-- Search in Visual Mode
|
-- Search in Visual Mode
|
||||||
vim.keymap.set({ 'x' }, '/', '<Esc>/\\%V', { desc = 'Search within visual selection' })
|
vim.keymap.set({ 'x' }, '/', '<Esc>/\\%V', { desc = 'Search within visual selection' })
|
||||||
|
|
||||||
|
-- Hide search highlight, cmdline, and popups
|
||||||
|
local function wipe_ui()
|
||||||
|
vim.api.nvim_command 'nohlsearch'
|
||||||
|
vim.api.nvim_echo({}, false, {})
|
||||||
|
for _, win in ipairs(vim.api.nvim_list_wins()) do
|
||||||
|
local win_config = vim.api.nvim_win_get_config(win)
|
||||||
|
if win_config.relative ~= '' then
|
||||||
|
vim.api.nvim_win_close(win, true)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.keymap.set({ 'n' }, '<BS>', wipe_ui, { desc = 'Clear search, cmdline, and popups' })
|
||||||
|
vim.keymap.set({ 'n' }, '<ESC>', wipe_ui, { desc = 'Clear search, cmdline, and popups' })
|
||||||
|
|
||||||
--[[ cfg_lazy: Plugin manager ]]
|
--[[ cfg_lazy: Plugin manager ]]
|
||||||
-- https://github.com/folke/lazy.nvim
|
-- https://github.com/folke/lazy.nvim
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue