+/config
my dotfiles and nix configuration
git clone https://git.julia.blue/+/config
8dbea4b
main
1local w =require "wezterm" 2local a =w . action 3local c ={ 4front_end ="WebGpu" , 5default_prog ={ "zsh" } , 6font =w . font "Source Code Pro" , 7font_rules ={ 8{ 9intensity ="Bold" , 10italic =true , 11font =w . font { family ="Source Code Pro" , weight ="Bold" , style ="Italic" } , 12} , 13{ 14intensity ="Bold" , 15font =w . font { family ="Source Code Pro" , weight ="Bold" } , 16} , 17} , 18window_padding ={ left =0 , right =0 , top =0 , bottom =0 } , 19color_scheme ="iTerm2 Default" , 20colors ={ foreground ="#DDDDDD" } , 21default_cursor_style ="BlinkingBar" , 22hide_tab_bar_if_only_one_tab =true , 23enable_kitty_keyboard =true , 24} 25 26local h =w . hostname () 27if h == "WOPR" then c . font_size =15 end 28 29local function get_zone_around_cursor ( pane ) 30local cursor =pane : get_cursor_position () 31( cursor ) 32local zone =pane : get_semantic_zone_at ( math . max ( cursor . x - 1 , 0 ), cursor . y ) 33if zone then 34( zone ) -- return pane:get_text_from_semantic_zone(zone) 35end 36return nil 37end 38 39-- TODO: semantic zone in pager 40w . on ( "view-zone-in-pager" , function ( window , _pane ) 41( window : current_event ()) 42-- get_zone_around_cursor(pane) 43end ) 44 45w . on ( "view-history-in-pager" , function ( window , pane ) 46local text =pane : get_lines_as_escapes ( pane : get_dimensions (). scrollback_rows ) 47 48-- TODO: mkfifo or something to avoid writing tmpfile? 49local name =os . tmpname () 50local f =io . open ( name , "w+" ) 51f : write ( text ) 52f : flush () 53f : close () 54 55window : perform_action ( a . SpawnCommandInNewTab { args ={ "less" , "-R" , name } } , pane ) 56w . sleep_ms ( 5000 ) 57os . remove ( name ) 58end ) 59 60c . disable_default_key_bindings =true 61local m ="CTRL|SHIFT" 62c . keys ={ 63{ mods =m , key ="c" , action =a . CopyTo "Clipboard" } , 64{ mods =m , key ="v" , action =a . PasteFrom "Clipboard" } , 65{ mods =m , key ="+" , action =a . IncreaseFontSize } , 66{ mods =m , key ="_" , action =a . DecreaseFontSize } , 67{ mods =m , key =")" , action =a . ResetFontSize } , 68{ mods =m , key ="r" , action =a . ReloadConfiguration } , 69{ mods =m , key ="u" , action =a . ScrollByPage ( - 1 ) } , 70{ mods =m , key ="d" , action =a . ScrollByPage ( 1 ) } , 71{ key ="PageUp" , action =a . ScrollToPrompt ( - 1 ) } , 72{ key ="PageDown" , action =a . ScrollToPrompt ( 1 ) } , 73{ mods =m , key ="Space" , action =a . QuickSelect } , 74{ mods =m , key ="h" , action =a . EmitEvent "view-history-in-pager" } , 75{ mods =m , key ="~" , action =a . ShowDebugOverlay } , 76{ mods ="ALT" , key ="r" , action =a . ShowLauncher } , 77} 78 79local l ={ streak =1 , button ="Left" } 80local r ={ streak =1 , button ="Right" } 81c . mouse_bindings ={ 82{ 83event ={ Down ={ streak =1 , button ={ WheelUp =1 } } } , 84mods ="NONE" , 85alt_screen =false , 86action =a . ScrollByLine ( - 1 ), 87} , 88{ 89event ={ Down ={ streak =1 , button ={ WheelDown =1 } } } , 90mods ="NONE" , 91alt_screen =false , 92action =a . ScrollByLine ( 1 ), 93} , 94{ 95event ={ Down ={ streak =4 , button ="Left" } } , 96action =a . SelectTextAtMouseCursor "SemanticZone" , 97mods ="NONE" , 98} , 99{ event ={ Down =l } , mods =m , action =a . Nop } , 100{ event ={ Up =l } , mods =m , action =a . OpenLinkAtMouseCursor } , 101{ 102event ={ Down =r } , 103mods =m , 104alt_screen =false , 105action =a . EmitEvent "view-zone-in-pager" , 106} , 107{ event ={ Down ={ streak =1 , button ="Middle" } } , action =a . Nop } , 108{ event ={ Up ={ streak =1 , button ="Left" } } , action =a . Nop } , 109{ event ={ Up ={ streak =2 , button ="Left" } } , action =a . Nop } , 110{ event ={ Up ={ streak =3 , button ="Left" } } , action =a . Nop } , 111} 112 113c . text_blink_ease_in ="Constant" 114c . text_blink_ease_out ="Constant" 115 116return c