Simplify aerial config and update keymaps

This commit is contained in:
Evie Litherland-Smith 2023-01-31 09:06:01 +00:00
parent 4f2739df7f
commit 8b2f535a2e
3 changed files with 12 additions and 21 deletions

View file

@ -1,27 +1,10 @@
local aerial = require('aerial')
aerial.setup {
backends = {
["_"] = { "lsp", "treesitter", "markdown", "man" },
python = { "treesitter" },
},
layout = {
default_direction = "right",
placement = "edge",
},
attach_mode = "global",
highlight_mode = "none",
lazy_load = false,
on_attach = function(bufnr)
-- Toggle the aerial window with <leader>a
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>a', '<cmd>AerialToggle!<CR>', {})
-- Jump forwards/backwards with '{' and '}'
vim.api.nvim_buf_set_keymap(bufnr, 'n', '{', '<cmd>AerialPrev<CR>', {})
vim.api.nvim_buf_set_keymap(bufnr, 'n', '}', '<cmd>AerialNext<CR>', {})
-- Jump up the tree with '[[' or ']]'
vim.api.nvim_buf_set_keymap(bufnr, 'n', '[[', '<cmd>AerialPrevUp<CR>', {})
vim.api.nvim_buf_set_keymap(bufnr, 'n', ']]', '<cmd>AerialNextUp<CR>', {})
end,
open_automatic = false,
close_automatic_events = { "unsupported" },
manage_folds = true,
show_guides = true,
}

View file

@ -10,6 +10,14 @@ require('telescope').setup {
case_mode = "smart_case", -- or "ignore_case" or "respect_case"
-- the default case_mode is "smart_case"
},
aerial = {
show_nesting = {
["_"] = false,
python = true,
json = true,
yaml = true,
},
},
},
defaults = {
mappings = {

View file

@ -14,15 +14,16 @@ vim.g.mapleader = ' '
-- Misc
imap('jk', '<Esc>')
nmap('<leader>hq', '<cmd>Gitsigns setqflist all<cr>')
nmap('<leader>aa', '<cmd>AerialToggle<cr>')
-- Telescope
nmap('<leader>;', '<cmd>Telescope builtin<cr>')
nmap('<leader>ff', '<cmd>Telescope find_files<cr>')
nmap('<leader>fp', '<cmd>Telescope projects<cr>')
nmap('<leader>fa', '<cmd>Telescope aerial<cr>')
nmap('<leader>fd', '<cmd>Telescope lsp_document_symbols<cr>')
nmap('<leader>fl', '<cmd>Telescope lsp_document_symbols<cr>')
nmap('<leader>fe', '<cmd>Telescope diagnostics<cr>')
nmap('<leader>ft', '<cmd>Telescope treesitter<cr>')
nmap('<leader>fs', '<cmd>Telescope treesitter<cr>')
nmap('<leader>fz', '<cmd>Telescope current_buffer_fuzzy_find<cr>')
-- Hop
@ -31,7 +32,6 @@ nmap('<leader>hw', '<cmd>HopWord<cr>')
-- Nvim-tree
nmap('<leader>n', '<cmd>NvimTreeToggle<cr>')
nmap('<leader>s', '<cmd>SidebarNvimToggle<cr>')
-- Trouble
nmap('<leader>xx', '<cmd>TroubleToggle<cr>')