]> Git — Sourcephile - julm/julm-nix.git/blob - home-manager/profiles/nvim/lua/plugins/nvim-navbuddy.lua
+use/op(nvim): tweak config
[julm/julm-nix.git] / home-manager / profiles / nvim / lua / plugins / nvim-navbuddy.lua
1 -- A simple popup display that provides breadcrumbs feature using LSP server
2 -- https://github.com/hasansujon786/nvim-navbuddy
3 return {
4 "nvim-navbuddy",
5 event = "LspAttach",
6 enabled = false,
7 cmd = { "Navbuddy" },
8 after = function()
9 local navbuddy = require("nvim-navbuddy")
10 local actions = require("nvim-navbuddy.actions")
11 navbuddy.setup({
12 window = {
13 border = "single", -- "rounded", "double", "solid", "none"
14 -- or an array with eight chars building up the border in a clockwise fashion
15 -- starting with the top-left corner. eg: { "╔", "═" ,"╗", "║", "╝", "═", "╚", "║" }.
16 size = "60%", -- Or table format example: { height = "40%", width = "100%"}
17 position = "50%", -- Or table format example: { row = "100%", col = "0%"}
18 scrolloff = nil, -- scrolloff value within navbuddy window
19 sections = {
20 left = {
21 size = "20%",
22 border = nil, -- You can set border style for each section individually as well.
23 },
24 mid = {
25 size = "40%",
26 border = nil,
27 },
28 right = {
29 -- No size option for right most section. It fills to
30 -- remaining area.
31 border = nil,
32 preview = "leaf", -- Right section can show previews too.
33 -- Options: "leaf", "always" or "never"
34 },
35 },
36 },
37 node_markers = {
38 enabled = true,
39 icons = {
40 leaf = " ",
41 leaf_selected = " → ",
42 branch = " ",
43 },
44 },
45 icons = {
46 File = "󰈙 ",
47 Module = " ",
48 Namespace = "󰌗 ",
49 Package = " ",
50 Class = "󰌗 ",
51 Method = "󰆧 ",
52 Property = " ",
53 Field = " ",
54 Constructor = " ",
55 Enum = "󰕘",
56 Interface = "󰕘",
57 Function = "󰊕 ",
58 Variable = "󰆧 ",
59 Constant = "󰏿 ",
60 String = " ",
61 Number = "󰎠 ",
62 Boolean = "◩ ",
63 Array = "󰅪 ",
64 Object = "󰅩 ",
65 Key = "󰌋 ",
66 Null = "󰟢 ",
67 EnumMember = " ",
68 Struct = "󰌗 ",
69 Event = " ",
70 Operator = "󰆕 ",
71 TypeParameter = "󰊄 ",
72 },
73 -- If set to false, only mappings set by user are set.
74 -- Else default mappings are used for keys that are not set by user
75 use_default_mappings = true,
76 mappings = {
77 ["<esc>"] = actions.close(), -- Close and cursor to original location
78 ["q"] = actions.close(),
79
80 ["j"] = actions.next_sibling(), -- down
81 ["k"] = actions.previous_sibling(), -- up
82
83 ["h"] = actions.parent(), -- Move to left panel
84 ["l"] = actions.children(), -- Move to right panel
85 ["0"] = actions.root(), -- Move to first panel
86
87 ["v"] = actions.visual_name(), -- Visual selection of name
88 ["V"] = actions.visual_scope(), -- Visual selection of scope
89
90 ["y"] = actions.yank_name(), -- Yank the name to system clipboard "+
91 ["Y"] = actions.yank_scope(), -- Yank the scope to system clipboard "+
92
93 ["i"] = actions.insert_name(), -- Insert at start of name
94 ["I"] = actions.insert_scope(), -- Insert at start of scope
95
96 ["a"] = actions.append_name(), -- Insert at end of name
97 ["A"] = actions.append_scope(), -- Insert at end of scope
98
99 ["r"] = actions.rename(), -- Rename currently focused symbol
100
101 ["d"] = actions.delete(), -- Delete scope
102
103 ["f"] = actions.fold_create(), -- Create fold of current scope
104 ["F"] = actions.fold_delete(), -- Delete fold of current scope
105
106 ["c"] = actions.comment(), -- Comment out current scope
107
108 ["<enter>"] = actions.select(), -- Goto selected symbol
109 ["o"] = actions.select(),
110
111 ["J"] = actions.move_down(), -- Move focused node down
112 ["K"] = actions.move_up(), -- Move focused node up
113
114 ["s"] = actions.toggle_preview(), -- Show preview of current node
115
116 ["<C-v>"] = actions.vsplit(), -- Open selected node in a vertical split
117 ["<C-s>"] = actions.hsplit(), -- Open selected node in a horizontal split
118
119 ["t"] = actions.telescope({ -- Fuzzy finder at current level.
120 layout_config = { -- All options that can be
121 height = 0.60, -- passed to telescope.nvim's
122 width = 0.60, -- default can be passed here.
123 prompt_position = "top",
124 preview_width = 0.50,
125 },
126 layout_strategy = "horizontal",
127 }),
128
129 ["g?"] = actions.help(), -- Open mappings help window
130 },
131 lsp = {
132 auto_attach = true, -- If set to true, you don't need to manually use attach function
133 preference = nil, -- list of lsp server names in order of preference
134 },
135 source_buffer = {
136 follow_node = true, -- Keep the current node in focus on the source buffer
137 highlight = true, -- Highlight the currently focused node
138 reorient = "smart", -- "smart", "top", "mid" or "none"
139 scrolloff = nil, -- scrolloff value when navbuddy is open
140 },
141 custom_hl_group = nil, -- "Visual" or any other hl group to use instead of inverted colors
142 })
143 end,
144 }