From 963fcd28102b8965a1a4b0a3438258ac6f5be36d Mon Sep 17 00:00:00 2001 From: Michael Housh Date: Sun, 29 Dec 2024 09:07:18 -0500 Subject: [PATCH] feat: Adds mini-ai, ghostty config updates, tmux config updates. --- ghostty/config | 12 +++---- nvim/lazynvim/snippets/lua.lua | 51 ++++++++++++++++------------ nvim/m-housh/lua/config/lazy.lua | 7 ++++ nvim/m-housh/lua/plugins/luasnip.lua | 10 ++++++ nvim/m-housh/snippets/lua.lua | 7 ++++ nvim/m-housh/snippets/swift.lua | 14 ++++++-- tmux/tmux.conf | 10 +++--- 7 files changed, 74 insertions(+), 37 deletions(-) diff --git a/ghostty/config b/ghostty/config index 2c11162..c1794f7 100644 --- a/ghostty/config +++ b/ghostty/config @@ -2,15 +2,10 @@ theme = catppuccin-mocha confirm-close-surface = false -font-size = 18 -font-family = "Inconsolata Nerd Font" -font-thicken = true +font-size = 15 +font-thicken = false -# HACK: to open as large as possible. -window-height = 1000 -window-width = 1000 -window-padding-x = 4,2 -window-padding-y = 8,2 +window-save-state = always # NOTE: This setting removes tabs, rounded borders, and window controls. # Also makes some of the below macos-titlebar-* things not matter, but @@ -24,5 +19,6 @@ macos-auto-secure-input = true macos-non-native-fullscreen = visible-menu macos-titlebar-style = transparent macos-titlebar-proxy-icon = hidden +macos-icon = custom-style keybind = super+shift+t=toggle_quick_terminal diff --git a/nvim/lazynvim/snippets/lua.lua b/nvim/lazynvim/snippets/lua.lua index f0db2c0..8f42afd 100644 --- a/nvim/lazynvim/snippets/lua.lua +++ b/nvim/lazynvim/snippets/lua.lua @@ -7,28 +7,35 @@ local i = ls.insert_node local f = ls.function_node local c = ls.choice_node local t = ls.text_node +local fmt = require("luasnip.extras.fmt").fmt ls.add_snippets("lua", { - -- Setup a new snippet file. - s("sf", { - t({ - "-- Setup snippets.", - 'local ls = require("luasnip")', - "local s = ls.snippet", - "local sn = ls.snippet_node", - "local ms = ls.multi_snippet", - "local i = ls.insert_node", - "local f = ls.function_node", - "local c = ls.choice_node", - "local t = ls.text_node", - "-- Add snippets", - }), - t('ls.add_snippets("'), - i(1, ""), - t({ - '", {', - "\t-- Define snippets here.", - "})", - }), - }), + -- Setup a new snippet file. + s("sf", { + t({ + "-- Setup snippets.", + 'local ls = require("luasnip")', + "local s = ls.snippet", + "local sn = ls.snippet_node", + "local ms = ls.multi_snippet", + "local i = ls.insert_node", + "local f = ls.function_node", + "local c = ls.choice_node", + "local t = ls.text_node", + "-- Add snippets", + }), + t('ls.add_snippets("'), + i(1, ""), + t({ + '", {', + "\t-- Define snippets here.", + "})", + }), + }), + s("c", { + c(1, { + fmt("{}", { i(1), t("debug") }), + fmt("{}", { i(1), t("warning") }), + }), + }), }) diff --git a/nvim/m-housh/lua/config/lazy.lua b/nvim/m-housh/lua/config/lazy.lua index 98308a5..4ca12b5 100755 --- a/nvim/m-housh/lua/config/lazy.lua +++ b/nvim/m-housh/lua/config/lazy.lua @@ -34,6 +34,13 @@ require("lazy").setup({ version = "v0.*", event = "VeryLazy", }, + { + "echasnovski/mini.ai", + version = "*", + config = function() + require("mini.ai").setup({}) + end, + }, }, { checker = { enabled = true, diff --git a/nvim/m-housh/lua/plugins/luasnip.lua b/nvim/m-housh/lua/plugins/luasnip.lua index 97e36e3..3e59490 100644 --- a/nvim/m-housh/lua/plugins/luasnip.lua +++ b/nvim/m-housh/lua/plugins/luasnip.lua @@ -23,6 +23,16 @@ return { end end, }, + { + "", + mode = { "i", "s" }, + function() + local ls = require("luasnip") + if ls.choice_active() then + ls.change_choice(1) + end + end, + }, }, config = function() local ls = require("luasnip") diff --git a/nvim/m-housh/snippets/lua.lua b/nvim/m-housh/snippets/lua.lua index f0db2c0..518c789 100644 --- a/nvim/m-housh/snippets/lua.lua +++ b/nvim/m-housh/snippets/lua.lua @@ -31,4 +31,11 @@ ls.add_snippets("lua", { "})", }), }), + s("c", { + c(1, { + t("1st"), + t("2nd"), + }), + }), }) + diff --git a/nvim/m-housh/snippets/swift.lua b/nvim/m-housh/snippets/swift.lua index a3d65fb..1d8255f 100644 --- a/nvim/m-housh/snippets/swift.lua +++ b/nvim/m-housh/snippets/swift.lua @@ -11,13 +11,23 @@ local fmt = require("luasnip.extras.fmt").fmt local rep = require("luasnip.extras").rep -- Add snippets ls.add_snippets("swift", { + + -- Logging + s( + { trig = "logg", desc = "Log a message" }, + fmt('logger.{}("{}")', { + i(1), + i(2), + }) + ), + -- Add a dependency snippet. - s({ trig = "@Dep", desc = "Add a dependency." }, fmt("@Dependency(\\.{}) var {}", { i(1), rep(1) })), + s({ trig = "@dep", desc = "Add a dependency." }, fmt("@Dependency(\\.{}) var {}", { i(1), rep(1) })), -- Add a dependency client. s( { - trig = "@DC", + trig = "@dc", desc = "Add a dependency client.", }, fmt( diff --git a/tmux/tmux.conf b/tmux/tmux.conf index be095c6..b624278 100755 --- a/tmux/tmux.conf +++ b/tmux/tmux.conf @@ -58,10 +58,10 @@ bind \\ splitw -h bind - splitw -v # Use Alt-arrow keys to navigate panes -bind -n M-Left select-pane -L -bind -n M-Right select-pane -R -bind -n M-Up select-pane -U -bind -n M-Down select-pane -D +# bind -n M-Left select-pane -L +# bind -n M-Right select-pane -R +# bind -n M-Up select-pane -U +# bind -n M-Down select-pane -D # Close a pane quickly bind-key -r K kill-pane @@ -73,7 +73,7 @@ bind -n M-h previous-window bind -n M-l next-window bind C-l send-keys 'C-l' -bind f run-shell "tmux display-popup -E -w 80% -h 80% ~/.local/scripts/tmux-sessionator" +bind f run-shell "tmux display-popup -E -w 80% -h 80% $SCRIPTS/tmux-sessionator" bind-key -r C run-shell -b "~/.local/scripts/tmux-sessionator ~/.dotfiles" unbind s bind s run-shell -b "~/.config/tmux/plugins/tmux-fzf/scripts/session.sh switch"