[nvim] Add some shortcuts and Aerial plugin

This commit is contained in:
Gregory Trolliet 2024-10-21 09:02:27 +02:00
parent 09c2619797
commit 67130a28e3

View file

@ -18,19 +18,22 @@ require("lazy").setup({
require("core.options")
options = { noremap = true }
map('n', '<Leader>ff', ':Telescope find_files<Enter>', options)
map('n', '<Leader>fg', ':Telescope git_files<Enter>', options)
map('n', '<Leader>fc', ':Telescope git_commits<Enter>', options)
map('n', '<Leader>fl', ':Telescope live_grep<Enter>', options)
map('n', '<Leader><Space>', ':Telescope buffers<Enter>', options)
map('n', '<Leader>t', ':TagbarToggle<Enter>', options)
map('n', '<Leader>nv', ':Telescope find_files cwd=~/.config/nvim<Enter>', options)
map('n', '<Leader>nc', ':Telescope find_files cwd=~/.config<Enter>', options)
map('n', '<Leader>ff', ':Telescope find_files<Enter>', options)
map('n', '<Leader>fg', ':Telescope git_files<Enter>', options)
map('n', '<Leader>fc', ':Telescope git_commits<Enter>', options)
map('n', '<Leader>fC', ':Telescope git_bcommits<Enter>', options)
map('n', '<Leader>fl', ':Telescope live_grep<Enter>', options)
map('n', '<Leader>fh', ':Telescope help_tags<Enter>', options)
map('n', '<Leader><Space>', ':Telescope buffers<Enter>', options)
map('n', '<Leader>nv', ':Telescope find_files cwd=~/.config/nvim<Enter>', options)
map('n', '<Leader>nc', ':Telescope find_files cwd=~/.config<Enter>', options)
map('n', '<Leader>gd', ':Telescope lsp_definitions<Enter>', options)
map('n', '<Leader>gr', ':Telescope lsp_references<Enter>', options)
map('n', '<Leader>gs', ':Telescope lsp_workspace_symbols<Enter>', options)
map('n', '<Leader>gS', ':Telescope lsp_dynamic_workspace_symbols<Enter>', options)
map('n', '<Leader>gd', ':Telescope lsp_definitions<Enter>', options)
map('n', '<Leader>gr', ':Telescope lsp_references<Enter>', options)
map('n', '<Leader>gs', ':Telescope lsp_workspace_symbols<Enter>', options)
map('n', '<Leader>gS', ':Telescope lsp_dynamic_workspace_symbols<Enter>', options)
map('n', '<Leader>h', ':nohlsearch<Enter>', 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", "{", "<cmd>AerialPrev<CR>", { buffer = bufnr })
--vim.keymap.set("n", "}", "<cmd>AerialNext<CR>", { buffer = bufnr })
end,
})
-- You probably also want to set a keymap to toggle aerial
vim.keymap.set("n", "<leader>a", "<cmd>Telescope aerial<CR>")