https://github.com/letieu/harpoon-lualine
harpoon2 for lualine
https://github.com/letieu/harpoon-lualine
harpoon neovim-plugin nvim nvim-plugin
Last synced: 24 days ago
JSON representation
harpoon2 for lualine
- Host: GitHub
- URL: https://github.com/letieu/harpoon-lualine
- Owner: letieu
- Created: 2024-03-15T05:04:36.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-09-11T07:19:11.000Z (9 months ago)
- Last Synced: 2025-02-28T19:17:09.775Z (3 months ago)
- Topics: harpoon, neovim-plugin, nvim, nvim-plugin
- Language: Lua
- Homepage:
- Size: 74.2 KB
- Stars: 151
- Watchers: 3
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Harpoon Lualine Plugin

**Add a harpoon indicator to your Neovim Lualine!**
## Features
* Shows [Harpoon](https://github.com/ThePrimeagen/harpoon/tree/harpoon2) status in [Lualine](https://github.com/nvim-lualine/lualine.nvim).
> [!IMPORTANT]
> Make sure to install [harpoon2](https://github.com/ThePrimeagen/harpoon/tree/harpoon2) , not harpoon on `master` branch
>## Installation
* With **lazy.nvim**
```lua
{
"letieu/harpoon-lualine",
dependencies = {
{
"ThePrimeagen/harpoon",
branch = "harpoon2",
}
},
}
```
* With **packer.nvim**
```lua
use {
'letieu/harpoon-lualine',
opt = false,
requires = {{'ThePrimeagen/harpoon'}}
}```
## Usage
Add this to your [Lualine](https://github.com/nvim-lualine/lualine.nvim) setup:
```lua
lualine_c = { "harpoon2" },
```**Custom config**
```lua
lualine_c = {
{
"harpoon2",
icon = '♥',
indicators = { "a", "s", "q", "w" },
active_indicators = { "A", "S", "Q", "W" },
color_active = { fg = "#00ff00" },
_separator = " ",
no_harpoon = "Harpoon not loaded",
},
}```
**Use function as indicator**
```lua
-- harpoon_entry = {
-- context = { col = 0, row = 1 },
-- value = "init.lua"
-- }
local function get_harpoon_indicator(harpoon_entry)
return harpoon_entry.value
end-- lualine setup
...
active_indicators = {
get_harpoon_indicator,
get_harpoon_indicator,
get_harpoon_indicator,
get_harpoon_indicator,
},
...
```## How I use harpoon 💡
Bind harpoon mark to `a`, `s`, `q`, `w` and use `Ctrl` + `a`, `s`, `q`, `w` to jump to the mark.
```lua
vim.keymap.set("n", "", function() harpoon:list():select(1) end)
vim.keymap.set("n", "", function() harpoon:list():select(2) end)
vim.keymap.set("n", "", function() harpoon:list():select(3) end)
vim.keymap.set("n", "", function() harpoon:list():select(4) end)
```View current marks with lualine
```lua
lualine_c = {
'%=', -- make the indicator center
{
"harpoon2",
indicators = { "a", "s", "q", "w" },
active_indicators = { "A", "S", "Q", "W" },
_separator = " ",
}
}
```**Enjoy!**
**Note:** Customize indicator characters by editing the configuration.
**Note:** To center the indicator, add a `%=`. For example: `lualine_c = { "%=", "harpoon2"},`
## Contributors ✨
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
Taken
💻
Le Tieu
🚧 🤔
simachri
💻
Patrick Dewey
💻
Owen L.
💻
Nguyen Ngoc Minh Tu
💻
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!