From 52b86efbb1385029a059e7ae7dc6df67f15f965b Mon Sep 17 00:00:00 2001 From: Noah Masur <7386960+nmasur@users.noreply.github.com> Date: Tue, 18 Jul 2023 23:36:09 -0400 Subject: [PATCH] kitty tweaks, fix scrollback character issues --- flake.lock | 17 +++++++++++++++++ flake.nix | 4 ++++ modules/common/applications/firefox.nix | 1 + modules/common/applications/kitty.nix | 7 ++++++- modules/common/neovim/config/syntax.nix | 1 + modules/common/neovim/default.nix | 4 ++-- modules/common/shell/utilities.nix | 4 ---- overlays/neovim-plugins.nix | 17 ++++++++--------- 8 files changed, 39 insertions(+), 16 deletions(-) diff --git a/flake.lock b/flake.lock index 4152159..31bb1df 100644 --- a/flake.lock +++ b/flake.lock @@ -17,6 +17,22 @@ "type": "github" } }, + "baleia-nvim-src": { + "flake": false, + "locked": { + "lastModified": 1681806450, + "narHash": "sha256-jxRlIzWbnSj89032msc5w+2TVt7zVyzlxdXxiH1dQqY=", + "owner": "m00qek", + "repo": "baleia.nvim", + "rev": "00bb4af31c8c3865b735d40ebefa6c3f07b2dd16", + "type": "github" + }, + "original": { + "owner": "m00qek", + "repo": "baleia.nvim", + "type": "github" + } + }, "bufferline-nvim-src": { "flake": false, "locked": { @@ -395,6 +411,7 @@ "root": { "inputs": { "Comment-nvim-src": "Comment-nvim-src", + "baleia-nvim-src": "baleia-nvim-src", "bufferline-nvim-src": "bufferline-nvim-src", "cmp-nvim-lsp-src": "cmp-nvim-lsp-src", "darwin": "darwin", diff --git a/flake.nix b/flake.nix index e2c04fb..039b58a 100644 --- a/flake.nix +++ b/flake.nix @@ -75,6 +75,10 @@ url = "github:jose-elias-alvarez/null-ls.nvim"; flake = false; }; + baleia-nvim-src = { + url = "github:m00qek/baleia.nvim"; + flake = false; + }; Comment-nvim-src = { url = "github:numToStr/Comment.nvim/v0.8.0"; flake = false; diff --git a/modules/common/applications/firefox.nix b/modules/common/applications/firefox.nix index c990741..509f2c0 100644 --- a/modules/common/applications/firefox.nix +++ b/modules/common/applications/firefox.nix @@ -73,6 +73,7 @@ "media.ffmpeg.vaapi.enabled" = true; # Enable hardware video acceleration "cookiebanners.ui.desktop.enabled" = true; # Reject cookie popups + "svg.context-properties.content.enabled" = true; # Sidebery styling }; userChrome = '' :root { diff --git a/modules/common/applications/kitty.nix b/modules/common/applications/kitty.nix index ff69175..fe2ccef 100644 --- a/modules/common/applications/kitty.nix +++ b/modules/common/applications/kitty.nix @@ -28,6 +28,12 @@ programs.rofi.terminal = lib.mkIf pkgs.stdenv.isLinux "${pkgs.kitty}/bin/kitty"; + # Display images in the terminal + programs.fish.shellAliases = { + icat = "kitty +kitten icat"; + ssh = "kitty +kitten ssh"; + }; + programs.kitty = { enable = true; environment = { }; @@ -85,7 +91,6 @@ # Scrollback scrolling_lines = 10000; scrollback_pager_history_size = 10; # MB - scrollback_pager = "${pkgs.neovim}/bin/nvim -c 'normal G'"; # Window window_padding_width = 6; diff --git a/modules/common/neovim/config/syntax.nix b/modules/common/neovim/config/syntax.nix index 4072373..a4f933f 100644 --- a/modules/common/neovim/config/syntax.nix +++ b/modules/common/neovim/config/syntax.nix @@ -22,6 +22,7 @@ pkgs.vimPlugins.playground # Tree-sitter experimenting pkgs.vimPlugins.nginx-vim pkgs.vimPlugins.vim-helm + pkgs.baleia-nvim # Clean ANSI from kitty scrollback (pkgs.vimUtils.buildVimPluginFrom2Nix { pname = "nmasur"; version = "0.1"; diff --git a/modules/common/neovim/default.nix b/modules/common/neovim/default.nix index c5d0825..8a7a9f7 100644 --- a/modules/common/neovim/default.nix +++ b/modules/common/neovim/default.nix @@ -31,8 +31,8 @@ in { vll = "nvim -c 'Telescope oldfiles'"; }; }; - programs.kitty.settings.scrollback_pager = lib.mkForce '' - ${neovim}/bin/nvim -c 'setlocal nonumber nolist showtabline=0 foldcolumn=0|Man!' -c "autocmd VimEnter * normal G" -''; + 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 q :qa!" -c "autocmd VimEnter * normal G"' ''; xdg.desktopEntries.nvim = lib.mkIf pkgs.stdenv.isLinux { name = "Neovim wrapper"; diff --git a/modules/common/shell/utilities.nix b/modules/common/shell/utilities.nix index 2d8e3e8..0d9c766 100644 --- a/modules/common/shell/utilities.nix +++ b/modules/common/shell/utilities.nix @@ -52,10 +52,6 @@ in { }; }; - programs.fish.shellAbbrs = { - cat = "bat"; # Swap cat with bat - }; - programs.fish.functions = { ping = { description = "Improved ping"; diff --git a/overlays/neovim-plugins.nix b/overlays/neovim-plugins.nix index 42594d8..d0a65a7 100644 --- a/overlays/neovim-plugins.nix +++ b/overlays/neovim-plugins.nix @@ -7,12 +7,12 @@ let # Use nixpkgs vimPlugin but with source directly from plugin author withSrc = pkg: src: pkg.overrideAttrs (_: { inherit src; }); - # Package plugin - disabling until in use - # plugin = pname: src: - # prev.vimUtils.buildVimPluginFrom2Nix { - # inherit pname src; - # version = "master"; - # }; + # Package plugin - for plugins not found in nixpkgs at all + plugin = pname: src: + prev.vimUtils.buildVimPluginFrom2Nix { + inherit pname src; + version = "master"; + }; in { @@ -36,8 +36,7 @@ in { (withSrc prev.vimPlugins.bufferline-nvim inputs.bufferline-nvim); nvim-tree-lua = (withSrc prev.vimPlugins.nvim-tree-lua inputs.nvim-tree-lua); - # Packaging plugins with Nix - # comment-nvim = plugin "comment-nvim" comment-nvim-src; - # plenary-nvim = plugin "plenary-nvim" plenary-nvim-src; + # Packaging plugins entirely with Nix + baleia-nvim = plugin "baleia-nvim" inputs.baleia-nvim-src; }