{"id":16587568,"url":"https://github.com/smiteshp/nvim-navbuddy","last_synced_at":"2025-04-12T15:33:08.639Z","repository":{"id":147933935,"uuid":"616430695","full_name":"SmiteshP/nvim-navbuddy","owner":"SmiteshP","description":"A simple popup display that provides breadcrumbs feature using LSP server","archived":false,"fork":false,"pushed_at":"2024-07-19T02:05:52.000Z","size":134,"stargazers_count":786,"open_issues_count":25,"forks_count":30,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-10-12T22:54:32.862Z","etag":null,"topics":["document-symbols","language-server-protocol","lsp","lua","neovim","neovim-plugin","nvim"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SmiteshP.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"SmiteshP"}},"created_at":"2023-03-20T11:28:42.000Z","updated_at":"2024-10-12T07:46:01.000Z","dependencies_parsed_at":"2024-10-26T04:53:23.678Z","dependency_job_id":"45ad1f55-4764-4048-bac9-d4d9ec08eb4f","html_url":"https://github.com/SmiteshP/nvim-navbuddy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SmiteshP%2Fnvim-navbuddy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SmiteshP%2Fnvim-navbuddy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SmiteshP%2Fnvim-navbuddy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SmiteshP%2Fnvim-navbuddy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SmiteshP","download_url":"https://codeload.github.com/SmiteshP/nvim-navbuddy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248589875,"owners_count":21129693,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["document-symbols","language-server-protocol","lsp","lua","neovim","neovim-plugin","nvim"],"created_at":"2024-10-11T22:54:31.652Z","updated_at":"2025-04-12T15:33:08.614Z","avatar_url":"https://github.com/SmiteshP.png","language":"Lua","funding_links":["https://github.com/sponsors/SmiteshP"],"categories":[],"sub_categories":[],"readme":"# 🗺️ nvim-navbuddy\n\nA simple popup display that provides breadcrumbs like navigation feature but\nin keyboard centric manner inspired by ranger file manager.\n\nhttps://user-images.githubusercontent.com/43147494/227758807-13a614ff-a09d-4be0-8f6b-ac22f814ce6f.mp4\n\n## ⚡️ Requirements\n\n* Neovim \u003e= 0.8.0\n* [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig)\n* [nvim-navic](https://github.com/SmiteshP/nvim-navic)\n* [nui.nvim](https://github.com/MunifTanjim/nui.nvim)\n\n## 📦 Installation\n\nInstall the plugin with your preferred package manager:\n\n### [packer](https://github.com/wbthomason/packer.nvim)\n\n```lua\nuse {\n    \"SmiteshP/nvim-navbuddy\",\n    requires = {\n        \"neovim/nvim-lspconfig\",\n        \"SmiteshP/nvim-navic\",\n        \"MunifTanjim/nui.nvim\",\n        \"numToStr/Comment.nvim\",        -- Optional\n        \"nvim-telescope/telescope.nvim\" -- Optional\n    }\n}\n```\n\n### [vim-plug](https://github.com/junegunn/vim-plug)\n\n```vim\nPlug \"neovim/nvim-lspconfig\"\nPlug \"SmiteshP/nvim-navic\"\nPlug \"MunifTanjim/nui.nvim\"\nPlug \"numToStr/Comment.nvim\",        \" Optional\nPlug \"nvim-telescope/telescope.nvim\" \" Optional\nPlug \"SmiteshP/nvim-navbuddy\"\n```\n\n### Lazy Loading\n\nIf you want to lazy load navbuddy you need to load it before your Lsp related Stuff.\n\nFor Example with [Lazy](https://github.com/folke/lazy.nvim) and [lspconfig](https://github.com/neovim/nvim-lspconfig)\n\n```lua\nreturn {\n    \"neovim/nvim-lspconfig\",\n    dependencies = {\n        {\n            \"SmiteshP/nvim-navbuddy\",\n            dependencies = {\n                \"SmiteshP/nvim-navic\",\n                \"MunifTanjim/nui.nvim\"\n            },\n            opts = { lsp = { auto_attach = true } }\n        }\n    },\n    -- your lsp config or other stuff\n}\n```\n\n## ⚙️ Setup\n\nnvim-navbuddy needs to be attached to lsp servers of the buffer to work. You can pass the\nnavbuddy's `attach` function as `on_attach` while setting up the lsp server. You can skip this\nstep if you have enabled `auto_attach` option in setup function.\n\nExample:\n```lua\nlocal navbuddy = require(\"nvim-navbuddy\")\n\nrequire(\"lspconfig\").clangd.setup {\n    on_attach = function(client, bufnr)\n        navbuddy.attach(client, bufnr)\n    end\n}\n```\n\n## 🪄 Customise\n\nUse `setup` to override any of the default options\n\n* `icons` : Indicate the type of symbol captured. Default icons assume you have nerd-fonts.\n* `node_markers` : Indicate whether a node is a leaf or branch node. Default icons assume you have nerd-fonts.\n* `window` : Set options related to window's \"border\", \"size\", \"position\".\n* `use_default_mappings`: If set to false, only mappings set by user are set. Else default mappings are used for keys that are not set by user.\n* `mappings` : Actions to be triggered for specified keybindings. For each keybinding it takes a table of format { callback = \u003cfunction_to_be_called\u003e, description = \"string\"}. The callback function takes the \"display\" object as an argument.\n* `lsp` :\n    * `auto_attach` : Enable to have Navbuddy automatically attach to every LSP for current buffer. Its disabled by default.\n    * `preference` : Table ranking lsp_servers. Lower the index, higher the priority of the server. If there are more than one server attached to a buffer, navbuddy will refer to this list to make a decision on which one to use. for example - In case a buffer is attached to clangd and ccls both and the preference list is `{ \"clangd\", \"pyright\" }`. Then clangd will be prefered.\n* `source_buffer` :\n    * `follow_node` : Keep the current node in focus on the source buffer\n    * `highlight` : Highlight the currently focused node\n    * reorient: Reorient buffer after changing nodes. options are \"smart\", \"top\", \"mid\" or \"none\"\n\n```lua\nlocal navbuddy = require(\"nvim-navbuddy\")\nlocal actions = require(\"nvim-navbuddy.actions\")\n\nnavbuddy.setup {\n    window = {\n        border = \"single\",  -- \"rounded\", \"double\", \"solid\", \"none\"\n                            -- or an array with eight chars building up the border in a clockwise fashion\n                            -- starting with the top-left corner. eg: { \"╔\", \"═\" ,\"╗\", \"║\", \"╝\", \"═\", \"╚\", \"║\" }.\n        size = \"60%\",       -- Or table format example: { height = \"40%\", width = \"100%\"}\n        position = \"50%\",   -- Or table format example: { row = \"100%\", col = \"0%\"}\n        scrolloff = nil,    -- scrolloff value within navbuddy window\n        sections = {\n            left = {\n                size = \"20%\",\n                border = nil, -- You can set border style for each section individually as well.\n            },\n            mid = {\n                size = \"40%\",\n                border = nil,\n            },\n            right = {\n                -- No size option for right most section. It fills to\n                -- remaining area.\n                border = nil,\n                preview = \"leaf\",  -- Right section can show previews too.\n                                   -- Options: \"leaf\", \"always\" or \"never\"\n            }\n        },\n    },\n    node_markers = {\n        enabled = true,\n        icons = {\n            leaf = \"  \",\n            leaf_selected = \" → \",\n            branch = \" \",\n        },\n    },\n    icons = {\n        File          = \"󰈙 \",\n        Module        = \" \",\n        Namespace     = \"󰌗 \",\n        Package       = \" \",\n        Class         = \"󰌗 \",\n        Method        = \"󰆧 \",\n        Property      = \" \",\n        Field         = \" \",\n        Constructor   = \" \",\n        Enum          = \"󰕘\",\n        Interface     = \"󰕘\",\n        Function      = \"󰊕 \",\n        Variable      = \"󰆧 \",\n        Constant      = \"󰏿 \",\n        String        = \" \",\n        Number        = \"󰎠 \",\n        Boolean       = \"◩ \",\n        Array         = \"󰅪 \",\n        Object        = \"󰅩 \",\n        Key           = \"󰌋 \",\n        Null          = \"󰟢 \",\n        EnumMember    = \" \",\n        Struct        = \"󰌗 \",\n        Event         = \" \",\n        Operator      = \"󰆕 \",\n        TypeParameter = \"󰊄 \",\n    },\n    use_default_mappings = true,            -- If set to false, only mappings set\n                                            -- by user are set. Else default\n                                            -- mappings are used for keys\n                                            -- that are not set by user\n    mappings = {\n        [\"\u003cesc\u003e\"] = actions.close(),        -- Close and cursor to original location\n        [\"q\"] = actions.close(),\n\n        [\"j\"] = actions.next_sibling(),     -- down\n        [\"k\"] = actions.previous_sibling(), -- up\n\n        [\"h\"] = actions.parent(),           -- Move to left panel\n        [\"l\"] = actions.children(),         -- Move to right panel\n        [\"0\"] = actions.root(),             -- Move to first panel\n\n        [\"v\"] = actions.visual_name(),      -- Visual selection of name\n        [\"V\"] = actions.visual_scope(),     -- Visual selection of scope\n\n        [\"y\"] = actions.yank_name(),        -- Yank the name to system clipboard \"+\n        [\"Y\"] = actions.yank_scope(),       -- Yank the scope to system clipboard \"+\n\n        [\"i\"] = actions.insert_name(),      -- Insert at start of name\n        [\"I\"] = actions.insert_scope(),     -- Insert at start of scope\n\n        [\"a\"] = actions.append_name(),      -- Insert at end of name\n        [\"A\"] = actions.append_scope(),     -- Insert at end of scope\n\n        [\"r\"] = actions.rename(),           -- Rename currently focused symbol\n\n        [\"d\"] = actions.delete(),           -- Delete scope\n\n        [\"f\"] = actions.fold_create(),      -- Create fold of current scope\n        [\"F\"] = actions.fold_delete(),      -- Delete fold of current scope\n\n        [\"c\"] = actions.comment(),          -- Comment out current scope\n\n        [\"\u003center\u003e\"] = actions.select(),     -- Goto selected symbol\n        [\"o\"] = actions.select(),\n\n        [\"J\"] = actions.move_down(),        -- Move focused node down\n        [\"K\"] = actions.move_up(),          -- Move focused node up\n\n        [\"s\"] = actions.toggle_preview(),   -- Show preview of current node\n\n        [\"\u003cC-v\u003e\"] = actions.vsplit(),       -- Open selected node in a vertical split\n        [\"\u003cC-s\u003e\"] = actions.hsplit(),       -- Open selected node in a horizontal split\n\n        [\"t\"] = actions.telescope({         -- Fuzzy finder at current level.\n            layout_config = {               -- All options that can be\n                height = 0.60,              -- passed to telescope.nvim's\n                width = 0.60,               -- default can be passed here.\n                prompt_position = \"top\",\n                preview_width = 0.50\n            },\n            layout_strategy = \"horizontal\"\n        }),\n\n        [\"g?\"] = actions.help(),            -- Open mappings help window\n    },\n    lsp = {\n        auto_attach = false,   -- If set to true, you don't need to manually use attach function\n        preference = nil,      -- list of lsp server names in order of preference\n    },\n    source_buffer = {\n        follow_node = true,    -- Keep the current node in focus on the source buffer\n        highlight = true,      -- Highlight the currently focused node\n        reorient = \"smart\",    -- \"smart\", \"top\", \"mid\" or \"none\"\n        scrolloff = nil        -- scrolloff value when navbuddy is open\n    },\n\tcustom_hl_group = nil,     -- \"Visual\" or any other hl group to use instead of inverted colors\n}\n```\n\n## 🚀 Usage\n\n`Navbuddy` command can be used to open navbuddy.\n\n```\n:Navbuddy\n```\n\nAnd alternatively lua function `open` can also be used to open navbuddy.\n\n```\n:lua require(\"nvim-navbuddy\").open()\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmiteshp%2Fnvim-navbuddy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmiteshp%2Fnvim-navbuddy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmiteshp%2Fnvim-navbuddy/lists"}