https://github.com/ycm/harpy
(deprecated, use poplar.vim instead)
https://github.com/ycm/harpy
vim vim9
Last synced: 10 months ago
JSON representation
(deprecated, use poplar.vim instead)
- Host: GitHub
- URL: https://github.com/ycm/harpy
- Owner: ycm
- License: mit
- Created: 2024-12-05T12:52:57.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-12-21T11:34:57.000Z (about 1 year ago)
- Last Synced: 2025-03-31T11:21:51.817Z (12 months ago)
- Topics: vim, vim9
- Language: Vim Script
- Homepage:
- Size: 1.04 MB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
### Deprecated!
[poplar.vim](https://github.com/ycm/poplar.vim) is better and includes a filetree.
harpy
A small set of harpoon-like features for my personal use case.

(gif made with [asciinema](https://asciinema.org/))
Unlike harpoon, harpy's menu is not a regular text buffer - as such, harpy does not permit text-editing commands like inserting text, `dd`, etc. To hopefully offset this limitation, some basic menu management functionality is offered with customizable keys. On the other hand, this also means no need to `:w` to save the menu, and the menu can 'remember' the cursor position, show some more info, etc.
## Setup
Requires Vim 9+.
[vim-plug](https://github.com/junegunn/vim-plug):
```vim
Plug 'ycm/harpy'
```
Manual installation:
```
mkdir -p ~/.vim/pack/ycm/start && cd ~/.vim/pack/ycm/start
git clone https://github.com/ycm/harpy.git
vim -u NONE -c "helptags harpy/doc" -c q
```
Note: `set autochdir` is not recommended, since harpy stores its filelist in the cwd. This also means you might want to `ignore` the filelist in your project.
```bash
echo ".harpylist" >> .gitignore
```
## Configs
**Sample mappings**
```vim
nnoremap ll :Harpy
nnoremap la :HarpyAdd
```
**Default options**
```vim
g:harpy_opts = {
file_name: '.harpylist',
min_width: 40,
pointer: ' > ',
no_pointer: ' ',
keys_down: ['j', ''],
keys_up: ['k', ''],
keys_move_down: ['J'],
keys_move_up: ['K'],
keys_open: ['', ''],
keys_open_in_tab: ['t'],
keys_clear_not_found: ['D'],
keys_remove_entry: ['X'],
keys_split_top: ['S'],
keys_split_bottom: ['s'],
keys_split_left: ['V'],
keys_split_right: ['v'],
keys_toggle_help: ['h']
}
```
To set custom options, add a global dictionary called `g:harpy_user_opts`. This
dictionary is loaded when you first run `:Harpy` or `:HarpyAdd`. If you modify
these configs after using harpy, you should restart Vim for the changes to take
effect.
```vim
vim9script
g:harpy_user_opts = {
keys_up: ['k', 'l'],
pointer: '>',
no_pointer: ' ',
min_width: 70
}
```
**Colors**
Harpy also comes with these highlight links:
```vim
HarpyEntry -> Normal
HarpyEntryFile -> Identifier
HarpyEntrySelected -> Normal
HarpyEntrySelectedFile -> Identifier
HarpyFileNotFound -> Removed
HarpyHelpText -> Comment
HarpyMenuBg -> PMenu
HarpyMenuBorder -> PMenu
```
You can play around with these as you would any other highlight group.