From 8bf61f23f30d44fece05ee785863e1405dc693ae Mon Sep 17 00:00:00 2001 From: Anton Volnuhin Date: Sat, 11 May 2024 15:23:35 +0300 Subject: [PATCH] wezterm mostly --- dot_gitconfig | 5 + dot_wezterm.lua | 169 ++++++++++++++++++-- private_dot_config/karabiner.edn | 7 +- private_dot_config/private_fish/config.fish | 30 ++-- 4 files changed, 182 insertions(+), 29 deletions(-) diff --git a/dot_gitconfig b/dot_gitconfig index b305725..856a5af 100644 --- a/dot_gitconfig +++ b/dot_gitconfig @@ -19,3 +19,8 @@ helper = /usr/local/share/gcm-core/git-credential-manager [credential "https://dev.azure.com"] useHttpPath = true +[http] + postBuffer = 157286400 + version = HTTP/1.1 +[pack] + window = 1 diff --git a/dot_wezterm.lua b/dot_wezterm.lua index 2f35f57..46cc79e 100644 --- a/dot_wezterm.lua +++ b/dot_wezterm.lua @@ -5,6 +5,16 @@ local wezterm = require 'wezterm' local config = wezterm.config_builder() local act = wezterm.action +config.scrollback_lines = 5000000 +config.enable_scroll_bar = false +config.native_macos_fullscreen_mode = false + +config.default_cursor_style = 'BlinkingBar' +-- config.animation_fps = 1 +config.front_end = "WebGpu" +config.cursor_blink_ease_in = 'Constant' +config.cursor_blink_ease_out = 'Constant' + -- This is where you actually apply your config choices config.ssh_domains = { { @@ -18,6 +28,20 @@ config.ssh_domains = { }, } config.keys = { + { + key = ',', + mods = 'CMD', + action = act.SpawnCommandInNewTab { + cwd = os.getenv('WEZTERM_CONFIG_DIR'), + set_environment_variables = { + TERM = 'screen-256color', + }, + args = { + '/opt/homebrew/bin/nvim', + os.getenv('WEZTERM_CONFIG_FILE'), + }, + }, + }, { key = 'U', mods = 'CTRL|SHIFT', action = act.AttachDomain 'devhost' }, -- Detaches the domain associated with the current pane { @@ -31,8 +55,24 @@ config.keys = { mods = 'CTRL|SHIFT', action = act.DetachDomain { DomainName = 'devhost' }, }, + { + key = '"', + mods = 'CMD', + action = wezterm.action.SplitVertical { domain = 'CurrentPaneDomain' }, + }, + { + key = 'Enter', + mods = 'CMD', + action = wezterm.action.SplitHorizontal { domain = 'CurrentPaneDomain' }, + }, + { + key = 'p', + mods = 'CMD', + action = wezterm.action.ActivateCommandPalette, + }, } -config.window_decorations = "RESIZE | INTEGRATED_BUTTONS" + +config.window_decorations = "RESIZE|INTEGRATED_BUTTONS" config.initial_cols = 127 config.initial_rows = 67 @@ -64,22 +104,121 @@ config.window_frame = { -- The overall background color of the tab bar when -- the window is focused - active_titlebar_bg = '#222222', - inactive_titlebar_bg = '#000000', - active_titlebar_fg = '#ffffff', + -- active_titlebar_bg = '#222222', + -- inactive_titlebar_bg = '#FF0000', + -- active_titlebar_fg = '#ffffff', - border_left_width = '0.5cell', - border_right_width = '0.5cell', - border_bottom_height = '0cell', - border_top_height = '0.1cell', - border_left_color = '#1c2836', - border_right_color = '#1c2836', - border_bottom_color = '#1c2836', - border_top_color = '#1c2836', - - -- The overall background color of the tab bar when - -- the window is not focused + border_left_width = '1cell', + border_right_width = '0.5cell', + border_bottom_height = '0.25cell', + border_top_height = '1.15cell', + border_left_color = '#1c2836', + border_right_color = '#1c2836', + border_bottom_color = '#1c2836', + border_top_color = '#1c2836', } +config.use_fancy_tab_bar = false +config.tab_bar_at_bottom = true + +config.colors = { + tab_bar = { + -- The color of the strip that goes along the top of the window + -- (does not apply when fancy tab bar is in use) + background = '#1c2836', + + -- The active tab is the one that has focus in the window + active_tab = { + bg_color = '#5588DD', + fg_color = '#000000', + + -- Specify whether you want "Half", "Normal" or "Bold" intensity for the + -- label shown for this tab. + -- The default is "Normal" + intensity = 'Normal', + }, + + inactive_tab = { + bg_color = '#222222', + fg_color = '#808080', + }, + + inactive_tab_hover = { + bg_color = '#3b3052', + fg_color = '#909090', + italic = true, + }, + + new_tab = { + bg_color = '#1c2836', + fg_color = '#AAAACC', + }, + + new_tab_hover = { + bg_color = '#3b3052', + fg_color = '#909090', + italic = true, + }, + }, +} +config.tab_max_width = 32 +-- The filled in variant of the < symbol +local SOLID_LEFT_ARROW = wezterm.nerdfonts.ple_left_half_circle_thick + +-- The filled in variant of the > symbol +local SOLID_RIGHT_ARROW = wezterm.nerdfonts.ple_right_half_circle_thick + +-- This function returns the suggested title for a tab. +-- It prefers the title that was set via `tab:set_title()` +-- or `wezterm cli set-tab-title`, but falls back to the +-- title of the active pane in that tab. +function tab_title(tab_info) + local title = tab_info.tab_title + -- if the tab title is explicitly set, take that + if title and #title > 0 then + return title + end + -- Otherwise, use the title from the active pane + -- in that tab + return tab_info.active_pane.title +end + +wezterm.on( + 'format-tab-title', + function(tab, tabs, panes, config, hover, max_width) + local edge_background = '#1c2836' + local background = '#141c26' + local foreground = '#4d82bf' + + if tab.is_active then + background = '#2e84e6' + foreground = '#000000' + elseif hover then + background = '#155082' + foreground = '#000000' + end + + local edge_foreground = background + + local title = tab_title(tab) + + -- ensure that the titles fit in the available space, + -- and that we have room for the edges. + title = wezterm.truncate_right(title, max_width - 5) + + return { + { Background = { Color = edge_background } }, + { Foreground = { Color = edge_foreground } }, + { Text = " "..SOLID_LEFT_ARROW }, + { Background = { Color = background } }, + { Foreground = { Color = foreground } }, + { Text = " "..title.." " }, + { Background = { Color = edge_background } }, + { Foreground = { Color = edge_foreground } }, + { Text = SOLID_RIGHT_ARROW }, + } + end +) + -- and finally, return the configuration to wezterm return config diff --git a/private_dot_config/karabiner.edn b/private_dot_config/karabiner.edn index 8680291..4dce60b 100644 --- a/private_dot_config/karabiner.edn +++ b/private_dot_config/karabiner.edn @@ -21,6 +21,7 @@ :hepta ["^app.projectmeta.projectmeta$"] :youcom ["^com\\.Unite\\.You$"] :metaai ["^com\\.Unite\\.Meta.ai$"] + :wiki ["^com\\.Unite\\.SetiaWiki$"] :jupyter ["^org\\.jupyter\\.jupyterlab-desktop$"] :dataspell ["^com\\.jetbrains\\.dataspell$"] :vikunja ["^com\\.Unite\\.Vikunja$"]} @@ -107,7 +108,8 @@ [:d :!Ch :claude] [:h [:open "/Applications/Heptabase.app"] :!hepta] [:h :!Ch :hepta] - [:w [:open "/Users/anton/Applications/Setia.wiki.app"]] + [:w [:open "/Applications/Setia Wiki.app"] :!wiki] + [:w :!Cw :wiki] [:o [:open "/Applications/openai.app"] :!openai] [:o :!Ch :openai] [:p [:open "/Users/anton/Applications/webui.app"] :!webui] @@ -124,6 +126,9 @@ [:v :!Ch :vikunja] ]} + {:des "⌘W->⌘H in Heptabase" + :rules [:hepta [:!Cw :!Ch]]} + {:des "⌘W->⌘H in Safari ChatGPT app" :rules [:webapp [:!Cw :!Ch]]} diff --git a/private_dot_config/private_fish/config.fish b/private_dot_config/private_fish/config.fish index 8f570ab..ea05e84 100644 --- a/private_dot_config/private_fish/config.fish +++ b/private_dot_config/private_fish/config.fish @@ -21,19 +21,6 @@ if status is-interactive atuin init fish --disable-up-arrow | source end - # >>> conda initialize >>> - # !! Contents within this block are managed by 'conda init' !! - if test -f /usr/local/Caskroom/miniconda/base/bin/conda - eval /usr/local/Caskroom/miniconda/base/bin/conda "shell.fish" hook $argv | source & - end - # <<< conda initialize <<< - - - if test -f /opt/homebrew/Caskroom/miniconda/base/etc/fish/conf.d/conda.fish - source /opt/homebrew/Caskroom/miniconda/base/etc/fish/conf.d/conda.fish - conda activate base & - end - if type -q jump # initialize jump cd jump shell fish | source @@ -65,13 +52,21 @@ function s end function icat + if [ $TERM_PROGRAM ] + wezterm imgcat $argv + else kitty +kitten icat --align=left $argv + end end function winbox ~/dev/winbox/run.sh& end +function conda + micromamba $argv +end + if [ -e /home/anton/.nix-profile/etc/profile.d/nix.fish ]; . /home/anton/.nix-profile/etc/profile.d/nix.fish; end # The next line updates PATH for the Google Cloud SDK. @@ -81,3 +76,12 @@ end direnv hook fish | source if [ -f '~/.config/op/plugins.sh' ]; source ~/.config/op/plugins.sh; end + +# >>> mamba initialize >>> +# !! Contents within this block are managed by 'mamba init' !! +set -gx MAMBA_EXE "/opt/homebrew/bin/micromamba" +set -gx MAMBA_ROOT_PREFIX "/Users/anton/micromamba" +$MAMBA_EXE shell hook --shell fish --root-prefix $MAMBA_ROOT_PREFIX | source +# <<< mamba initialize <<< + +