Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Brewfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
brew "neovim"
brew "fd"

cask "ghostty"
cask "hammerspoon"
7 changes: 7 additions & 0 deletions configs/ghostty/config
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Treat Option as Alt so Neovim receives <A-...> key events properly
macos-option-as-alt = true

# Editor text size
font-size = 15

# Unbind Cmd keys so they pass through to Neovim via the kitty keyboard
# protocol. Neovim 0.11+ and Ghostty both support this protocol, so
# Neovim will receive these as <D-Right>, <D-Left>, etc. natively.
Expand All @@ -20,6 +23,10 @@ keybind = super+e=unbind
keybind = super+l=unbind
keybind = super+g=unbind
keybind = super+shift+g=unbind
keybind = super+j=unbind
keybind = super+shift+j=unbind
keybind = shift+arrow_left=unbind
keybind = shift+arrow_right=unbind

# Cmd+Shift+Arrow: split terminal in that direction
keybind = super+shift+arrow_down=new_split:down
Expand Down
22 changes: 22 additions & 0 deletions configs/nvim/lua/config/keymaps.lua
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@ map({ "n", "i", "v" }, "<D-l>", vim.lsp.buf.code_action, { desc = "Code actions"
-- Cmd+G: go to definition (matching Zed's Cmd+G behavior)
map({ "n", "i", "v" }, "<D-g>", vim.lsp.buf.definition, { desc = "Go to definition" })

-- Cmd+J: hover documentation (function params, types, etc)
map({ "n", "i", "v" }, "<D-j>", vim.lsp.buf.hover, { desc = "Hover documentation" })

-- Cmd+S: save current file
map({ "n", "i", "v" }, "<D-s>", function()
if vim.api.nvim_get_mode().mode ~= "n" then
Expand Down Expand Up @@ -243,6 +246,12 @@ map("n", "<S-Down>", "v<Down>", { desc = "Select next line" })
map("v", "<S-Up>", "<Up>", { desc = "Extend selection up" })
map("v", "<S-Down>", "<Down>", { desc = "Extend selection down" })

-- Shift+Left/Right: highlight/select text horizontally (like Zed)
map("n", "<S-Left>", "v<Left>", { desc = "Select previous character" })
map("n", "<S-Right>", "v<Right>", { desc = "Select next character" })
map("v", "<S-Left>", "<Left>", { desc = "Extend selection left" })
map("v", "<S-Right>", "<Right>", { desc = "Extend selection right" })

-- Alt+Up/Down: move line (or visual selection) up/down
map("n", "<A-Down>", "<cmd>execute 'move .+' . v:count1<cr>==", { desc = "Move Line Down" })
map("n", "<A-Up>", "<cmd>execute 'move .-' . (v:count1 + 1)<cr>==", { desc = "Move Line Up" })
Expand All @@ -257,4 +266,17 @@ map("v", "<A-S-Up>", "y'<P", { desc = "Duplicate Selection Above" })

map("n", "n", "nzzzv", { desc = "Next search result centered" })
map("n", "N", "Nzzzv", { desc = "Previous search result centered" })
map("n", "f", "/", { desc = "Search (like /)" })
map("n", "rr", vim.lsp.buf.rename, { desc = "Rename" })

-- Leader+b+a: delete all buffers (keeping the current window)
map("n", "<leader>ba", function()
-- skip the current buffer so the window stays open
local current = vim.api.nvim_get_current_buf()
for _, bufnr in ipairs(vim.api.nvim_list_bufs()) do
if bufnr ~= current and vim.api.nvim_buf_is_loaded(bufnr) and vim.bo[bufnr].buflisted then
pcall(vim.api.nvim_buf_delete, bufnr, { force = true })
end
end
vim.notify("Deleted all other buffers")
end, { desc = "Delete All Other Buffers" })
17 changes: 17 additions & 0 deletions configs/nvim/lua/plugins/snacks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,23 @@ return {
hidden = true,
ignored = true,
exclude = { "node_modules" },
jump = { close = true },
layout = {
layout = {
box = "horizontal",
width = 90,
min_width = 90,
height = 0.8,
{
box = "vertical",
border = true,
title = "{title} {live} {flags}",
{ win = "input", height = 1, border = "bottom" },
{ win = "list", border = "none" },
},
{ win = "preview", title = "{preview}", border = true, width = 0.5 },
},
},
},
},
},
Expand Down