Skip to content
This repository has been archived by the owner on Jul 28, 2024. It is now read-only.

feat: a better default icon: nf-md-hook #33

Merged
merged 1 commit into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 14 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,10 @@ The following configuration is implied when calling `setup` without arguments:
```lua
---@class HarpoonLineConfig
Harpoonline.config = {
-- other nice icons: "󰀱", "", "󱡅", "󰛢"
-- other candidates: "󰀱", "", "󱡅", "󰶳"
-- default: icon nf-md-hook in nerdfont, unicode f06e2:
---@type string
icon = '󰀱', -- An empty string disables showing the icon
icon = '󰛢', -- An empty string disables showing the icon

-- Harpoon:list(), when name is nil, retrieves the default list:
-- default_list_name: Configures the display name for the default list.
Expand Down Expand Up @@ -189,21 +190,21 @@ Scenario's:

Default options: `config.formatter_opts.default`

Output A: :anchor: ` 1 2 3 `
Output A: 󰛢 ` 1 2 3 `

Output B: :anchor: ` 1 [2] 3 `
Output B: 󰛢 ` 1 [2] 3 `

**Note**: Five marks, the fifth mark is the active buffer:

Output B: :anchor: ` 1 2 3 4 […] `
Output B: 󰛢 ` 1 2 3 4 […] `

#### The "short" built-in

Add to the config: `formatter = 'short'`. Default options: `config.formatter_opts.short`

Output A: :anchor: `[3]`
Output A: 󰛢 `[3]`

Output B: :anchor: `[2|3]`
Output B: 󰛢 `[2|3]`

#### Customize a built-in

Expand All @@ -220,9 +221,9 @@ Harpoonline.setup({
})
```

Output A: :anchor: `123`
Output A: 󰛢 `123`

Output B: :anchor: `1[2]3`
Output B: 󰛢 `1[2]3`

#### Use a custom formatter

Expand Down Expand Up @@ -255,9 +256,9 @@ Harpoonline.setup({
})
```

Output A: :anchor: `-`
Output A: 󰛢 `-`

Output B: :anchor: `2`
Output B: 󰛢 `2`

Example "letters":

Expand All @@ -284,9 +285,9 @@ Harpoonline.setup({
})
```

Output A: :anchor: `jkl`
Output A: 󰛢 `jkl`

Output B: :anchor: `jKl`
Output B: 󰛢 `jKl`

*Note*:

Expand Down
5 changes: 3 additions & 2 deletions lua/harpoonline/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ end

---@class HarpoonLineConfig
Harpoonline.config = {
-- other nice icons: "󰀱", "", "󱡅"
-- other candidates: "󰀱", "", "󱡅", "󰶳"
-- default: icon nf-md-hook in nerdfont, unicode f06e2:
---@type string
icon = '󰀱', -- An empty string disables showing the icon
icon = '󰛢', -- An empty string disables showing the icon

-- Harpoon:list(), when name is nil, retrieves the default list:
-- default_list_name: Configures the display name for the default list.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_harpoonline.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ local add_files_to_list = function(names, list_name)
end
end

local icon = '󰀱'
local icon = '󰛢'
local more = '…'

-- ╭─────────────────────────────────────────────────────────╮
Expand Down