Skip to content

Commit 71f7167

Browse files
committed
term: Add Ghostty configuration
1 parent 8c5f29d commit 71f7167

File tree

7 files changed

+97
-2
lines changed

7 files changed

+97
-2
lines changed

Makefile

+13
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,19 @@ endif
6969
~/.wezterm.sh:
7070
curl -fsSo $@ https://raw.githubusercontent.com/wez/wezterm/main/assets/shell-integration/wezterm.sh
7171

72+
# -------- Ghostty --------
73+
74+
.PHONY: ghostty
75+
ghostty: ~/.config/ghostty ## Set up the Ghostty terminal emulator
76+
77+
~/.config/ghostty: | ~/.config
78+
ifeq ($(uname_s),Darwin)
79+
@rm -rvf -- $@
80+
ln -sf -- $(abspath ghostty) $@
81+
else
82+
ln -srTf -- ghostty $@
83+
endif
84+
7285
# -------- Neovim ---------
7386

7487
.PHONY: nvim clean-nvim

ghostty/README.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
### Ghostty terminal emulator
2+
3+
The configuration files belongs in `~/.config/ghostty` as described in the [documentation][documentation].
4+
5+
[documentation]: https://ghostty.org/docs/config

ghostty/config

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
font-family = MonoLisa
2+
font-size = 14.0
3+
theme = dark:Mellifluous Dark,light:Mellifluous Light
4+
shell-integration-features = sudo,no-title

ghostty/themes/Mellifluous Dark

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# bg4, red, green, orange, blue, purple, yellow, fg:lightened(8)
2+
palette = 0=#323232
3+
palette = 1=#d59192
4+
palette = 2=#b3b393
5+
palette = 3=#cbaa88
6+
palette = 4=#a8a1be
7+
palette = 5=#b99bb5
8+
palette = 6=#bfaf8e
9+
palette = 7=#f1f1f1
10+
# bg5, {red, green, orange, blue, purple, yellow}:lightened(10), fg:lightened(12)
11+
palette = 8=#373737
12+
palette = 9=#f2acad
13+
palette = 10=#cecfae
14+
palette = 11=#e7c5a3
15+
palette = 12=#c3bcda
16+
palette = 13=#d5b6d1
17+
palette = 14=#dbcaa9
18+
palette = 15=#fcfcfc
19+
20+
# bg, fg
21+
background = 1f1f1f
22+
foreground = dadada
23+
24+
# fg
25+
cursor-color = dadada
26+
27+
selection-invert-fg-bg = true

ghostty/themes/Mellifluous Light

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# dark_bg, red, green, orange, blue, purple, yellow, fg3
2+
palette = 0=#e5e5e5
3+
palette = 1=#b73242
4+
palette = 2=#63611e
5+
palette = 3=#a16927
6+
palette = 4=#5a418a
7+
palette = 5=#863e7f
8+
palette = 6=#9c792a
9+
palette = 7=#686868
10+
# dark_bg2, {red, green, orange, blue, purple, yellow}:darkened(10), fg2
11+
palette = 8=#d5d5d5
12+
palette = 9=#990b2a
13+
palette = 10=#4b4800
14+
palette = 11=#865000
15+
palette = 12=#42286f
16+
palette = 13=#6b2465
17+
palette = 14=#815f00
18+
palette = 15=#414141
19+
20+
# bg, fg
21+
background = ececec
22+
foreground = 1b1b1b
23+
24+
# fg
25+
cursor-color = 1b1b1b
26+
27+
selection-invert-fg-bg = true

nvim/init.lua

+15-2
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ vim.opt.rtp:prepend(lazypath)
102102

103103
-- Setup {{{
104104

105-
require "lazy".setup({
105+
local lazy_spec = {
106106
-- Shared Plugin Libraries {{{
107107

108108
"nvim-lua/plenary.nvim",
@@ -602,7 +602,20 @@ require "lazy".setup({
602602
}
603603

604604
-- }}}
605-
}, {
605+
}
606+
607+
if vim.env.GHOSTTY_RESOURCES_DIR then
608+
local gty_rtp = vim.env.GHOSTTY_RESOURCES_DIR .. "/../vim/vimfiles"
609+
if vim.fn.isdirectory(gty_rtp) then
610+
table.insert(lazy_spec, {
611+
"ghostty",
612+
dir = gty_rtp,
613+
lazy = false
614+
})
615+
end
616+
end
617+
618+
require "lazy".setup(lazy_spec, {
606619
defaults = {
607620
lazy = true
608621
},

zsh/zshrc

+6
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ export VISUAL=nvim
1313

1414
# Fpath mangling for user functions
1515
fpath=(${HOME}/.local/share/zsh/site-functions $fpath)
16+
if (( ${+GHOSTTY_RESOURCES_DIR} )) && [[ -d ${GHOSTTY_RESOURCES_DIR} ]]; then
17+
fpath=(${GHOSTTY_RESOURCES_DIR}/../zsh/site-functions $fpath)
18+
fi
1619

1720

1821
# -----------------
@@ -154,6 +157,9 @@ path=(${HOME}/.local/bin $path)
154157
export GOPATH=${HOME}/go
155158
path=(${GOPATH}/bin $path)
156159

160+
# Ghostty
161+
path=(${GHOSTTY_BIN_DIR} $path)
162+
157163
# Allow command line editing in an external editor in the "vicmd" keymap.
158164
# Zim's "input" module already enables this in the default keymap ("viins").
159165
bindkey -M vicmd "${key_info[Control]}x${key_info[Control]}e" edit-command-line

0 commit comments

Comments
 (0)