mirror of
https://github.com/cap153/nvim.git
synced 2026-05-09 08:12:29 +08:00
添加大纲插件
This commit is contained in:
parent
35ccbebb91
commit
d9ba9d85fb
8 changed files with 105 additions and 43 deletions
55
lua/pack/configs/outline.lua
Normal file
55
lua/pack/configs/outline.lua
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
-- === outline大纲 ===
|
||||
if vim.g.vscode then return end
|
||||
|
||||
local P = {
|
||||
name = "outline.nvim",
|
||||
}
|
||||
|
||||
vim.keymap.set({ "n", "x" }, "<leader>v", function()
|
||||
PackUtils.load(P, function()
|
||||
require("outline").setup({
|
||||
outline_window = {
|
||||
position = "left",
|
||||
width = 20,
|
||||
},
|
||||
keymaps = {
|
||||
show_help = "?",
|
||||
close = { "<Esc>", "q" },
|
||||
-- Jump to symbol under cursor.
|
||||
-- It can auto close the outline window when triggered, see
|
||||
-- 'auto_close' option above.
|
||||
goto_location = "<Cr>",
|
||||
-- Jump to symbol under cursor but keep focus on outline window.
|
||||
peek_location = "o",
|
||||
-- Visit location in code and close outline immediately
|
||||
goto_and_close = "<S-Cr>",
|
||||
-- Change cursor position of outline window to match current location in code.
|
||||
-- 'Opposite' of goto/peek_location.
|
||||
restore_location = "<C-g>",
|
||||
-- Open LSP/provider-dependent symbol hover information
|
||||
hover_symbol = "<C-space>",
|
||||
-- Preview location code of the symbol under cursor
|
||||
toggle_preview = "K",
|
||||
rename_symbol = "r",
|
||||
code_actions = "a",
|
||||
-- These fold actions are collapsing tree nodes, not code folding
|
||||
fold = "n",
|
||||
unfold = "i",
|
||||
fold_toggle = "<Tab>",
|
||||
-- Toggle folds for all nodes.
|
||||
-- If at least one node is folded, this action will fold all nodes.
|
||||
-- If all nodes are folded, this action will unfold all nodes.
|
||||
fold_toggle_all = "<S-Tab>",
|
||||
fold_all = "N",
|
||||
unfold_all = "I",
|
||||
fold_reset = "R",
|
||||
-- Move down/up by one line and peek_location immediately.
|
||||
-- You can also use outline_window.auto_jump=true to do this for any
|
||||
-- j/k/<down>/<up>.
|
||||
down_and_jump = "<C-e>",
|
||||
up_and_jump = "<C-u>",
|
||||
},
|
||||
})
|
||||
end)
|
||||
vim.cmd("Outline")
|
||||
end, { desc = "Toggle outline" })
|
||||
Loading…
Add table
Add a link
Reference in a new issue