Replies: 1 comment
-
The next step was to bind this to a key that would pop open the quick term and then feed in the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Could we get a GitHub Discussions "Show and Tell" category alongside the Q&A, Ideas, and Announcements? At the moment, I don't know where else to post this for others that might be interested. Thanks!
Ghostty and Fzf
I wanted to share how I use
fzf
to switch between different Ghostty configuration snippets on my Mac. I like to change fonts multiple times in a day, so being able to do so quickly is important to me. Usingfzf
and a little function I wrote calledgc
(ghostty config) in my.zshrc
, I can do things like this:ghostty-and-fzf.mov
How it works
Here is my main Ghostty config directory. The
font
,theme
, andopacity
directories contain the Ghostty configuration snippets that are presented infzf
:The contents of those configuration files contain small snippets of Ghostty configuration. For example, here are the contents of
font/berkeley-mono
:And, here are the contents of
font/menlo
:And, here are the contents of
theme/catppuccin-mocha
:And, here are the contents of
theme/tokyonight-moon
:With all the snippets defined, I then define the default for each grouping in my main Ghostty
config
file via the threeconfig-file
keys at the bottom:Finally, here is the
gc
function defined in my.zshrc
, which usesfd
to feed the list of snippets tofzf
excluding the main Ghosttyconfig
file. Then I bind an action tofzf
and use the delimiter option to break apart thedir/snippet
into fields{1}
and{2}
that I use in ased
statement to replace the correctconfig-file
key in my main config. Lastly, because I'm on a Mac, I can use the native integration of Ghostty to call AppleScript to reload my configuration.I hope others find this useful.
Beta Was this translation helpful? Give feedback.
All reactions