From ed5521fafc5c7e8fdc1e7acfaecbbf431d186b2f Mon Sep 17 00:00:00 2001
From: Bart van der Braak <bart@vanderbraak.nl>
Date: Thu, 17 Oct 2024 02:45:40 +0200
Subject: [PATCH] Add fonts, `neovim` and `wezterm` config

---
 tongfang/.config/wezterm/wezterm.lua | 65 ++++++++++++++++++++++++++++
 tongfang/nixos/configuration.nix     |  6 ++-
 2 files changed, 70 insertions(+), 1 deletion(-)

diff --git a/tongfang/.config/wezterm/wezterm.lua b/tongfang/.config/wezterm/wezterm.lua
index e69de29..5709864 100644
--- a/tongfang/.config/wezterm/wezterm.lua
+++ b/tongfang/.config/wezterm/wezterm.lua
@@ -0,0 +1,65 @@
+local wezterm = require 'wezterm';
+
+return {
+  -- Set the default program
+  default_prog = { '/usr/bin/env', 'bash' },
+
+  -- Set the font and font size
+  font = wezterm.font("Jetbrains Mono"),
+  font_size = 13.0,
+
+  -- Set color scheme
+  color_scheme = "OneHalfDark",
+
+  -- Set window transparency
+  window_background_opacity = 0.9,
+
+  -- Hide tab bar if there's only one tab
+  hide_tab_bar_if_only_one_tab = true,
+
+  -- Window padding
+  window_padding = {
+    left = 5,
+    right = 5,
+    top = 5,
+    bottom = 5,
+  },
+
+  -- Use a steady block cursor
+  default_cursor_style = "SteadyBlock",
+
+  -- Set scrollback lines to a large number for history
+  scrollback_lines = 10000,
+
+  -- Key bindings
+  keys = {
+    -- CTRL+T to open a new tab
+    {key="t", mods="CTRL", action=wezterm.action{SpawnTab="DefaultDomain"}},
+
+    -- CTRL+W to close the current tab
+    {key="w", mods="CTRL", action=wezterm.action{CloseCurrentTab={confirm=true}}},
+
+    -- CTRL+D to split pane horizontally
+    {key="d", mods="CTRL", action=wezterm.action{SplitHorizontal={domain="CurrentPaneDomain"}}},
+
+    -- CTRL+SHIFT+D to split pane vertically
+    {key="d", mods="CTRL|SHIFT", action=wezterm.action{SplitVertical={domain="CurrentPaneDomain"}}},
+
+    -- CTRL+Left/Right Arrow to move between tabs
+    {key="LeftArrow", mods="CTRL", action=wezterm.action{ActivateTabRelative=-1}},
+    {key="RightArrow", mods="CTRL", action=wezterm.action{ActivateTabRelative=1}},
+
+    -- CTRL+Enter to toggle full screen
+    {key="Enter", mods="CTRL", action="ToggleFullScreen"},
+  },
+
+  -- Enable native macOS-style key repeat
+  enable_csi_u_key_encoding = true,
+
+  -- Set the default window size to something familiar
+  initial_cols = 120,
+  initial_rows = 30,
+
+  -- Enable Scrollbar
+  enable_scroll_bar = true,
+}
diff --git a/tongfang/nixos/configuration.nix b/tongfang/nixos/configuration.nix
index 2b85e16..f977e7a 100644
--- a/tongfang/nixos/configuration.nix
+++ b/tongfang/nixos/configuration.nix
@@ -60,7 +60,7 @@
       thunderbird
       fastfetch
       wezterm
-      nvim
+      neovim
     ];
   };
 
@@ -77,5 +77,9 @@
   ];
   environment.variables.EDITOR = "vim";
 
+  fonts.packages = with pkgs; [
+    jetbrains-mono
+  ];
+
   system.stateVersion = "24.05";
 }