Skip to content
Merged
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
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@ Thumbs.db
*~

# Plugin artifacts
lazy-lock.json
.luarc.json

# Development artifacts
.envrc
*.disabled
todo.md
CLAUDE.md
2 changes: 2 additions & 0 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ require 'core.keymaps'
require 'core.autocmds'
require('core.shared-session').setup()

vim.env.DEVELOPER_DIR = '/Applications/Xcode.app/Contents/Developer'

-- Load plugins via lazy.nvim
require('lazy').setup('plugins.spec', {
change_detection = { enabled = true, notify = false },
Expand Down
40 changes: 40 additions & 0 deletions lazy-lock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
"blink-cmp-copilot": { "branch": "main", "commit": "439cff78780c033aa23cf061d7315314b347e3c1" },
"blink.cmp": { "branch": "main", "commit": "485c03400608cb6534bbf84da8c1c471fc4808c0" },
"conform.nvim": { "branch": "master", "commit": "235dd79731c1dc51ec04abb4045cbc54727a172a" },
"copilot.lua": { "branch": "master", "commit": "3123983d00ae6859f8bc987d14ebb524bb41b618" },
"fidget.nvim": { "branch": "main", "commit": "3f5475949679953af6d78654db29b944fa826e6a" },
"gitsigns.nvim": { "branch": "main", "commit": "20ad4419564d6e22b189f6738116b38871082332" },
"harpoon": { "branch": "harpoon2", "commit": "ed1f853847ffd04b2b61c314865665e1dadf22c7" },
"image.nvim": { "branch": "master", "commit": "446a8a5cc7a3eae3185ee0c697732c32a5547a0b" },
"indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" },
"lazy.nvim": { "branch": "main", "commit": "1ea3c4085785f460fb0e46d2fe1ee895f5f9e7c1" },
"lazydev.nvim": { "branch": "main", "commit": "e28ce52fc7ff79fcb76f0e79ee6fb6182fca90b9" },
"leetcode.nvim": { "branch": "master", "commit": "fdd3f91800b3983e27bc9fcfb99cfa7293d7f11a" },
"mini.nvim": { "branch": "main", "commit": "cf32454e91b3d963a12fef0314811fb035b62d49" },
"molten-nvim": { "branch": "main", "commit": "a286aa914d9a154bc359131aab788b5a077a5a99" },
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
"nvim-autopairs": { "branch": "master", "commit": "7a2c97cccd60abc559344042fefb1d5a85b3e33b" },
"nvim-dap": { "branch": "master", "commit": "6782b097af2417a4c3e33849b0a26ae2188bd7ea" },
"nvim-dap-ui": { "branch": "master", "commit": "cf91d5e2d07c72903d052f5207511bf7ecdb7122" },
"nvim-dap-virtual-text": { "branch": "master", "commit": "fbdb48c2ed45f4a8293d0d483f7730d24467ccb6" },
"nvim-lspconfig": { "branch": "master", "commit": "e5c61b02f33b5c6538be25b2696b33b4cc91e667" },
"nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" },
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "a9742cbc1f95db9eaf3293bf8cd0622ca36542bb" },
"nvim-web-devicons": { "branch": "master", "commit": "b8221e42cf7287c4dcde81f232f58d7b947c210d" },
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" },
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
"telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
"todo-comments.nvim": { "branch": "main", "commit": "19d461ddd543e938eb22505fb03fa878800270b6" },
"tokyonight.nvim": { "branch": "main", "commit": "e63c42a42b11cd6225f009dd949b9ee0fccc15ef" },
"vim-fugitive": { "branch": "master", "commit": "61b51c09b7c9ce04e821f6cf76ea4f6f903e3cf4" },
"vim-illuminate": { "branch": "master", "commit": "0d1e93684da00ab7c057410fecfc24f434698898" },
"vim-ocaml": { "branch": "master", "commit": "ee14abbe433dcf5b85863e19900dea60e090b87d" },
"vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" },
"vim-slime": { "branch": "main", "commit": "67b24bf93cff3ac39db94694a7aefcdb3f44b927" },
"vim-tmux-navigator": { "branch": "master", "commit": "c45243dc1f32ac6bcf6068e5300f3b2b237e576a" },
"which-key.nvim": { "branch": "main", "commit": "b4177e3eaf15fe5eb8357ebac2286d488be1ed00" }
}
24 changes: 9 additions & 15 deletions lua/core/autocmds.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,15 @@ vim.api.nvim_create_autocmd('TextYankPost', {
end,
})

