Compare commits

...
10 Commits
Author SHA1 Message Date
Job79 0b90092ff8 refactor: temp 2026-06-24 20:34:11 +02:00
Job79 e7e37c8dc8 refactor: options 2026-06-24 19:47:32 +02:00
Job79 4609901269 refactor: update plugins 2026-06-24 19:46:16 +02:00
Job79 8a78482519 refactor: remove after 2026-06-24 19:46:16 +02:00
Job79 60d4cf6d26 refactor: init.lua 2026-06-24 19:46:16 +02:00
Job79 d0bb6d84ba refactor: switch to minimax 2026-06-01 21:34:45 +02:00
Job79 b1b6351bd8 feat: add shortcuts to codecompanion 2026-03-21 16:36:43 +01:00
Job79 d3a7651606 feat: add ai.lua 2026-03-19 21:07:01 +01:00
Job79 add6e87c26 refactor: simplify config 2026-03-06 20:08:42 +01:00
Job79 cebe4d190c add php 2026-02-23 20:49:51 +01:00
16 changed files with 499 additions and 155 deletions
-8
View File
@@ -1,8 +0,0 @@
tt.*
.tests
doc/tags
debug
.repro
foo.*
*.log
data
+24 -2
View File
@@ -1,2 +1,24 @@
-- bootstrap lazy.nvim, LazyVim and your plugins
require("config.lazy")
-- Modules =====================================================================
vim.loader.enable()
vim.opt.runtimepath:remove("/usr/share/nvim/site")
vim.opt.runtimepath:remove("/usr/share/nvim/site/after")
for _, m in ipairs({ "netrw", "netrwPlugin", "gzip", "tarPlugin", "zipPlugin", "tutor_mode_plugin" }) do
vim.g["loaded_" .. m] = 1 -- Block unused built-in modules
end
-- Config Global ===============================================================
vim.pack.add({ "https://github.com/nvim-mini/mini.nvim" })
local misc = require("mini.misc")
local gr = vim.api.nvim_create_augroup("custom-config", {})
_G.Config = {
now = function(f) misc.safely("now", f) end,
later = function(f) misc.safely("later", f) end,
on_event = function(ev, f) misc.safely("event:" .. ev, f) end,
on_filetype = function(ft, f) misc.safely("filetype:" .. ft, f) end,
autocmd = function(event, pattern, callback, desc)
vim.api.nvim_create_autocmd(event, { group = gr, pattern = pattern, callback = callback, desc = desc })
end
}
Config.now_if_args = vim.fn.argc(-1) > 0 and Config.now or Config.later
-33
View File
@@ -1,33 +0,0 @@
{
"LazyVim": { "branch": "main", "commit": "0329bc0e508eb48f7cee7fe57975c364584f8738" },
"blink.cmp": { "branch": "main", "commit": "327fff91fe6af358e990be7be1ec8b78037d2138" },
"catppuccin": { "branch": "main", "commit": "af58927c55c9f3272c940ff02b3cee94a1249f26" },
"conform.nvim": { "branch": "master", "commit": "9fd3d5e0b689ec1bf400c53cbbec72c6fdf24081" },
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
"fzf-lua": { "branch": "main", "commit": "3ec1ffb25365a6b3d87e510b1175342a61bf91a2" },
"gitsigns.nvim": { "branch": "main", "commit": "20ad4419564d6e22b189f6738116b38871082332" },
"gruvbox-material": { "branch": "master", "commit": "834dbf21836862300ced7444db4262b796330ab7" },
"lazy.nvim": { "branch": "main", "commit": "db067881fff0fd4be8c00e5bde7492e0e1c77a2f" },
"lazydev.nvim": { "branch": "main", "commit": "01bc2aacd51cf9021eb19d048e70ce3dd09f7f93" },
"lualine.nvim": { "branch": "master", "commit": "3946f0122255bc377d14a59b27b609fb3ab25768" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "83db0174efbac2d69fd45afef269b47dfedadbe1" },
"mason.nvim": { "branch": "main", "commit": "ad7146aa61dcaeb54fa900144d768f040090bff0" },
"mini.ai": { "branch": "main", "commit": "11c57180bc9084089206e211ac7aa598bedc9673" },
"mini.icons": { "branch": "main", "commit": "284798619aed9f4c1ac1b9417b9a5e3b4b85ef3a" },
"mini.pairs": { "branch": "main", "commit": "b9aada8c0e59f2b938e98fbf4eae0799eba96ad9" },
"neo-tree.nvim": { "branch": "main", "commit": "0d0b29a529216d41173c9c5c8a8f484db5b891ba" },
"noice.nvim": { "branch": "main", "commit": "c86aea584d98be7ee1167ce4d4ef946fbd7f3ae0" },
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
"nvim-lint": { "branch": "master", "commit": "9da1fb942dd0668d5182f9c8dee801b9c190e2bb" },
"nvim-lspconfig": { "branch": "master", "commit": "a9b2fb560c4ab22c10728fd5149dbd7b62aa4f69" },
"nvim-treesitter": { "branch": "main", "commit": "9ee023538e072163cc541f29bc74214f7b0b90f6" },
"nvim-treesitter-textobjects": { "branch": "main", "commit": "1b2d85d3de6114c4bcea89ffb2cd1ce9e3a19931" },
"nvim-ts-autotag": { "branch": "main", "commit": "c4ca798ab95b316a768d51eaaaee48f64a4a46bc" },
"persistence.nvim": { "branch": "main", "commit": "51eef57272742b773468949f6bd0503ec3f83874" },
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
"rose-pine": { "branch": "main", "commit": "72a04c4065345b51b56aed4859ea1d884f734097" },
"snacks.nvim": { "branch": "main", "commit": "d569072b2e39e0078b55ea56b133fb9a30d78bad" },
"tokyonight.nvim": { "branch": "main", "commit": "4fe1b0c44f5d6ee769cdfbdffc7ccb703f53feda" },
"ts-comments.nvim": { "branch": "main", "commit": "217ab9cc137fceb6659b53790bd25e608219abe1" },
"which-key.nvim": { "branch": "main", "commit": "b4177e3eaf15fe5eb8357ebac2286d488be1ed00" }
}
-8
View File
@@ -1,8 +0,0 @@
{
"extras": [],
"install_version": 7,
"news": {
"NEWS.md": "11866"
},
"version": 8
}
-12
View File
@@ -1,12 +0,0 @@
-- Configure custom keymaps.
local keymap = vim.keymap.set
local delkeymap = vim.keymap.del
local opts = { noremap = true, silent = true }
-- Improved escape
keymap("n", "<ESC>", "<ESC>:noh<CR>", opts)
keymap("t", "<ESC><ESC>", "<C-\\><C-n>", opts)
-- Disable alt j/k to move lines (conflict with default vim motions)
delkeymap({ "i", "v" }, "<A-j>")
delkeymap({ "i", "v" }, "<A-k>")
-43
View File
@@ -1,43 +0,0 @@
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)
require("lazy").setup({
spec = {
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
{ import = "plugins" },
},
defaults = {
lazy = false,
version = false,
},
install = {},
checker = {
enabled = true,
notify = true,
},
performance = {
rtp = {
disabled_plugins = {
"gzip",
"netrwPlugin",
"tarPlugin",
"tohtml",
"tutor",
"zipPlugin",
},
},
},
})
-15
View File
@@ -1,15 +0,0 @@
-- Set some custom options.
local opt = vim.o
local global = vim.g
-- Set target text width for gww to 60.
opt.tw = 60
-- Use the internal clipboard.
opt.clipboard = ""
-- Use original gruvbox theme.
global.gruvbox_material_foreground = "original"
-- Disable snack animations.
global.snacks_animate = false
+39
View File
@@ -0,0 +1,39 @@
local function run_task(cmd)
local buf = vim.api.nvim_create_buf(true, true)
vim.api.nvim_buf_set_name(buf, "just://" .. cmd)
vim.notify("󰑮 Running: " .. cmd)
vim.api.nvim_buf_call(buf, function()
vim.fn.jobstart(cmd, {
term = true,
on_exit = function(_, code)
if code == 0 then
vim.notify("󰄬 " .. cmd .. " success")
vim.schedule(function()
pcall(vim.api.nvim_buf_delete, buf, { force = true })
end)
else
vim.notify("󰅚 " .. cmd .. " failed (" .. code .. ")", 4)
end
end,
})
end)
end
function pick_just_task()
local obj = vim.system({ "just", "--summary" }, { text = true }):wait()
if obj.code ~= 0 or not obj.stdout or obj.stdout == "" then
return vim.notify("No recipes or justfile found", 3)
end
local recipes = vim.split(vim.trim(obj.stdout), "%s+")
require("mini.pick").start({
source = {
items = recipes,
name = "󱁤 Just Tasks",
choose = function(choice)
run_task("just " .. choice)
end,
},
})
end
-9
View File
@@ -1,9 +0,0 @@
-- Configure rose-pine and gruvbox-material colorschemes.
return {
{ "rose-pine/neovim", name = "rose-pine" },
{ "sainnhe/gruvbox-material" },
{
"LazyVim/LazyVim",
opts = { colorscheme = "gruvbox-material" },
},
}
-25
View File
@@ -1,25 +0,0 @@
-- Disable unused plugins and functionality.
return {
{
-- Disable the dashboard.
"folke/snacks.nvim",
opts = {
dashboard = { enabled = false },
notifier = { level = vim.log.levels.WARN },
},
},
{
-- Disable inline hints by default.
"neovim/nvim-lspconfig",
opts = {
inlay_hints = { enabled = false },
},
},
-- Disable unused plugins.
{ "folke/flash.nvim", enabled = false },
{ "folke/todo-comments.nvim", enabled = false },
{ "folke/trouble.nvim", enabled = false },
{ "MagicDuck/grug-far.nvim", enabled = false },
{ "akinsho/bufferline.nvim", enabled = false },
}
+13
View File
@@ -0,0 +1,13 @@
local M = {}
--- Opens a TUI application in a new scratch buffer and deletes the buffer on exit.
function M.open_terminal_app(cmd)
vim.cmd("enew")
vim.fn.termopen(cmd, {
on_exit = function()
vim.cmd("bdelete!")
end,
})
end
return M
+36
View File
@@ -0,0 +1,36 @@
{
"plugins": {
"arborist.nvim": {
"rev": "fdeef56c2840c6772b9f68c5774ed87e9340ec7d",
"src": "https://github.com/arborist-ts/arborist.nvim"
},
"codecompanion.nvim": {
"rev": "635f001598d811c6ea256bc863b3d503c3a88d43",
"src": "https://github.com/olimorris/codecompanion.nvim"
},
"conform.nvim": {
"rev": "619363c30309d29ffa631e67c8183f2a72caa373",
"src": "https://github.com/stevearc/conform.nvim"
},
"kanagawa.nvim": {
"rev": "bb85e4bfc8d89b0e62c8fa53ccdd13d12e2f77b3",
"src": "https://github.com/rebelot/kanagawa.nvim"
},
"mason.nvim": {
"rev": "2a6940af80375532e5e9e7c1f2fc6319a1b7a69d",
"src": "https://github.com/mason-org/mason.nvim"
},
"mini.nvim": {
"rev": "c594be5b095204e99473825ec2dee872e7409a4d",
"src": "https://github.com/nvim-mini/mini.nvim"
},
"nvim-lspconfig": {
"rev": "bfcc0171a43f22afa61d927ffe9fcb6cb85dc99e",
"src": "https://github.com/neovim/nvim-lspconfig"
},
"plenary.nvim": {
"rev": "74b06c6c75e4eeb3108ec01852001636d85a932b",
"src": "https://github.com/nvim-lua/plenary.nvim"
}
}
}
+57
View File
@@ -0,0 +1,57 @@
-- General =====================================================================
vim.g.mapleader = ' ' -- Use `<Space>` as <Leader> key
vim.o.undofile = true -- Enable persistent undo
-- UI ==========================================================================
vim.o.breakindent = true -- Indent wrapped lines to match line start
vim.o.breakindentopt = 'list:-1' -- Add padding for lists (if 'wrap' is set)
vim.o.cursorline = true -- Enable current line highlighting
vim.o.linebreak = true -- Wrap lines at 'breakat' (if 'wrap' is set)
vim.o.list = true -- Show helpful text indicators
vim.o.number = true -- Show line numbers
vim.o.pumheight = 10 -- Make popup menu smaller
vim.o.pummaxwidth = 100 -- Make popup menu not too wide
vim.o.shortmess = 'CFOSWaco' -- Disable some built-in completion messages
vim.o.signcolumn = 'yes' -- Always show signcolumn (less flicker)
vim.o.splitbelow = true -- Horizontal splits will be below
vim.o.splitkeep = 'screen' -- Reduce scroll during window split
vim.o.splitright = true -- Vertical splits will be to the right
vim.o.wrap = false -- Don't visually wrap lines (toggle with \w)
vim.o.cmdheight = 0 -- Hide the command line when not in use.
-- Editing =====================================================================
vim.o.expandtab = true -- Convert tabs to spaces
vim.o.formatoptions = 'rqnl1j' -- Improve comment editing
vim.o.ignorecase = true -- Ignore case during search
vim.o.infercase = true -- Infer case in built-in completion
vim.o.shiftwidth = 2 -- Use this number of spaces for indentation
vim.o.smartcase = true -- Respect case if search pattern has upper case
vim.o.spelloptions = 'camel' -- Treat camelCase word parts as separate words
vim.o.tabstop = 2 -- Show tab as this number of spaces
vim.o.virtualedit = 'block' -- Allow going past end of line in blockwise mode
-- Pattern for a start of numbered list (used in `gw`).
vim.o.formatlistpat = [[^\s*[0-9\-\+\*]\+[\.\)]*\s\+]]
-- Built-in completion
vim.o.complete = '.,w,b,kspell' -- Use less sources
vim.o.completeopt = 'menuone,noselect,fuzzy,nosort' -- Use custom behavior
vim.o.completetimeout = 100 -- Limit sources delay
-- Autocommands ================================================================
Config.autocmd('TextYankPost', '*', function() vim.hl.hl_op() end, 'Highlight yanked text')
Config.autocmd('TermOpen', '*', function() vim.cmd('startinsert') end, 'Start insert mode when terminal opens')
-- Diagnostics =================================================================
Config.later(function()
vim.diagnostic.config({
signs = { priority = 9999, severity = { min = 'WARN', max = 'ERROR' } },
underline = { severity = { min = 'HINT', max = 'ERROR' } },
virtual_lines = false,
virtual_text = {
current_line = true,
severity = { min = 'ERROR', max = 'ERROR' },
},
update_in_insert = false,
})
end)
+109
View File
@@ -0,0 +1,109 @@
-- Clues =======================================================================
Config.leader_group_clues = {
{ mode = "n", keys = "<Leader>a", desc = "+AI" },
{ mode = "n", keys = "<Leader>b", desc = "+Buffer" },
{ mode = "n", keys = "<Leader>d", desc = "+Debug" },
{ mode = "n", keys = "<Leader>e", desc = "+Explore" },
{ mode = "n", keys = "<Leader>f", desc = "+Find" },
{ mode = "n", keys = "<Leader>g", desc = "+Git" },
{ mode = "n", keys = "<Leader>h", desc = "+Http" },
{ mode = "n", keys = "<Leader>l", desc = "+Language" },
{ mode = "n", keys = "<Leader>r", desc = "+Run" },
{ mode = "n", keys = "<Leader>s", desc = "+Session" },
{ mode = "n", keys = "<Leader>t", desc = "+Terminal" },
{ mode = "x", keys = "<Leader>g", desc = "+Git" },
{ mode = "x", keys = "<Leader>l", desc = "+Language" },
}
-- Helpers =====================================================================
local nmap = function(lhs, rhs, desc) vim.keymap.set("n", lhs, rhs, { desc = desc }) end
local nmap_leader = function(suffix, rhs, desc) vim.keymap.set("n", "<Leader>" .. suffix, rhs, { desc = desc }) end
local xmap_leader = function(suffix, rhs, desc) vim.keymap.set("x", "<Leader>" .. suffix, rhs, { desc = desc }) end
local function lazy_setup(name, action)
return function()
if Config and type(Config["setup_" .. name]) == "function" then
Config["setup_" .. name]()
end
action()
end
end
-- AI =====================================================================
nmap_leader("aa", lazy_setup("codecompanion", function() require("codecompanion").toggle_chat() end),
"Open CodeCompanion")
-- Buffers =====================================================================
nmap_leader("bd", function() vim.cmd("bd") end, "Delete")
nmap_leader("bD", function() vim.cmd("bd!") end, "Delete!")
nmap_leader("bw", function() vim.cmd("bw") end, "Wipeout")
nmap_leader("bW", function() vim.cmd("bw!") end, "Wipeout!")
nmap_leader("bo", function() vim.cmd("%bd|e#") end, "Close all but current")
-- Debug =====================================================================
nmap_leader("db", lazy_setup("dap", function() require("dap").toggle_breakpoint() end), "Toggle Breakpoint")
nmap_leader("dc", lazy_setup("dap", function() require("dap").continue() end), "Run/Continue")
nmap_leader("dC", lazy_setup("dap", function() require("dap").run_to_cursor() end), "Run to Cursor")
nmap_leader("de", lazy_setup("dap", function() require("dap.ui.widgets").hover() end), "Inspect")
nmap_leader("dt", lazy_setup("dap", function() require("dap").terminate() end), "Terminate")
-- Explore =====================================================================
nmap_leader("ed", function() MiniFiles.open() end, "Directory")
nmap_leader("ef", function() MiniFiles.open(vim.api.nvim_buf_get_name(0)) end, "File directory")
nmap_leader("en", function() MiniNotify.show_history() end, "Notifications")
-- Find =====================================================================
nmap_leader("f/", function() MiniPick.builtin.history({ scope = "/" }) end, '"/" history')
nmap_leader("f:", function() MiniPick.builtin.history({ scope = ":" }) end, '":" history')
nmap_leader("fb", function() MiniPick.builtin.buffers() end, "Buffers")
nmap_leader("fc", function() MiniPick.builtin.git_commits() end, "Commits (all)")
nmap_leader("fC", function() MiniPick.builtin.git_commits({ path = "%" }) end, "Commits (buf)")
nmap_leader("fd", function() MiniPick.builtin.diagnostic({ scope = "all" }) end, "Diagnostic workspace")
nmap_leader("fD", function() MiniPick.builtin.diagnostic({ scope = "current" }) end, "Diagnostic buffer")
nmap_leader("ff", function() MiniPick.builtin.files() end, "Files")
nmap_leader("fg", function() MiniPick.builtin.grep_live() end, "Grep live")
nmap_leader("fG", function() MiniPick.builtin.grep({ pattern = vim.fn.expand("<cword>") }) end, "Grep current word")
nmap_leader("fh", function() MiniPick.builtin.help() end, "Help tags")
nmap_leader("fl", function() MiniPick.builtin.buf_lines({ scope = "all" }) end, "Lines (all)")
nmap_leader("fL", function() MiniPick.builtin.buf_lines({ scope = "current" }) end, "Lines (buf)")
nmap_leader("fr", function() MiniPick.builtin.resume() end, "Resume")
nmap_leader("fs", function() MiniPick.builtin.lsp({ scope = "workspace_symbol_live" }) end, "Symbols workspace (live)")
nmap_leader("fS", function() MiniPick.builtin.lsp({ scope = "document_symbol" }) end, "Symbols document")
-- Git =====================================================================
nmap_leader("go", function() MiniDiff.toggle_overlay() end, "Toggle overlay")
-- HTTP =====================================================================
nmap_leader("hr", lazy_setup("kulala", function() require("kulala").run() end), "Send HTTP request")
-- Language =====================================================================
nmap_leader("la", vim.lsp.buf.code_action, "Actions")
nmap_leader("ld", vim.diagnostic.open_float, "Diagnostic popup")
nmap_leader("lf", function() require("conform").format() end, "Format")
nmap_leader("li", vim.lsp.buf.implementation, "Implementation")
nmap_leader("lh", vim.lsp.buf.hover, "Hover")
nmap_leader("ll", vim.lsp.codelens.run, "Lens")
nmap_leader("lr", vim.lsp.buf.rename, "Rename")
nmap_leader("lR", vim.lsp.buf.references, "References")
nmap_leader("ls", vim.lsp.buf.definition, "Source definition")
nmap_leader("lt", vim.lsp.buf.type_definition, "Type definition")
xmap_leader("lf", function() require("conform").format() end, "Format selection")
-- Run =====================================================================
nmap_leader("r", function() require("just").pick_just_task() end, "Run Just Task")
-- Session =====================================================================
nmap_leader("sd", function() MiniSessions.select("delete") end, "Delete")
nmap_leader("sn", function() vim.ui.input({ prompt = "Session name: " }, MiniSessions.write) end, "New")
nmap_leader("sr", function() MiniSessions.select("read") end, "Read")
nmap_leader("sR", function() MiniSessions.restart() end, "Restart")
nmap_leader("sw", function() MiniSessions.write() end, "Write current")
-- Terminal =====================================================================
nmap_leader("tT", function() vim.cmd("horizontal term") end, "Terminal (horizontal)")
nmap_leader("tt", function() vim.cmd("vertical term") end, "Terminal (vertical)")
nmap_leader("tg", function() require("terminal").open_terminal_app("lazygit") end, "LazyGit")
nmap_leader("ts", function() require("terminal").open_terminal_app("lazysql") end, "LazySQL")
-- Overwrites =====================================================================
nmap("<Esc>", function() vim.cmd("nohlsearch") end, "Clear search highlights")
+122
View File
@@ -0,0 +1,122 @@
-- UI ==========================================================================
Config.now(function()
-- Global icon provider.
require('mini.icons').setup()
Config.later(MiniIcons.tweak_lsp_kind)
-- Notifications.
require('mini.notify').setup()
-- Start screen.
require('mini.starter').setup()
-- Statusline.
require('mini.statusline').setup()
end)
Config.later(function()
-- Git diff indicators.
require('mini.diff').setup()
-- Keymap hints.
local miniclue = require('mini.clue')
miniclue.setup({
clues = {
Config.leader_group_clues,
miniclue.gen_clues.builtin_completion(),
miniclue.gen_clues.g(),
miniclue.gen_clues.marks(),
miniclue.gen_clues.registers(),
miniclue.gen_clues.square_brackets(),
miniclue.gen_clues.windows({ submode_resize = true }),
miniclue.gen_clues.z(),
},
triggers = {
{ mode = { 'n', 'x' }, keys = '<Leader>' }, -- Leader triggers
{ mode = 'n', keys = '\\' }, -- mini.basics
{ mode = { 'n', 'x' }, keys = '[' }, -- mini.bracketed
{ mode = { 'n', 'x' }, keys = ']' },
{ mode = 'i', keys = '<C-x>' }, -- Built-in completion
{ mode = { 'n', 'x' }, keys = 'g' }, -- `g` key
{ mode = { 'n', 'x' }, keys = "'" }, -- Marks
{ mode = { 'n', 'x' }, keys = '`' },
{ mode = { 'n', 'x' }, keys = '"' }, -- Registers
{ mode = { 'i', 'c' }, keys = '<C-r>' },
{ mode = 'n', keys = '<C-w>' }, -- Window commands
{ mode = { 'n', 'x' }, keys = 's' }, -- `s` key (mini.surround, etc.)
{ mode = { 'n', 'x' }, keys = 'z' }, -- `z` key
},
})
end)
-- Editing =====================================================================
Config.later(function()
-- Enhanced text objects (a/i).
require('mini.ai').setup()
-- Auto-close brackets and quotes.
require('mini.pairs').setup()
-- Surround functionality (add/delete/replace).
require('mini.surround').setup()
end)
-- Navigation ==================================================================
Config.now_if_args(function()
-- File system explorer.
require('mini.files').setup()
local add_marks = function()
MiniFiles.set_bookmark('c', vim.fn.stdpath('config'), { desc = 'Config' })
MiniFiles.set_bookmark('w', vim.fn.getcwd, { desc = 'Working directory' })
end
Config.autocmd('User', 'MiniFilesExplorerOpen', add_marks, 'Add default marks')
end)
Config.later(function()
-- Fuzzy picker.
require('mini.pick').setup()
-- Square bracket navigation.
require('mini.bracketed').setup()
end)
-- Completion ==================================================================
Config.now_if_args(function()
-- Autocompletion and signature help.
require('mini.completion').setup({
lsp_completion = {
source_func = 'omnifunc',
auto_setup = false,
process_items = function(items, base)
return MiniCompletion.default_process_items(items, base, { kind_priority = { Text = -1 } })
end,
},
})
-- Set 'omnifunc' for LSP completion only when needed.
local on_attach = function(ev)
vim.bo[ev.buf].omnifunc = 'v:lua.MiniCompletion.completefunc_lsp'
end
Config.autocmd('LspAttach', nil, on_attach, "Set 'omnifunc'")
-- Advertise to servers that Neovim supports certain set of completion features.
vim.lsp.config('*', { capabilities = MiniCompletion.get_lsp_capabilities() })
end)
-- Workspace & Utilities =======================================================
Config.now(function()
-- Session management.
require('mini.sessions').setup()
end)
Config.now_if_args(function()
-- Miscellaneous utility functions.
require('mini.misc').setup()
MiniMisc.setup_auto_root()
MiniMisc.setup_restore_cursor()
end)
Config.later(function()
-- Extra functionality (pickers, clues).
require('mini.extra').setup()
end)
+99
View File
@@ -0,0 +1,99 @@
-- Colortheme ==================================================================
Config.now(function()
vim.pack.add({ "https://github.com/rebelot/kanagawa.nvim" })
require("kanagawa").setup({ compile = true })
vim.cmd("colo kanagawa")
end)
-- Mason ====================================================================
Config.now_if_args(function()
vim.pack.add({ "https://github.com/mason-org/mason.nvim" })
require("mason").setup()
end)
-- Treesitter ==================================================================
Config.now_if_args(function()
vim.pack.add({ "https://github.com/arborist-ts/arborist.nvim" })
require("arborist").setup()
end)
-- LSP =========================================================================
Config.now_if_args(function()
vim.pack.add({ "https://github.com/neovim/nvim-lspconfig" })
vim.lsp.enable({
"ansiblels",
"gopls",
"intelephense",
"lua_ls",
"tailwindcss",
"vtsls",
})
end)
-- Conform =====================================================================
Config.now_if_args(function()
vim.pack.add({ "https://github.com/stevearc/conform.nvim" })
require("conform").setup({
default_format_opts = { lsp_format = "fallback" },
format_on_save = {
lsp_format = "fallback",
timeout_ms = 500,
},
formatters_by_ft = {
go = { "gofumpt", "goimports" },
php = { "php_cs_fixer" },
},
})
end)
-- DAP =========================================================================
function Config.setup_dap()
if package.loaded["dap"] then
return
end
vim.pack.add({ "https://github.com/mfussenegger/nvim-dap" })
local dap = require("dap")
dap.adapters.php = {
type = "executable",
command = "node",
args = { vim.fn.stdpath("data") .. "/mason/packages/php-debug-adapter/extension/out/phpDebug.js" },
}
dap.adapters.go = {
type = "server",
host = "127.0.0.1",
port = "${port}",
}
end
-- Kulala ======================================================================
function Config.setup_kulala()
if package.loaded["kulala"] then
return
end
vim.pack.add({ "https://github.com/mistweaverco/kulala.nvim" })
require("kulala").setup({ default_env = "dev" })
end
-- CodeCompanion ===============================================================
function Config.setup_codecompanion()
if package.loaded["codecompanion"] then
return
end
vim.pack.add({
"https://github.com/nvim-lua/plenary.nvim",
"https://github.com/olimorris/codecompanion.nvim"
})
require("codecompanion").setup({
completion = {
provider = "native"
}
})
end