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.
This commit is contained in:
Felix Schröter 2022-03-30 00:07:31 +02:00
parent f59ae17641
commit 5bc58270bb
Signed by: felschr
GPG key ID: 671E39E6744C807D
3 changed files with 19 additions and 9 deletions

View file

@ -7,19 +7,19 @@ function LspStatus()
local hints = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.HINT }) 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 or warnings > 0 or infos > 0 or hints > 0) then
if errors > 0 then if errors > 0 then
sl = sl .. "E" .. errors sl = sl .. "" .. errors
end end
if warnings > 0 then if warnings > 0 then
sl = sl .. " W" .. warnings sl = sl .. " " .. warnings
end end
if infos > 0 then if infos > 0 then
sl = sl .. " I" .. infos sl = sl .. " " .. infos
end end
if hints > 0 then if hints > 0 then
sl = sl .. " H" .. hints sl = sl .. " " .. hints
end end
else else
sl = sl .. "🗸" sl = sl .. ""
end end
end end
return sl return sl

View file

@ -9,10 +9,13 @@ in {
enable = true; enable = true;
settings = { settings = {
add_newline = false; add_newline = false;
status.symbol = " ";
status.disabled = false; status.disabled = false;
status.symbol = " ";
aws.disabled = true; aws.disabled = true;
gcloud.disabled = true; gcloud.disabled = true;
# kitty/neovim don't play well with multi-width emojis
nix_shell.symbol = " ";
}; };
}; };

View file

@ -12,18 +12,25 @@
environment.systemPackages = with pkgs; [ wget curl openssl neovim ]; 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; [ fonts.fonts = with pkgs; [
fira-code
noto-fonts noto-fonts
noto-fonts-extra noto-fonts-extra
noto-fonts-cjk noto-fonts-cjk
noto-fonts-emoji noto-fonts-emoji
# (nerdfonts.override { fonts = [ "NerdFontsSymbolsOnly" ]; })
(nerdfonts.override { fonts = [ "FiraCode" ]; })
fira-code
]; ];
fonts.fontconfig.defaultFonts = { fonts.fontconfig.defaultFonts = {
serif = [ "Noto Serif" "Noto Color Emoji" ]; serif = [ "Noto Serif" "Noto Color Emoji" ];
sansSerif = [ "Noto Sans" "Noto Color Emoji" ]; sansSerif = [ "Noto Sans" "Noto Color Emoji" ];
monospace = [ "Fira Code" "Noto Color Emoji" ]; # monospace = [ "Fira Code" "Noto Color Emoji" "Symbols-1000-em Nerd Font" ];
emoji = [ "Noto Color Emoji" ]; # 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; services.printing.enable = true;