From 67130a28e3c342e0ff9978d1c2b61b4e219a3cc2 Mon Sep 17 00:00:00 2001 From: Gregory Trolliet Date: Mon, 21 Oct 2024 09:02:27 +0200 Subject: [PATCH] [nvim] Add some shortcuts and Aerial plugin --- .config/nvim/init.lua | 41 +++++++++++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 9deb399..8900be9 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -18,19 +18,22 @@ require("lazy").setup({ require("core.options") options = { noremap = true } -map('n', 'ff', ':Telescope find_files', options) -map('n', 'fg', ':Telescope git_files', options) -map('n', 'fc', ':Telescope git_commits', options) -map('n', 'fl', ':Telescope live_grep', options) -map('n', '', ':Telescope buffers', options) -map('n', 't', ':TagbarToggle', options) -map('n', 'nv', ':Telescope find_files cwd=~/.config/nvim', options) -map('n', 'nc', ':Telescope find_files cwd=~/.config', options) +map('n', 'ff', ':Telescope find_files', options) +map('n', 'fg', ':Telescope git_files', options) +map('n', 'fc', ':Telescope git_commits', options) +map('n', 'fC', ':Telescope git_bcommits', options) +map('n', 'fl', ':Telescope live_grep', options) +map('n', 'fh', ':Telescope help_tags', options) +map('n', '', ':Telescope buffers', options) +map('n', 'nv', ':Telescope find_files cwd=~/.config/nvim', options) +map('n', 'nc', ':Telescope find_files cwd=~/.config', options) -map('n', 'gd', ':Telescope lsp_definitions', options) -map('n', 'gr', ':Telescope lsp_references', options) -map('n', 'gs', ':Telescope lsp_workspace_symbols', options) -map('n', 'gS', ':Telescope lsp_dynamic_workspace_symbols', options) +map('n', 'gd', ':Telescope lsp_definitions', options) +map('n', 'gr', ':Telescope lsp_references', options) +map('n', 'gs', ':Telescope lsp_workspace_symbols', options) +map('n', 'gS', ':Telescope lsp_dynamic_workspace_symbols', options) + +map('n', 'h', ':nohlsearch', options) -------------------------------------------------- -- Telescope @@ -110,3 +113,17 @@ cmp.setup({ }, mapping = cmp.mapping.preset.insert({}), }) + +-------------------------------------------------- +-- Aerial +-------------------------------------------------- +require("aerial").setup({ + -- optionally use on_attach to set keymaps when aerial has attached to a buffer + on_attach = function(bufnr) + -- Jump forwards/backwards with '{' and '}' + --vim.keymap.set("n", "{", "AerialPrev", { buffer = bufnr }) + --vim.keymap.set("n", "}", "AerialNext", { buffer = bufnr }) + end, +}) +-- You probably also want to set a keymap to toggle aerial +vim.keymap.set("n", "a", "Telescope aerial")