From 5bc58270bb9e69ac0dd894c73e94347fb68884b9 Mon Sep 17 00:00:00 2001 From: Felix Tenley Date: Wed, 30 Mar 2022 00:07:31 +0200 Subject: [PATCH] feat(neovim): use nerdfonts & avoid emojis that break neovim Some emojis break rendering in neovim/kitty due to width issues. Can potentially be fixed by switching to a different terminal emulator but I haven't found one matching my other needs yet. --- home/editors/neovim/lightline.lua | 10 +++++----- home/shell/default.nix | 5 ++++- system/default.nix | 13 ++++++++++--- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/home/editors/neovim/lightline.lua b/home/editors/neovim/lightline.lua index 749a3c6..868edb4 100644 --- a/home/editors/neovim/lightline.lua +++ b/home/editors/neovim/lightline.lua @@ -7,19 +7,19 @@ function LspStatus() local hints = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.HINT }) if (errors > 0 or warnings > 0 or infos > 0 or hints > 0) then if errors > 0 then - sl = sl .. "E" .. errors + sl = sl .. " " .. errors end if warnings > 0 then - sl = sl .. " W" .. warnings + sl = sl .. "  " .. warnings end if infos > 0 then - sl = sl .. " I" .. infos + sl = sl .. "  " .. infos end if hints > 0 then - sl = sl .. " H" .. hints + sl = sl .. "  " .. hints end else - sl = sl .. "🗸" + sl = sl .. "" end end return sl diff --git a/home/shell/default.nix b/home/shell/default.nix index eb9e770..8df2974 100644 --- a/home/shell/default.nix +++ b/home/shell/default.nix @@ -9,10 +9,13 @@ in { enable = true; settings = { add_newline = false; - status.symbol = "❌ "; status.disabled = false; + status.symbol = "❌ "; aws.disabled = true; gcloud.disabled = true; + + # kitty/neovim don't play well with multi-width emojis + nix_shell.symbol = " "; }; }; diff --git a/system/default.nix b/system/default.nix index eb9b1c6..fb3733f 100644 --- a/system/default.nix +++ b/system/default.nix @@ -12,18 +12,25 @@ environment.systemPackages = with pkgs; [ wget curl openssl neovim ]; + # TODO once nerdfonts 2.2.0 is released switch to NerdFontsSymbolsOnly + # Also needs to be added to known fonts in nixpkgs: + # https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/data/fonts/nerdfonts/shas.nix fonts.fonts = with pkgs; [ - fira-code noto-fonts noto-fonts-extra noto-fonts-cjk noto-fonts-emoji + # (nerdfonts.override { fonts = [ "NerdFontsSymbolsOnly" ]; }) + (nerdfonts.override { fonts = [ "FiraCode" ]; }) + fira-code ]; fonts.fontconfig.defaultFonts = { serif = [ "Noto Serif" "Noto Color Emoji" ]; sansSerif = [ "Noto Sans" "Noto Color Emoji" ]; - monospace = [ "Fira Code" "Noto Color Emoji" ]; - emoji = [ "Noto Color Emoji" ]; + # monospace = [ "Fira Code" "Noto Color Emoji" "Symbols-1000-em Nerd Font" ]; + # emoji = [ "Noto Color Emoji" "Symbols-1000-em Nerd Font" ]; + monospace = [ "Fira Code" "Noto Color Emoji" "FiraCode Nerd Font" ]; + emoji = [ "Noto Color Emoji" "FiraCode Nerd Font" ]; }; services.printing.enable = true;