switch to kitty-scrollback.nvim

still has problems with ergonomics
This commit is contained in:
Noah Masur 2024-01-30 09:57:38 -07:00
parent 26afa49879
commit fe1a4c2c29
6 changed files with 38 additions and 2 deletions

View File

@ -249,6 +249,22 @@
"type": "github"
}
},
"kitty-scrollback-nvim-src": {
"flake": false,
"locked": {
"lastModified": 1706493612,
"narHash": "sha256-hv3o5k85hBaGk8OBRLP7Rf0O9dxiKot6F7/EQelJHHg=",
"owner": "mikesmithgh",
"repo": "kitty-scrollback.nvim",
"rev": "bb5332b8ec0763b9e611f8cabf4165ed8c3893f5",
"type": "github"
},
"original": {
"owner": "mikesmithgh",
"repo": "kitty-scrollback.nvim",
"type": "github"
}
},
"nextcloud-cookbook": {
"flake": false,
"locked": {
@ -481,6 +497,7 @@
"firefox-darwin": "firefox-darwin",
"hmts-nvim-src": "hmts-nvim-src",
"home-manager": "home-manager",
"kitty-scrollback-nvim-src": "kitty-scrollback-nvim-src",
"nextcloud-cookbook": "nextcloud-cookbook",
"nextcloud-external": "nextcloud-external",
"nextcloud-news": "nextcloud-news",

View File

@ -120,6 +120,10 @@
url = "github:j-hui/fidget.nvim/v1.2.0";
flake = false;
};
kitty-scrollback-nvim-src = {
url = "github:mikesmithgh/kitty-scrollback.nvim";
flake = false;
};
# Tree-Sitter Grammars
tree-sitter-bash = {

View File

@ -45,9 +45,20 @@
# Easy fullscreen toggle (for macOS)
"super+f" = "toggle_fullscreen";
# Kitty scrollback nvim
"kitty_mod+h" = "kitty_scrollback_nvim";
"kitty_mod+g" =
"kitty_scrollback_nvim --config ksb_builtin_last_cmd_output";
};
settings = {
# Required for kitty-scrollback.nvim
allow_remote_control = "socket-only";
listen_on = "unix:/tmp/kitty";
action_alias =
"kitty_scrollback_nvim kitten ${pkgs.kitty-scrollback-nvim}/python/kitty_scrollback_nvim.py";
# Colors (adapted from: https://github.com/kdrag0n/base16-kitty/blob/master/templates/default-256.mustache)
background = config.theme.colors.base00;
foreground = config.theme.colors.base05;

View File

@ -8,6 +8,7 @@
pkgs.vimPlugins.glow-nvim # Markdown preview popup
pkgs.vimPlugins.nvim-colorizer-lua # Hex color previews
pkgs.vimPlugins.which-key-nvim # Keybind helper
pkgs.kitty-scrollback-nvim # Scrollback pager for kitty
];
# Initialize some plugins
@ -15,6 +16,7 @@
setup.colorizer = { user_default_options = { names = false; }; };
setup.glow = { };
setup.which-key = { };
setup.kitty-scrollback = { };
vim.o = {
termguicolors = true; # Set to truecolor

View File

@ -45,8 +45,8 @@ in {
# Requires removing some of the ANSI escape codes that are sent to the
# scrollback using sed and baleia, as well as removing several
# unnecessary features.
programs.kitty.settings.scrollback_pager = ''
$SHELL -c 'sed -r "s/[[:cntrl:]]\]133;[AC]..//g" | ${neovim}/bin/nvim -c "setlocal nonumber norelativenumber nolist laststatus=0" -c "lua baleia = require(\"baleia\").setup({}); baleia.once(0)" -c "map <silent> q :qa!<CR>" -c "autocmd VimEnter * normal G"' '';
programs.kitty.settings.scrollback_pager =
"${neovim}/bin/nvim --headless +'KittyScrollbackGenerateKittens' +'set nonumber' +'set norelativenumber' +'%print' +'quit!' 2>&1";
# Create a desktop option for launching Neovim from a file manager
# (Requires launching the terminal and then executing Neovim)

View File

@ -35,5 +35,7 @@ in {
# Packaging plugins entirely with Nix
baleia-nvim = plugin "baleia-nvim" inputs.baleia-nvim-src;
hmts-nvim = plugin "hmts-nvim" inputs.hmts-nvim-src;
kitty-scrollback-nvim =
plugin "kitty-scrollback-nvim" inputs.kitty-scrollback-nvim-src;
}