Compare commits

..

No commits in common. "7254f63fcf57a6a68baeaa573274e97bdda4d520" and "d276de37c8b7887bb52499d8f5adb5074b433cec" have entirely different histories.

2 changed files with 66 additions and 97 deletions

View file

@ -25,7 +25,13 @@ local path_package = vim.fn.stdpath 'data' .. '/site/'
local mini_path = path_package .. 'pack/deps/start/mini.nvim'
if not vim.uv.fs_stat(mini_path) then
vim.cmd 'echo "Installing mini.nvim" | redraw'
vim.fn.system { 'git', 'clone', '--filter=blob:none', 'https://github.com/echasnovski/mini.nvim', mini_path }
vim.fn.system {
'git',
'clone',
'--filter=blob:none',
'https://github.com/echasnovski/mini.nvim',
mini_path,
}
vim.cmd 'packadd mini.nvim | helptags ALL'
end
@ -47,12 +53,12 @@ add 'NeogitOrg/neogit'
add 'nvim-lua/plenary.nvim'
add 'sindrets/diffview.nvim'
add 'folke/which-key.nvim'
add { source = 'saghen/blink.cmp', checkout = 'v1.8.0' }
add {
source = 'saghen/blink.cmp',
checkout = 'v1.8.0',
}
add 'stevearc/conform.nvim'
add 'coder/claudecode.nvim'
add 'mbbill/undotree'
add 'cbochs/grapple.nvim'
add 'fang2hou/blink-copilot'
now(function()
require('mini.icons').setup {
@ -165,26 +171,10 @@ later(function()
require('fyler').setup {
views = {
---@diagnostic disable
finder = {
confirm_simple = true,
close_on_select = false,
watcher = {
enabled = true,
},
win = {
kind = 'replace',
kinds = {
split_left_most = {
width = '10%',
win_opts = {
winfixwidth = true,
},
},
},
},
},
---@diagnostic enable
},
}
@ -193,7 +183,12 @@ later(function()
on_directory_enter = function(dir) require('oil').open(dir) end,
}
require('compile-mode').setup {}
require('compile-mode').setup {
-- split_mode = "vertical-right",
on_exit = function(qf_list, _)
if #qf_list > 0 then require('quicker').open { focus = false } end
end,
}
require('neogit').setup {
integrations = {
@ -218,11 +213,6 @@ later(function()
}
require('claudecode').setup {}
require('grapple').setup {
scope = 'git_branch',
icons = false,
}
end)
later(function()
@ -281,14 +271,7 @@ later(function()
nerd_font_variant = 'mono',
},
sources = {
default = { 'lsp', 'path', 'snippets', 'buffer', 'copilot' },
providers = {
copilot = {
name = 'copilot',
module = 'blink-copilot',
async = true,
},
},
default = { 'lsp', 'path', 'buffer' },
},
completion = {
menu = {
@ -338,7 +321,6 @@ later(function()
'pyright', -- Python
'rust_analyzer', -- Rust
'clangd', -- C/C++
'copilot',
},
automatic_installation = true,
}
@ -468,7 +450,7 @@ later(function()
}
-- Enable language servers
vim.lsp.enable { 'lua_ls', 'ts_ls', 'pyright', 'rust_analyzer', 'clangd', 'copilot' }
vim.lsp.enable { 'lua_ls', 'ts_ls', 'pyright', 'rust_analyzer', 'clangd' }
end)
local map = function(mode, lhs, rhs, opts)
@ -499,19 +481,6 @@ map('n', '<leader>ch', '<cmd>checkhealth<cr>', 'Check health')
map('n', '<leader>cf', '<cmd>Format<cr>', 'Format buffer')
map('n', '<leader>gg', function() require('neogit').open() end, 'Open Neogit')
map('n', '<leader>ut', '<cmd>UndotreeToggle<cr>', 'Toggle undotree')
-- Grapple keymaps (harpoon-style)
map('n', '<leader>ma', '<cmd>Grapple toggle<cr>', 'Grapple toggle tag')
map('n', '<leader>mm', '<cmd>Grapple toggle_tags<cr>', 'Grapple tags menu')
map('n', '<leader>m1', '<cmd>Grapple select index=1<cr>', 'Grapple select 1')
map('n', '<leader>m2', '<cmd>Grapple select index=2<cr>', 'Grapple select 2')
map('n', '<leader>m3', '<cmd>Grapple select index=3<cr>', 'Grapple select 3')
map('n', '<leader>m4', '<cmd>Grapple select index=4<cr>', 'Grapple select 4')
map('n', '<leader>mn', '<cmd>Grapple cycle_tags next<cr>', 'Grapple next tag')
map('n', '<leader>mp', '<cmd>Grapple cycle_tags prev<cr>', 'Grapple prev tag')
map('n', '<leader>mga', '<cmd>Grapple toggle scope=global<cr>', 'Grapple add global tag')
map('n', '<leader>mgm', '<cmd>Grapple toggle_tags scope=global<cr>', 'Grapple global tags menu')
-- Claude Code keymaps
map('n', '<leader>ac', '<cmd>ClaudeCode<cr>', 'Toggle Claude')

View file

@ -34,9 +34,7 @@ local MAX_HISTORY_SIZE = 200
local config = {
on_success = nil,
on_error = nil,
on_exit = function(qf_list, _)
if #qf_list > 0 then vim.cmd 'copen' end
end,
on_exit = nil,
buffer_keymaps = {
close = 'q',
recompile = 'g',
@ -246,12 +244,14 @@ local function run_compile(cmd)
local function append_output(data)
if not data then return end
for _, line in ipairs(data) do
if line ~= '' then
table.insert(output_lines, line)
vim.api.nvim_buf_set_lines(bufnr, -1, -1, false, { line })
local buf_line = vim.api.nvim_buf_line_count(bufnr)
line_to_qf[buf_line] = #output_lines
end
end
end
local job_id = vim.fn.jobstart(cmd, {
stdout_buffered = false,
@ -282,6 +282,41 @@ local function run_compile(cmd)
valid_entries = vim.tbl_filter(function(item) return item.valid == 1 end, qf_list)
vim.b[bufnr].line_to_qf = line_to_qf
vim.schedule(function()
for _, buf in ipairs(vim.api.nvim_list_bufs()) do
if vim.api.nvim_buf_is_valid(buf) and vim.bo[buf].buftype == 'quickfix' then
local function qf_jump()
local line = vim.api.nvim_win_get_cursor(0)[1]
local qf_entries = vim.fn.getqflist()
if line <= #qf_entries then
local entry = qf_entries[line]
if entry.valid == 1 and entry.bufnr > 0 then
vim.cmd('cc ' .. line)
else
for i = line - 1, 1, -1 do
if qf_entries[i].valid == 1 and qf_entries[i].bufnr > 0 then
vim.cmd('cc ' .. i)
return
end
end
for i = line + 1, #qf_entries do
if qf_entries[i].valid == 1 and qf_entries[i].bufnr > 0 then
vim.cmd('cc ' .. i)
return
end
end
end
end
end
vim.keymap.set('n', '<CR>', qf_jump, { buffer = buf, desc = 'Jump to error location' })
vim.keymap.set('n', '<2-LeftMouse>', qf_jump, { buffer = buf, desc = 'Jump to error location' })
end
end
end)
end
vim.schedule(function()
@ -741,7 +776,9 @@ function M.compile()
if config.input_keymaps.history_prev then
vim.keymap.set('i', config.input_keymaps.history_prev, function()
if #command_history > 0 then
if history_index == 0 then saved_input = get_input() end
if history_index == 0 then
saved_input = get_input()
end
if history_index < #command_history then
history_index = history_index + 1
current_input = command_history[#command_history - history_index + 1]
@ -787,8 +824,7 @@ function M.compile()
-- Close compile prompt
---@type string[]
local close_keys = type(config.input_keymaps.close) == 'table' and config.input_keymaps.close --[[@as string[] ]]
or { config.input_keymaps.close }
local close_keys = type(config.input_keymaps.close) == 'table' and config.input_keymaps.close --[[@as string[] ]] or { config.input_keymaps.close }
for _, key in ipairs(close_keys) do
if key then vim.keymap.set({ 'i', 'n' }, key, function() vim.schedule(close) end, opts) end
end
@ -847,9 +883,7 @@ function M.setup(opts)
vim.api.nvim_create_autocmd('FileType', {
pattern = 'compilation',
callback = function()
if config.buffer_keymaps.close then
vim.keymap.set('n', config.buffer_keymaps.close, '<cmd>close<cr>', { buffer = true, desc = 'Close compilation buffer' })
end
if config.buffer_keymaps.close then vim.keymap.set('n', config.buffer_keymaps.close, '<cmd>close<cr>', { buffer = true, desc = 'Close compilation buffer' }) end
if config.buffer_keymaps.recompile then vim.keymap.set('n', config.buffer_keymaps.recompile, M.recompile, { buffer = true, desc = 'Recompile' }) end
local function jump_to_error()
@ -912,40 +946,6 @@ function M.setup(opts)
vim.keymap.set('n', '<2-LeftMouse>', jump_to_error, { buffer = true, desc = 'Jump to error location' })
end,
})
vim.api.nvim_create_autocmd('FileType', {
pattern = 'qf',
callback = function()
local function qf_jump()
local line = vim.api.nvim_win_get_cursor(0)[1]
local qf_entries = vim.fn.getqflist()
if line <= #qf_entries then
local entry = qf_entries[line]
if entry.valid == 1 and entry.bufnr > 0 then
vim.cmd('cc ' .. line)
else
for i = line - 1, 1, -1 do
if qf_entries[i].valid == 1 and qf_entries[i].bufnr > 0 then
vim.cmd('cc ' .. i)
return
end
end
for i = line + 1, #qf_entries do
if qf_entries[i].valid == 1 and qf_entries[i].bufnr > 0 then
vim.cmd('cc ' .. i)
return
end
end
end
end
end
vim.keymap.set('n', '<CR>', qf_jump, { buffer = true, desc = 'Jump to error location' })
vim.keymap.set('n', '<2-LeftMouse>', qf_jump, { buffer = true, desc = 'Jump to error location' })
end,
})
end
return M