vim.keymap.set('i', 'jj', '') -- Clear highlights on search when pressing in normal mode -- See `:help hlsearch` vim.keymap.set('n', '', 'nohlsearch') -- Diagnostic keymaps vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) -- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier -- for people to discover. Otherwise, you normally need to press , which -- is not what someone will guess without a bit more experience. -- -- NOTE: This won't work in all terminal emulators/tmux/etc. Try your own mapping -- or just use to exit terminal mode vim.keymap.set('t', '', '', { desc = 'Exit terminal mode' }) -- Keybinds to make split navigation easier. -- See `:help wincmd` for a list of all window commands vim.keymap.set('n', '', '', { desc = 'Move focus to the left window' }) vim.keymap.set('n', '', '', { desc = 'Move focus to the right window' }) vim.keymap.set('n', '', '', { desc = 'Move focus to the lower window' }) vim.keymap.set('n', '', '', { desc = 'Move focus to the upper window' }) -- TELESCOPE -- -- See `:help telescope.builtin` local tpb = require 'telescope.builtin' vim.keymap.set('n', 'sh', tpb.help_tags, { desc = '[S]earch [H]elp' }) vim.keymap.set('n', 'sk', tpb.keymaps, { desc = '[S]earch [K]eymaps' }) vim.keymap.set('n', 'sf', tpb.find_files, { desc = '[S]earch [F]iles' }) vim.keymap.set('n', 'ss', tpb.builtin, { desc = '[S]earch [S]elect Telescope' }) vim.keymap.set('n', 'sw', tpb.grep_string, { desc = '[S]earch current [W]ord' }) vim.keymap.set('n', 'sg', tpb.live_grep, { desc = '[S]earch by [G]rep' }) vim.keymap.set('n', 'sd', tpb.diagnostics, { desc = '[S]earch [D]iagnostics' }) vim.keymap.set('n', 'sr', tpb.resume, { desc = '[S]earch [R]esume' }) vim.keymap.set('n', 's.', tpb.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' }) vim.keymap.set('n', '', tpb.buffers, { desc = '[ ] Find existing buffers' }) -- Slightly advanced example of overriding default behavior and theme vim.keymap.set('n', '/', function() -- You can pass additional configuration to Telescope to change the theme, layout, etc. builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown { winblend = 10, previewer = false, }) end, { desc = '[/] Fuzzily search in current buffer' }) -- It's also possible to pass additional configuration options. -- See `:help telescope.builtin.live_grep()` for information about particular keys vim.keymap.set('n', 's/', function() builtin.live_grep { grep_open_files = true, prompt_title = 'Live Grep in Open Files', } end, { desc = '[S]earch [/] in Open Files' }) -- Shortcut for searching your Neovim configuration files vim.keymap.set('n', 'sn', function() builtin.find_files { cwd = vim.fn.stdpath 'config' } end, { desc = '[S]earch [N]eovim files' }) -- Disable arrow keys in normal mode vim.keymap.set('n', '', 'echo "Use h to move!!"') vim.keymap.set('n', '', 'echo "Use l to move!!"') vim.keymap.set('n', '', 'echo "Use k to move!!"') vim.keymap.set('n', '', 'echo "Use j to move!!"')