From e0e3ef2dc948bc9211a939d3afcef621ddcc48b8 Mon Sep 17 00:00:00 2001 From: Mike <10135646+mikesmithgh@users.noreply.github.com> Date: Tue, 12 Dec 2023 21:44:58 -0500 Subject: [PATCH] feat!: set default icon to new nvim icon (#80) 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). --- README.md | 30 +++--------------------------- doc/kitty-scrollback.nvim.txt | 20 +++----------------- lua/kitty-scrollback/launch.lua | 2 +- python/loading.py | 2 +- tests/kitty-scrollback/helpers.lua | 4 ++-- 5 files changed, 10 insertions(+), 48 deletions(-) diff --git a/README.md b/README.md index 83c717c8..0b61b3ed 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,9 @@ Navigate your Kitty scrollback buffer to quickly search, copy, and execute comma + ## 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. @@ -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, -> }) -> ``` - - Status window with Nerd Fonts v3.1.0+ opts.status_window.icons.nvim = '' opts.status_window.style_simple = false diff --git a/doc/kitty-scrollback.nvim.txt b/doc/kitty-scrollback.nvim.txt index 0e920dc4..8b2eac76 100644 --- a/doc/kitty-scrollback.nvim.txt +++ b/doc/kitty-scrollback.nvim.txt @@ -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| @@ -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 . 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 @@ -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 - - 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., diff --git a/lua/kitty-scrollback/launch.lua b/lua/kitty-scrollback/launch.lua index cd6d3fb0..f91d9ea6 100644 --- a/lua/kitty-scrollback/launch.lua +++ b/lua/kitty-scrollback/launch.lua @@ -124,7 +124,7 @@ local default_opts = { icons = { kitty = '󰄛', heart = '󰣐', -- variants 󰣐 |  |  | ♥ |  | 󱢠 |  - nvim = '', -- variants  |  |  |  + nvim = '', -- variants  |  |  |  }, }, paste_window = { diff --git a/python/loading.py b/python/loading.py index 75705238..87d3d11d 100755 --- a/python/loading.py +++ b/python/loading.py @@ -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 diff --git a/tests/kitty-scrollback/helpers.lua b/tests/kitty-scrollback/helpers.lua index f419321c..ddd58251 100644 --- a/tests/kitty-scrollback/helpers.lua +++ b/tests/kitty-scrollback/helpers.lua @@ -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))