-- Fix for netrw not properly detecting filetypes
-- This is a global issue that affects all filetypes when using :Ex
vim.api.nvim_create_autocmd("BufReadPost", {
group = vim.api.nvim_create_augroup('netrw-filetype-fix', { clear = true }),
pattern = "*",
callback = function()
-- If filetype is empty after opening a file, force detection
-- This commonly happens when navigating through netrw
if vim.bo.filetype == "" then
vim.schedule(function()
if vim.bo.filetype == "" then
vim.cmd("filetype detect")
end
end)
vim.api.nvim_create_autocmd('LspAttach', {
callback = function(args)
local client = vim.lsp.get_client_by_id(args.data.client_id)
if client and client.server_capabilities.codeLensProvider then
vim.lsp.codelens.refresh()
vim.api.nvim_create_autocmd({ 'BufEnter', 'CursorHold', 'InsertLeave' }, {
buffer = args.buf,
callback = vim.lsp.codelens.refresh,
})
end
end,
desc = "Fix netrw filetype detection for all files"
})
18 changes: 10 additions & 8 deletions lua/core/keymaps.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,20 @@ vim.keymap.set('t', '<Esc><Esc>', '<C-\\><C-n>', { desc = 'Exit terminal mode' }
local function reload_lsp()
local clients = vim.lsp.get_clients()
if #clients == 0 then
print('No LSP clients running')
print 'No LSP clients running'
return
end

for _, client in ipairs(clients) do
vim.lsp.stop_client(client.id)
end

vim.defer_fn(function()
vim.cmd('LspStart')
print('LSP servers reloaded')
vim.cmd 'LspStart'
print 'LSP servers reloaded'
end, 500)
end

-- Reload LSP keybind
vim.keymap.set('n', '<leader>lr', reload_lsp, { desc = '[L]SP [R]eload all servers' })

-- Buffer management keymaps
vim.keymap.set('n', '<leader>bb', '<cmd>Telescope buffers<CR>', { desc = '[B]rowse [B]uffers' })
vim.keymap.set('n', '[b', '<cmd>bprevious<CR>', { desc = 'Previous buffer' })
Expand Down Expand Up @@ -58,5 +55,10 @@ vim.keymap.set('n', '<C-Down>', '<cmd>resize -2<CR>', { desc = 'Decrease window
vim.keymap.set('n', '<C-Left>', '<cmd>vertical resize -2<CR>', { desc = 'Decrease window width' })
vim.keymap.set('n', '<C-Right>', '<cmd>vertical resize +2<CR>', { desc = 'Increase window width' })

-- Editing/Navigation
vim.keymap.set('n', '<leader>S', ':%s/<C-r><C-w>/', { desc = '[S]ubstitute current word' })
vim.keymap.set('v', 'J', ":m '>+1<CR>gv=gv")
vim.keymap.set('v', 'K', ":m '<-2<CR>gv=gv")

-- Standard practice for Lua modules that don't need to return complex data
return {}
67 changes: 67 additions & 0 deletions lua/plugins/config/autopairs.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
-- Auto-pairs - Automatically close brackets, quotes, etc.
local M = {}

function M.setup()
pcall(function()
require('vim._extui').enable {}
end)

require('blink.pairs').setup {
mappings = {
enabled = true,
cmdline = true,
disable_filetype = { 'TelescopePrompt', 'spectre_panel' },
},
highlights = {
enabled = true,
cmdline = true,
groups = {
'BlinkPairsOrange',
'BlinkPairsPurple',
'BlinkPairsBlue',
},
unmatched_group = 'BlinkPairsUnmatched',

-- highlights matching pairs under the cursor
matchparen = {
enabled = true,
-- known issue where typing won't update matchparen highlight, disabled by default
cmdline = false,
-- also include pairs not on top of the cursor, but surrounding the cursor
include_surrounding = false,
group = 'BlinkPairsMatchParen',
priority = 250,
},
},
debug = false,
}

-- UNIFIED KEY TO KILL AUTO-INSERTED STUFF
-- <C-u> already kills auto-inserted comments (built-in)
-- Let's add <C-u> to also kill auto-paired character

vim.keymap.set('i', '<C-u>', function()
local line = vim.api.nvim_get_current_line()
local col = vim.fn.col '.' - 1

-- Check if we're at the beginning of a line with just comment chars
local comment_pattern = '^%s*[#%-/]+%s*$'
if line:sub(1, col):match(comment_pattern) then
-- Kill the whole comment prefix (default <C-u> behavior)
return '<C-u>'
-- Check if cursor is between paired characters
elseif col > 0 and col < #line then
local before = line:sub(col, col)
local after = line:sub(col + 1, col + 1)
local pairs = { ['('] = ')', ['['] = ']', ['{'] = '}', ['"'] = '"', ["'"] = "'" }
if pairs[before] == after then
-- Delete the closing pair
return '<Del>'
end
end
-- Otherwise, regular <C-u> (kill to start of line)
return '<C-u>'
end, { expr = true, desc = 'Kill auto-insert or line to start' })
end

return M
79 changes: 55 additions & 24 deletions lua/plugins/config/blink.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,65 +2,96 @@
local M = {}

function M.setup()
require('blink.cmp').setup({
require('blink.cmp').setup {
-- Keymap configuration
keymap = {
preset = 'default',
['<C-space>'] = { 'show', 'show_documentation', 'hide_documentation' },
['<C-g>'] = { 'show', 'show_documentation', 'hide_documentation' },
['<C-e>'] = { 'hide' },
['<C-y>'] = { 'select_and_accept' },

['<C-p>'] = { 'select_prev', 'fallback' },
['<C-n>'] = { 'select_next', 'fallback' },

['<C-b>'] = { 'scroll_documentation_up', 'fallback' },
['<C-f>'] = { 'scroll_documentation_down', 'fallback' },
['<Tab>'] = { 'snippet_forward', 'fallback' },
['<S-Tab>'] = { 'snippet_backward', 'fallback' },

['<M-n>'] = { 'snippet_forward', 'fallback' },
['<M-p>'] = { 'snippet_backward', 'fallback' },
},

-- Appearance configuration
appearance = {
use_nvim_cmp_as_default = true,
-- use_nvim_cmp_as_default = true,
nerd_font_variant = 'mono',
kind_icons = {
Copilot = '',
Text = '',
Method = 'ƒ',
Function = 'ƒ',
Constructor = '',
Field = '',
Variable = '',
Property = '',
Class = '',
Interface = '',
Struct = '',
Module = '',
Unit = '',
Value = '',
Enum = '',
EnumMember = '',
Keyword = '',
Constant = '',
Snippet = ' ',
Color = '',
File = '',
Reference = '',
Folder = '',
Event = '',
Operator = '',
TypeParameter = '',
},
},

-- Sources configuration with Copilot integration
sources = {
default = { 'lsp', 'path', 'snippets', 'buffer', 'copilot' },
providers = {
copilot = {
name = 'copilot',
module = 'blink-cmp-copilot',
score_offset = 100,
score_offset = -5,
async = true,
transform_items = function(_, items)
-- Add copilot icon to copilot suggestions
local CompletionItemKind = require('blink.cmp.types').CompletionItemKind
local kind_idx = #CompletionItemKind + 1
CompletionItemKind[kind_idx] = 'Copilot'
for _, item in ipairs(items) do
item.kind = 'Copilot'
item.kind = kind_idx
end
return items
end,
},
},
},

-- Command line configuration (new API)
cmdline = {
enabled = false, -- Disable cmdline completion for now
enabled = true,
},

-- Signature help configuration
signature = {
enabled = true,
window = {
border = 'rounded',
},
},

-- Completion configuration
completion = {
keyword = { range = 'full' },
accept = {
-- Auto-insert brackets for functions
auto_brackets = {
Expand All @@ -71,24 +102,24 @@ function M.setup()
draw = {
columns = {
{ 'label', 'label_description', gap = 1 },
{ 'kind_icon', 'kind' }
{ 'kind_icon', 'kind' },
},
},
border = 'rounded',
winblend = 0,
},
documentation = {
auto_show = true,
auto_show_delay_ms = 200,
auto_show_delay_ms = 500,
window = {
border = 'rounded',
},
},
ghost_text = {
enabled = false, -- Disabled: was showing unwanted text on Tab
enabled = false, -- Disabled: was showing unwanted text on Tab
},
},

-- Fuzzy matching configuration
fuzzy = {
-- Use Rust implementation for better performance
Expand All @@ -106,7 +137,7 @@ function M.setup()
download = true,
},
},

-- Snippet configuration
snippets = {
expand = function(snippet)
Expand All @@ -120,7 +151,7 @@ function M.setup()
end
end,
},
})
}
end

return M
return M
Loading