refactor: reorganize, add package (opencode, osgrep, beads), add ai agent shell

This commit is contained in:
Rasyidan Akbar F. 2025-12-09 15:09:05 +07:00
commit a0f0f39399
58 changed files with 7867 additions and 42 deletions

View file

@ -0,0 +1,9 @@
-- Essential autocommands (minimal)
local autocmd = vim.api.nvim_create_autocmd
-- Highlight on yank
autocmd("TextYankPost", {
callback = function()
vim.highlight.on_yank()
end,
})

View file

@ -0,0 +1,9 @@
-- Essential keymaps (minimal improvements over default Vim)
local keymap = vim.keymap
-- Clear search highlight with <esc>
keymap.set("n", "<esc>", "<cmd>noh<cr>", { desc = "Clear search highlight" })
-- Better indenting (stay in visual mode)
keymap.set("v", "<", "<gv")
keymap.set("v", ">", ">gv")

View file

@ -0,0 +1,52 @@
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)
vim.g.mapleader = " "
vim.g.maplocalleader = "\\"
require("lazy").setup({
spec = {
{
"LazyVim/LazyVim",
import = "lazyvim.plugins",
},
{ import = "plugins" },
},
defaults = {
lazy = false,
version = false,
},
install = { colorscheme = { "gruvbox", "habamax" } },
checker = { enabled = false },
change_detection = { notify = false },
performance = {
rtp = {
disabled_plugins = {
"gzip",
"matchit",
"matchparen",
"netrwPlugin",
"tarPlugin",
"tohtml",
"tutor",
"zipPlugin",
},
},
},
})

View file

@ -0,0 +1,53 @@
-- LazyVim utilities module
-- Provides helper functions for plugin configuration
local M = {}
-- Mini module utilities
M.mini = {}
-- Setup mini.pairs with given options
function M.mini.pairs(opts)
require("mini.pairs").setup(opts)
end
-- Text object for entire buffer
M.mini.ai_buffer = function(ai)
local n_lines = vim.fn.line("$")
local start_line, end_line = 1, n_lines
if n_lines == 0 then
return { from = { line = 0, col = 0 } }
end
local start_col, end_col = 1, math.max(vim.fn.getline(end_line):len(), 1)
return {
from = { line = start_line, col = start_col },
to = { line = end_line, col = end_col },
}
end
-- Text object hints are now handled by mini.clue
-- Run callback when plugin is loaded
function M.on_load(name, fn)
local Config = require("lazy.core.config")
if Config.plugins[name] and Config.plugins[name]._.loaded then
vim.schedule(function()
fn(name)
end)
else
vim.api.nvim_create_autocmd("User", {
pattern = "LazyLoad",
callback = function(event)
if event.data == name then
fn(name)
return true
end
end,
})
end
end
-- Make LazyVim global
_G.LazyVim = M
return M

View file

@ -0,0 +1,38 @@
-- Minimal essential options
local opt = vim.opt
-- Leader keys
vim.g.mapleader = " "
vim.g.maplocalleader = "\\"
-- Line numbers
opt.number = true
opt.relativenumber = true
-- Indentation
opt.tabstop = 2
opt.shiftwidth = 2
opt.expandtab = true
opt.smartindent = true
-- Search
opt.ignorecase = true
opt.smartcase = true
-- UI
opt.termguicolors = true
opt.signcolumn = "yes"
opt.cursorline = true
-- Splits
opt.splitbelow = true
opt.splitright = true
-- Clipboard
opt.clipboard = "unnamedplus"
-- Undo
opt.undofile = true
-- Mouse
opt.mouse = "a"