-- Mapping helper local mapper = function(mode, key, result) vim.keymap.set(mode, key, result, { noremap = true, silent = true }) end local no_plugins = require("dwl.plugins") mapper("n", "", "h") mapper("n", "", "j") mapper("n", "", "k") mapper("n", "", "l") mapper("n", "gd", ":vs | lua vim.lsp.buf.definition()") -- open defn in a new vsplit if no_plugins then return end -- Telescope integration local telescope_builtin = require("telescope.builtin") mapper("n", "ff", telescope_builtin.find_files) -- search all files, respecting .gitignore if one exists mapper("n", "fb", telescope_builtin.buffers) -- search open buffers mapper("n", "fl", telescope_builtin.current_buffer_fuzzy_find) -- search lines in current buffer mapper("n", "gg", telescope_builtin.live_grep) -- search all lines in project mapper("n", "fr", telescope_builtin.lsp_references) -- search references to symbol under cursor mapper("n", "gc", telescope_builtin.git_branches) -- checkout different branches -- Git things mapper("n", "gs", ":vs Git") -- `git status` in a new tab to save screen real estate mapper("n", "gd", "Gdiffsplit") -- open a split diffing the current file