2020-09-20 00:59:51 +02:00
|
|
|
# aerial.nvim
|
2021-06-16 17:48:32 +02:00
|
|
|
A code outline window for skimming and quick navigation
|
2020-09-20 02:29:26 +02:00
|
|
|
|
2021-06-17 04:22:57 +02:00
|
|
|
![Screenshot from 2021-06-16 19-05-43](https://user-images.githubusercontent.com/506791/122320750-9cddbc80-ced7-11eb-937e-90eed107f94e.png)
|
|
|
|
![Screenshot from 2021-06-16 19-17-00](https://user-images.githubusercontent.com/506791/122320760-9ea78000-ced7-11eb-8982-3d051992e91f.png)
|
2020-09-20 02:29:26 +02:00
|
|
|
|
|
|
|
## Requirements
|
|
|
|
Neovim 0.5 (nightly)
|
|
|
|
|
|
|
|
It's powered by LSP, so you'll need to have that already set up and working.
|
|
|
|
|
|
|
|
## Installation
|
|
|
|
aerial.nvim works with [Pathogen](https://github.com/tpope/vim-pathogen)
|
|
|
|
|
|
|
|
```sh
|
|
|
|
cd ~/.vim/bundle/
|
|
|
|
git clone https://github.com/stevearc/aerial.nvim
|
|
|
|
```
|
|
|
|
|
|
|
|
and [vim-plug](https://github.com/junegunn/vim-plug)
|
|
|
|
|
|
|
|
```vim
|
|
|
|
Plug 'stevearc/aerial.nvim'
|
|
|
|
```
|
|
|
|
|
|
|
|
## Configuration
|
|
|
|
|
|
|
|
Step one is to get a Neovim LSP set up, which is beyond the scope of this guide.
|
|
|
|
See [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig) for instructions.
|
|
|
|
|
|
|
|
After you have a functioning LSP setup, you will need to customize the
|
|
|
|
`on_attach` callback.
|
|
|
|
|
|
|
|
```lua
|
|
|
|
local aerial = require'aerial'
|
|
|
|
|
|
|
|
local custom_attach = function(client)
|
|
|
|
aerial.on_attach(client)
|
|
|
|
|
|
|
|
-- Aerial does not set any mappings by default, so you'll want to set some up
|
2021-06-16 18:18:12 +02:00
|
|
|
-- Toggle the aerial window with <leader>a
|
2021-06-17 04:22:57 +02:00
|
|
|
vim.api.nvim_buf_set_keymap(0, 'n', '<leader>a', '<cmd>lua require"aerial".toggle()<CR>', {})
|
2020-09-20 02:29:26 +02:00
|
|
|
-- Jump forwards/backwards with '[[' and ']]'
|
2021-06-17 04:22:57 +02:00
|
|
|
vim.api.nvim_buf_set_keymap(0, 'n', '[[', '<cmd>lua require"aerial".prev_item()<CR>zvzz', {})
|
|
|
|
vim.api.nvim_buf_set_keymap(0, 'v', '[[', '<cmd>lua require"aerial".prev_item()<CR>zvzz', {})
|
|
|
|
vim.api.nvim_buf_set_keymap(0, 'n', ']]', '<cmd>lua require"aerial".next_item()<CR>zvzz', {})
|
|
|
|
vim.api.nvim_buf_set_keymap(0, 'v', ']]', '<cmd>lua require"aerial".next_item()<CR>zvzz', {})
|
2020-09-20 02:29:26 +02:00
|
|
|
|
|
|
|
-- This is a great place to set up all your other LSP mappings
|
|
|
|
end
|
|
|
|
|
|
|
|
-- Set up your LSP clients here, using the custom on_attach method
|
2020-12-06 05:30:55 +01:00
|
|
|
require'lspconfig'.vimls.setup{
|
2020-09-20 02:29:26 +02:00
|
|
|
on_attach = custom_attach,
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
A full list of commands and options can be found [in the
|
|
|
|
docs](https://github.com/stevearc/aerial.nvim/blob/master/doc/aerial.txt)
|
2021-06-17 03:55:09 +02:00
|
|
|
|
|
|
|
The default keybindings in the aerial window are [in the
|
|
|
|
ftplugin](https://github.com/stevearc/aerial.nvim/blob/master/ftplugin/aerial.vim)
|