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') local aerial = require('aerial')
aerial.setup { aerial.setup {
backends = {
["_"] = { "lsp", "treesitter", "markdown", "man" },
python = { "treesitter" },
},
layout = { layout = {
default_direction = "right",
placement = "edge", placement = "edge",
}, },
attach_mode = "global", attach_mode = "global",
highlight_mode = "none", highlight_mode = "none",
lazy_load = false, manage_folds = true,
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" },
show_guides = true, show_guides = true,
} }

View file

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

View file

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