Skip to content

Commit

Permalink
feat!: set default icon to new nvim icon (#80)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: The Neovim icon is now the default icon in the status window. Update your Nerd Font to the latest version or at least version [v3.1.0](https://github.com/ryanoasis/nerd-fonts/releases/tag/v3.1.0).
  • Loading branch information
mikesmithgh committed Dec 28, 2023
1 parent c1929da commit e0e3ef2
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 48 deletions.
30 changes: 3 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ Navigate your Kitty scrollback buffer to quickly search, copy, and execute comma

<!-- panvimdoc-ignore-end -->

## Neovim Nerd Font Icon
- The Neovim icon is now the default icon in the status window. Update your Nerd Font to the latest version or at least version [v3.1.0](https://github.com/ryanoasis/nerd-fonts/releases/tag/v3.1.0).

## Highlight Groups

- Existing highlight groups were renamed. If you were overriding any kitty-scrollback.nvim highlight groups, please update the names referencing the table below.
Expand Down Expand Up @@ -327,33 +330,6 @@ Arguments that can be passed to the `kitty_scrollback_nvim` Kitten defined in [k
By default, `kitty-scrollback.nvim` uses [Nerd Fonts](https://www.nerdfonts.com) in the status window. If you would like to
use ASCII instead, set the option `status_window.style_simple` to `true`.

> [!NOTE]\
> Nerd Fonts release v3.1.0 added the Neovim icon! See **ksb_example_status_win_nvim** in [Advanced Configuration](https://github.com/mikesmithgh/kitty-scrollback.nvim/wiki/Advanced-Configuration) for a demo and example configuration.
>
> *The following example configuration sets a global kitty-scrollback.nvim configuration to use the neovim icon instead of vim icon*
>
> **kitty.conf**
> ```kitty
> action_alias kitty_scrollback_nvim kitten /Users/mike/gitrepos/kitty-scrollback.nvim/python/kitty_scrollback_nvim.py --nvim-args -u kitty-scrollback-nvim-kitten-config.lua
> ```
>
> **kitty-scrollback-nvim-kitten-config.lua**
> ```lua
> -- I am still working on a better experience for configuring kitty-scrollback.nvim, but this works for now
> vim.opt.runtimepath:append(vim.fn.stdpath('data') .. '/lazy/kitty-scrollback.nvim') -- assuming lazy.nvim setup
> require('kitty-scrollback').setup({
> global = function()
> return {
> status_window = {
> icons = {
> nvim = '',
> },
> },
> }
> end,
> })
> ```
<!-- panvimdoc-ignore-start -->

- Status window with Nerd Fonts <code>v3.1.0+</code> <code>opts.status_window.icons.nvim = ''</code> <code>opts.status_window.style_simple = false</code>
Expand Down
20 changes: 3 additions & 17 deletions doc/kitty-scrollback.nvim.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Table of Contents *kitty-scrollback.nvim-table-of-contents*

1. kitty-scrollback.nvim |kitty-scrollback.nvim-kitty-scrollback.nvim|
- Migrating to v3.0.0 |kitty-scrollback.nvim-migrating-to-v3.0.0|
- Neovim Nerd Font Icon |kitty-scrollback.nvim-neovim-nerd-font-icon|
- Highlight Groups |kitty-scrollback.nvim-highlight-groups|
- Features |kitty-scrollback.nvim-features|
- Example use cases |kitty-scrollback.nvim-example-use-cases|
Expand Down Expand Up @@ -36,6 +37,8 @@ MIGRATING TO V3.0.0 *kitty-scrollback.nvim-migrating-to-v3.0.0*
kitty-scrollback.nvim

`-` `Migration Steps`
NEOVIM NERD FONT ICON *kitty-scrollback.nvim-neovim-nerd-font-icon*
- The Neovim icon is now the default icon in the status window. Update your Nerd Font to the latest version or at least version v3.1.0 <https://github.com/ryanoasis/nerd-fonts/releases/tag/v3.1.0>.
HIGHLIGHT GROUPS *kitty-scrollback.nvim-highlight-groups*
- Existing highlight groups were renamed. If you were overriding any
kitty-scrollback.nvim highlight groups, please update the names referencing the
Expand Down Expand Up @@ -407,23 +410,6 @@ in the status window. If you would like to use ASCII instead, set the option
`status_window.style_simple` to `true`.


`ℹ` `NOTE`
Nerd Fonts release v3.1.0 added the Neovim icon! See
**ksb_example_status_win_nvim** in Advanced Configuration
<https://github.com/mikesmithgh/kitty-scrollback.nvim/wiki/Advanced-Configuration>
for a demo and example configuration.
_The following example configuration sets a global kitty-scrollback.nvim
configuration to use the neovim icon instead of vim icon_
**kitty.conf** `kitty action_alias kitty_scrollback_nvim kitten
/Users/mike/gitrepos/kitty-scrollback.nvim/python/kitty_scrollback_nvim.py
--nvim-args -u kitty-scrollback-nvim-kitten-config.lua`
**kitty-scrollback-nvim-kitten-config.lua** `lua -- I am still working on a
better experience for configuring kitty-scrollback.nvim, but this works for now
vim.opt.runtimepath:append(vim.fn.stdpath('data') ..
'/lazy/kitty-scrollback.nvim') -- assuming lazy.nvim setup
require('kitty-scrollback').setup({ global = function() return { status_window
= { icons = { nvim = '', }, }, } end, })`

COMMANDS AND LUA API *kitty-scrollback.nvim-commands-and-lua-api*

The API is available via the `kitty-scrollback.api` module. e.g.,
Expand Down
2 changes: 1 addition & 1 deletion lua/kitty-scrollback/launch.lua
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ local default_opts = {
icons = {
kitty = '󰄛',
heart = '󰣐', -- variants 󰣐 |  |  | ♥ |  | 󱢠 | 
nvim = '', -- variants  |  |  | 
nvim = '', -- variants  |  |  | 
},
},
paste_window = {
Expand Down
2 changes: 1 addition & 1 deletion python/loading.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def env_to_fg_color(name):

kitty_icon = os.environ.get('KITTY_SCROLLBACK_NVIM_KITTY_ICON', '󰄛')
heart_icon = os.environ.get('KITTY_SCROLLBACK_NVIM_HEART_ICON', '󰣐')
nvim_icon = os.environ.get('KITTY_SCROLLBACK_NVIM_NVIM_ICON', '')
nvim_icon = os.environ.get('KITTY_SCROLLBACK_NVIM_NVIM_ICON', '')

kitty = kitty_color + kitty_icon + reset
heart = heart_color + heart_icon + reset
Expand Down
4 changes: 2 additions & 2 deletions tests/kitty-scrollback/helpers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -436,8 +436,8 @@ local function debug_print_differences(actual, expected)
end

M.with_status_win = function(scrollback_buffer, width, status_win)
width = width or 114
status_win = status_win or '󰄛 󰣐 '
width = width or 89
status_win = status_win or '󰄛 󰣐 '
local _, _, first_line, rest = scrollback_buffer:find('(.-)\n(.*)')
local first_line_with_status_win = first_line
.. string.rep(' ', width - (#first_line + #status_win))
Expand Down

0 comments on commit e0e3ef2

Please sign in to comment.