feat(nvim): updated config to use vim.pack instead of lazy
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
" Override cargo compiler defaults
|
||||
setlocal makeprg=cargo\ build\ --message-format=short
|
||||
|
||||
setlocal errorformat=
|
||||
\%f:%l:%c:\ %t%*[^:]:\ %m,
|
||||
\%f:%l:%c:\ %m,
|
||||
\%f:%l:\ %t%*[^:]:\ %m,
|
||||
\%f:%l:\ %m
|
||||
@@ -0,0 +1,2 @@
|
||||
let current_compiler = "cmake"
|
||||
CompilerSet makeprg=cmake
|
||||
@@ -0,0 +1,2 @@
|
||||
let current_compiler = "npm"
|
||||
CompilerSet makeprg=npm\ run
|
||||
@@ -0,0 +1,30 @@
|
||||
vim.api.nvim_buf_set_keymap(
|
||||
0,
|
||||
"n",
|
||||
"<CR>",
|
||||
"<cmd>lua require('kulala').run()<cr>",
|
||||
{ noremap = true, silent = true, desc = "Execute the request" }
|
||||
)
|
||||
|
||||
vim.api.nvim_buf_set_keymap(
|
||||
0,
|
||||
"n",
|
||||
"[",
|
||||
"<cmd>lua require('kulala').jump_prev()<cr>",
|
||||
{ noremap = true, silent = true, desc = "Jump to the previous request" }
|
||||
)
|
||||
vim.api.nvim_buf_set_keymap(
|
||||
0,
|
||||
"n",
|
||||
"]",
|
||||
"<cmd>lua require('kulala').jump_next()<cr>",
|
||||
{ noremap = true, silent = true, desc = "Jump to the next request" }
|
||||
)
|
||||
|
||||
vim.api.nvim_buf_set_keymap(
|
||||
0,
|
||||
"n",
|
||||
"<leader>i",
|
||||
"<cmd>lua require('kulala').inspect()<cr>",
|
||||
{ noremap = true, silent = true, desc = "Inspect the current request" }
|
||||
)
|
||||
@@ -0,0 +1,163 @@
|
||||
-- Steve Beaulac nvim configuration using kickstart git: 2ba39c6 --
|
||||
vim.g.mapleader = ' '
|
||||
vim.g.maplocalleader = ' '
|
||||
|
||||
vim.g.have_nerd_fonts = true
|
||||
|
||||
-- set <space> as my leader key
|
||||
vim.g.autoformat = true
|
||||
|
||||
-- vim.g.root_spec = { "lsp", { ".git", "lua" }, "cwd" }
|
||||
|
||||
vim.g.editorconfig = true
|
||||
|
||||
vim.wo.number = true
|
||||
|
||||
vim.opt.background = "dark"
|
||||
vim.opt.backup = false
|
||||
vim.opt.clipboard:append("unnamedplus")
|
||||
vim.opt.modifiable = true
|
||||
vim.opt.cmdheight = 1
|
||||
vim.opt.completeopt = { 'menuone', 'noinsert', 'noselect', 'fuzzy', 'popup' }
|
||||
vim.opt.conceallevel = 0
|
||||
-- vim.opt.concealcursor = ""
|
||||
vim.opt.encoding = "UTF-8"
|
||||
vim.opt.lazyredraw = true
|
||||
vim.opt.redrawtime = 10000
|
||||
vim.opt.maxmempattern = 20000
|
||||
vim.opt.synmaxcol = 300
|
||||
vim.opt.pumheight = 10
|
||||
vim.opt.pumblend = 10
|
||||
vim.opt.winblend = 0
|
||||
vim.opt.hlsearch = true
|
||||
vim.opt.breakindent = true
|
||||
vim.opt.ignorecase = true
|
||||
vim.opt.backspace = "indent,eol,start"
|
||||
vim.opt.formatoptions = "jcroqlnt"
|
||||
vim.opt.grepformat = "%f:%l:%c:%m"
|
||||
vim.opt.grepprg = "rg --vimgrep"
|
||||
vim.opt.ignorecase = true
|
||||
vim.opt.inccommand = "split"
|
||||
vim.opt.list = true
|
||||
vim.opt.listchars = { tab = "» ", trail = "·", nbsp = "␣" }
|
||||
vim.opt.mouse = "a"
|
||||
vim.opt.pumblend = 10
|
||||
vim.opt.pumheight = 10
|
||||
vim.opt.showmode = false
|
||||
vim.opt.showmatch = true
|
||||
vim.opt.showtabline = 0
|
||||
vim.opt.smartcase = true
|
||||
vim.opt.smartindent = true
|
||||
vim.opt.splitbelow = true
|
||||
vim.opt.splitright = true
|
||||
-- vim.opt.splitkeep = "screen"
|
||||
vim.opt.swapfile = false
|
||||
vim.opt.termguicolors = true
|
||||
vim.opt.undofile = true
|
||||
vim.opt.undolevels = 10000
|
||||
vim.opt.updatetime = 250 -- default 250
|
||||
vim.opt.timeoutlen = 500 -- default 1000
|
||||
vim.opt.ttimeoutlen = 0
|
||||
-- vim.opt.timeout = false
|
||||
vim.opt.autoread = true
|
||||
vim.opt.autowrite = false
|
||||
vim.opt.autochdir = false
|
||||
vim.opt.writebackup = false
|
||||
vim.opt.expandtab = true
|
||||
vim.opt.shiftround = true
|
||||
vim.opt.shiftwidth = 4
|
||||
vim.opt.softtabstop = 4
|
||||
vim.opt.tabstop = 4
|
||||
vim.opt.hidden = true
|
||||
vim.opt.shortmess:append({ W = true, I = true, c = true, C = true })
|
||||
vim.opt.spelllang = { "en" }
|
||||
vim.opt.selection = "inclusive"
|
||||
vim.opt.cursorline = true
|
||||
vim.opt.number = true
|
||||
vim.opt.relativenumber = true
|
||||
vim.opt.laststatus = 3
|
||||
vim.opt.showcmd = false
|
||||
vim.opt.ruler = false
|
||||
vim.opt.numberwidth = 4
|
||||
vim.opt.signcolumn = "yes"
|
||||
vim.opt.wrap = false
|
||||
vim.opt.scrolloff = 8
|
||||
vim.opt.sidescrolloff = 8
|
||||
vim.opt.shell = "/bin/bash"
|
||||
vim.opt.sessionoptions = { "blank", "buffers", "curdir", "tabpages", "winsize", "winpos", "terminal", "localoptions", "help", "skiprtp", "folds" }
|
||||
vim.opt.virtualedit = "block"
|
||||
vim.opt.wildmode = "longest:full,full"
|
||||
vim.opt.diffopt:append("linematch:60")
|
||||
|
||||
vim.opt.winminwidth = 5
|
||||
-- vim.opt.hidden = false
|
||||
-- vim.opt.cindent = true
|
||||
-- vim.opt.autoindent = true
|
||||
|
||||
if vim.fn.has("nvim-0.10") == 1 then
|
||||
vim.opt.smoothscroll = true
|
||||
end
|
||||
|
||||
vim.opt.foldmethod = "expr"
|
||||
vim.opt.foldexpr = "v:lua.vim.treesitter.foldexpr()"
|
||||
vim.opt.foldlevel = 99
|
||||
vim.opt.errorbells = false
|
||||
vim.opt.belloff = "all"
|
||||
vim.opt.undodir = vim.fn.stdpath('data') .. "/undodir"
|
||||
vim.opt.incsearch = true
|
||||
vim.opt.fillchars = { eob = " " }
|
||||
vim.opt.iskeyword:append("-")
|
||||
vim.opt.path:append("**")
|
||||
vim.opt.colorcolumn = "100"
|
||||
|
||||
vim.diagnostic.config({
|
||||
virtual_text = { current_line = true }
|
||||
})
|
||||
|
||||
-- Lazy plugin manager
|
||||
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', lazyrepo, '--branch=stable', lazypath }
|
||||
if vim.v.shell_error ~= 0 then
|
||||
error('Error cloning lazy.nvim:\n' .. out)
|
||||
end
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
require("lazy").setup({
|
||||
spec = {
|
||||
{ import = "plugins" }
|
||||
},
|
||||
rocks = {
|
||||
enabled = false,
|
||||
hererocks = false,
|
||||
},
|
||||
checker = {
|
||||
enabled = true,
|
||||
notify = false,
|
||||
},
|
||||
change_detection = {
|
||||
notify = false,
|
||||
},
|
||||
})
|
||||
|
||||
vim.g.lazyvim_check_order = false
|
||||
|
||||
|
||||
require("config.keymaps")
|
||||
require("config.scripts")
|
||||
|
||||
-- When Nvim is idle or you switch focus/buffers, check if files changed
|
||||
vim.api.nvim_create_autocmd({ "FocusGained", "BufEnter", "CursorHold", "CursorHoldI" }, {
|
||||
pattern = "*",
|
||||
command = "checktime",
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "VeryLazy",
|
||||
callback = function()
|
||||
require("config.autocmds")
|
||||
end,
|
||||
})
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"gCopyright": {
|
||||
"prefix": "copy",
|
||||
"description": "Generic Copyright",
|
||||
"body": [
|
||||
"Copyright (c) ${CURRENT_YEAR} ${1:Author} <${2:email}>. All Rights Reserved.",
|
||||
"$0"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
{
|
||||
"Starter Template": {
|
||||
"prefix": "vsTaskHeader",
|
||||
"body": [
|
||||
"{",
|
||||
"\t\"version\": \"2.0.0\",",
|
||||
"\t\"tasks\": [",
|
||||
"\t\t$0",
|
||||
"\t]",
|
||||
"}"
|
||||
],
|
||||
"scope": "json"
|
||||
},
|
||||
"Tasks": {
|
||||
"prefix": "vsTasks",
|
||||
"body": [
|
||||
"{",
|
||||
"\t\"label\": \"$1\",",
|
||||
"\t\"type\": \"shell\",",
|
||||
"\t\"command\": \"$2\",",
|
||||
"\t\"args\": [ $3 ],",
|
||||
"\t\"group\": {",
|
||||
"\t\t\"kind\": \"build\",",
|
||||
"\t\t\"isDefault\": true",
|
||||
"\t}$0",
|
||||
"}"
|
||||
],
|
||||
"scope": "json"
|
||||
},
|
||||
"Presentation": {
|
||||
"prefix": "presentation",
|
||||
"body": [
|
||||
"\"presentation\": {",
|
||||
"\t\"reveal\": \"always\",",
|
||||
"\t\"panel\": \"new\",",
|
||||
"}"
|
||||
],
|
||||
"scope": "json"
|
||||
},
|
||||
"ProblemMatcher": {
|
||||
"prefix": "problemMatcher",
|
||||
"body": [
|
||||
"\"problemMatcher\": [",
|
||||
"\t$0",
|
||||
"]"
|
||||
],
|
||||
"scope": "json"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"name": "sjb_snippets",
|
||||
"contributes": {
|
||||
"snippets": [
|
||||
{
|
||||
"language": [
|
||||
"json"
|
||||
],
|
||||
"path": "./json.json"
|
||||
},
|
||||
{
|
||||
"language": [
|
||||
"rust",
|
||||
"global",
|
||||
"all"
|
||||
],
|
||||
"path": "./copyright.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
-- Keymaps for better default experience
|
||||
-- See `:help vim.keymap.set()`
|
||||
--vim.keymap.set({ 'n', 'v' }, '<Space>', '<Nop>', { silent = true })
|
||||
|
||||
-- Remap for dealing with word wrap
|
||||
vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
|
||||
vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
|
||||
|
||||
vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv")
|
||||
vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv")
|
||||
|
||||
-- save file
|
||||
-- vim.keymap.set({ "i", "x", "n", "s" }, "<C-s>", "<cmd>w<cr><esc>", { desc = "Save file" })
|
||||
-- vim.keymap.set({ "i", "x", "n", "s" }, "<C-x><C-s>", "<cmd>:qall<cr>", { desc = "Save file" })
|
||||
|
||||
-- better indenting
|
||||
vim.keymap.set("v", "<", "<gv")
|
||||
vim.keymap.set("v", ">", ">gv")
|
||||
|
||||
-- better jumps
|
||||
vim.keymap.set("n", "<C-d>", "<C-d>zz")
|
||||
vim.keymap.set("n", "<C-u>", "<C-u>zz")
|
||||
vim.keymap.set("n", "<C-f>", "<C-f>zz")
|
||||
vim.keymap.set("n", "<C-b>", "<C-b>zz")
|
||||
|
||||
vim.keymap.set("i", "<C-f>", "<C-x><C-f>", { noremap = true, silent = true })
|
||||
vim.keymap.set("i", "<C-b>", "<C-x><C-b>", { noremap = true, silent = true })
|
||||
vim.keymap.set("i", "<C-l>", "<C-x><C-l>", { noremap = true, silent = true })
|
||||
|
||||
-- Paste over currently selected text without yanking it
|
||||
vim.keymap.set("v", "p", '"_dP')
|
||||
|
||||
vim.keymap.set("n", "<leader>p", [["_dP]], { desc = "Paste over currently selected text without yanking it" })
|
||||
|
||||
vim.keymap.set("n", "<leader>Y", [["+Y]], { noremap = true, silent = true })
|
||||
vim.keymap.set({ "n", "v" }, "<leader>y", [["+y]], { noremap = true, silent = true })
|
||||
|
||||
vim.keymap.set({"n", "v"}, "<leader>d", [["_d]], { noremap = true, silent = true })
|
||||
|
||||
-- new file
|
||||
vim.keymap.set("n", "<leader>bn", "<cmd>enew<cr>", { desc = "New File" })
|
||||
-- vim.keymap.set("n", "<leader>bd", "<cmd>bdelete<cr>", { desc = "Unload Buffer" })
|
||||
|
||||
vim.keymap.set("n", "<leader>`", "<cmd>e #<cr>", { desc = "Switch to Other Buffer" })
|
||||
vim.keymap.set("n", "<leader>bc", "<cmd>tabclose<cr>", { desc = "Close Tab" })
|
||||
|
||||
-- Clear search with <esc>
|
||||
vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<cr>', { desc = "clear hlsearch" })
|
||||
-- vim.keymap.set("n", "<leader><esc>", "<cmd>nohlsearch<cr>", { desc = "clear hlsearch" })
|
||||
|
||||
-- Diagnostic keymaps
|
||||
vim.keymap.set('n', '<leader>cl', vim.diagnostic.setloclist, { desc = 'Send diagnostic to location list' })
|
||||
vim.keymap.set("n", "<leader>cq", vim.diagnostic.setqflist, { desc = "Send diagnostic to Quickfix" })
|
||||
-- vim.keymap.set("n", "<leader>gq", "<cmd>copen<cr>", { desc = "Quickfix List" })
|
||||
-- vim.keymap.set("n", "<leader>gl", "<cmd>lopen<cr>", { desc = "Location List" })
|
||||
|
||||
vim.keymap.set('n', '<leader>eb', "<cmd>.w !bash -e<cr>", { desc = "Send line to bash" })
|
||||
vim.keymap.set('n', '<leader>eB', "<cmd>%w !bash -e<cr>", { desc = "Send buffer to bash" })
|
||||
vim.keymap.set('n', '<leader>e.', "<cmd>.!bash -e<cr>", { desc = "Execute current line" })
|
||||
vim.keymap.set('n', '<leader>e%', "<cmd>% !bash -e<cr>", { desc = "Execute current buffer" })
|
||||
vim.keymap.set('n', '<leader>ex', "<cmd>!chmod +x %<cr>", { desc = "Make file executable" })
|
||||
|
||||
vim.keymap.set('n', "<leader>eL", "<cmd>source %<cr>", { desc = "Source current buffer" })
|
||||
vim.keymap.set('n', "<leader>el", "<cmd>.lua<cr>", { desc = "Source current line" })
|
||||
vim.keymap.set('v', "<leader>el", "<cmd>lua<cr>", { desc = "Source current line" })
|
||||
vim.keymap.set('n', '<leader>xu', '<cmd>Lazy sync<cr>', { desc = 'Lazy sync' })
|
||||
|
||||
|
||||
vim.keymap.set("n", "<leader>cx", function()
|
||||
local file = vim.fn.expand "%"
|
||||
local line = vim.fn.line "."
|
||||
vim.fn.setreg("+", string.format("%s:%d", file, line))
|
||||
vim.notify "Copied line reference to clipboard"
|
||||
end, { desc = "Copy line reference to clipboard" })
|
||||
|
||||
vim.keymap.set("n", "<leader>ktn", require('tasks').create_new_task, { desc = "create new task" } )
|
||||
vim.keymap.set("n", "<leader>kts", require('tasks').start_task, { desc = "start task" } )
|
||||
vim.keymap.set("n", "<leader>kte", require('tasks').stop_task, { desc = "stop task" } )
|
||||
@@ -0,0 +1,17 @@
|
||||
return {
|
||||
name = "CMake Build",
|
||||
builder = function()
|
||||
return {
|
||||
cmd = { "cmake" },
|
||||
args = { "--build", "build", "--target", "all" },
|
||||
components = {
|
||||
{ "on_output_quickfix", set_diagnostics = true },
|
||||
"on_result_diagnostics",
|
||||
"default",
|
||||
},
|
||||
}
|
||||
end,
|
||||
condition = {
|
||||
filetype = { "cpp", "c" },
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
return {
|
||||
name = "CMake Create",
|
||||
builder = function()
|
||||
return {
|
||||
cmd = { "cmake" },
|
||||
args = { "-B", "build", "-S", "." },
|
||||
components = {
|
||||
{ "on_output_quickfix", set_diagnostics = true },
|
||||
"on_result_diagnostics",
|
||||
"default",
|
||||
},
|
||||
}
|
||||
end,
|
||||
condition = {
|
||||
filetype = { "cpp", "c" },
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
return { "user.cmake_create", "user.cmake_build" }
|
||||
@@ -0,0 +1,34 @@
|
||||
local M = {}
|
||||
|
||||
M.problem_patterns = {
|
||||
["$rustc"] = {
|
||||
{
|
||||
regexp = "^(error|warning)(\\[E\\d+\\])*:(.*)$",
|
||||
message = 3
|
||||
},
|
||||
{
|
||||
regexp = "^\\s+-+>\\s*([^:]*):(\\d+):(\\d+)$",
|
||||
kind = "location",
|
||||
file = 1,
|
||||
line = 2,
|
||||
column = 3
|
||||
},
|
||||
{
|
||||
regexp = "^(\\s|\\d)+(\\||=).*$"
|
||||
},
|
||||
{
|
||||
regexp = "^$"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
M.problem_matchers = {
|
||||
["$rustc"] = {
|
||||
fileLocation = { "relative", "${cwd}" },
|
||||
pattern = "$rustc",
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
return M
|
||||
|
||||
@@ -12,7 +12,6 @@ return {
|
||||
opts = {},
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
"franco-ruggeri/codecompanion-spinner.nvim",
|
||||
"ravitemer/codecompanion-history.nvim",
|
||||
"cairijun/codecompanion-agentskills.nvim",
|
||||
@@ -483,22 +483,6 @@ return {
|
||||
},
|
||||
opts = {
|
||||
notify_on_error = false,
|
||||
-- format_on_save = function(bufnr)
|
||||
-- -- Disable "format_on_save lsp_fallback" for languages that don't
|
||||
-- -- have a well standardized coding style. You can add additional
|
||||
-- -- languages here or re-enable it for the disabled ones.
|
||||
-- local disable_filetypes = { c = true, cpp = true }
|
||||
-- local lsp_format_opt
|
||||
-- if disable_filetypes[vim.bo[bufnr].filetype] then
|
||||
-- lsp_format_opt = 'never'
|
||||
-- else
|
||||
-- lsp_format_opt = 'fallback'
|
||||
-- end
|
||||
-- return {
|
||||
-- timeout_ms = 500,
|
||||
-- lsp_format = lsp_format_opt,
|
||||
-- }
|
||||
-- end,
|
||||
formatters = {
|
||||
shfmt = {
|
||||
prepend_args = { "-i", "2", "-ci" },
|
||||
@@ -580,7 +564,8 @@ return {
|
||||
}
|
||||
},
|
||||
{
|
||||
"sindrets/diffview.nvim",
|
||||
"dlyongemallo/diffview.nvim",
|
||||
--"sindrets/diffview.nvim",
|
||||
},
|
||||
{
|
||||
"NicolasGB/jj.nvim",
|
||||
@@ -688,6 +673,7 @@ return {
|
||||
{ 'WhoIsSethDaniel/mason-tool-installer.nvim', lazy = true },
|
||||
{
|
||||
'neovim/nvim-lspconfig',
|
||||
lazy = false,
|
||||
dependencies = {
|
||||
{ 'SmiteshP/nvim-navic', lazy = true },
|
||||
},
|
||||
@@ -704,11 +690,7 @@ return {
|
||||
group = vim.api.nvim_create_augroup('kickstart-lsp-attach', { clear = true }),
|
||||
callback = function(event)
|
||||
local function client_supports_method(client, method, bufnr)
|
||||
if vim.fn.has 'nvim-0.11' == 1 then
|
||||
return client:supports_method(method, bufnr)
|
||||
else
|
||||
return client.supports_method(method, { bufnr = bufnr })
|
||||
end
|
||||
return client:supports_method(method, bufnr)
|
||||
end
|
||||
|
||||
local client = vim.lsp.get_client_by_id(event.data.client_id)
|
||||
@@ -804,31 +786,63 @@ return {
|
||||
}
|
||||
},
|
||||
-- csharp_ls = {},
|
||||
zls= {},
|
||||
clangd= {
|
||||
zls = {},
|
||||
clangd = {
|
||||
settings = {
|
||||
["clang"] = {
|
||||
cmd = { "clangd", "--background-index", "--compile-commands-dir=" .. vim.loop.cwd() .. "/build" },
|
||||
}
|
||||
}
|
||||
},
|
||||
rust_analyzer={},
|
||||
rust_analyzer= {
|
||||
settings = {
|
||||
['rust-analyzer'] = {
|
||||
cargo = {
|
||||
allFeatures = true,
|
||||
},
|
||||
checkOnSave = true,
|
||||
check = {
|
||||
command = "clippy",
|
||||
},
|
||||
procMacro = {
|
||||
enable = true,
|
||||
},
|
||||
lens = {
|
||||
debug = { enable = true },
|
||||
enable = true,
|
||||
implementations = { enable = true },
|
||||
references = {
|
||||
adt = { enable = true },
|
||||
enumVariant = { enable = true },
|
||||
method = { enable = true },
|
||||
trait = { enable = true },
|
||||
},
|
||||
run = { enable = true },
|
||||
updateTest = { enable = true },
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
ts_ls= {},
|
||||
html= {},
|
||||
eslint= {},
|
||||
jsonls= {},
|
||||
jdtls= {},
|
||||
-- copilot = {
|
||||
-- cmd = { "copilot-language-server", "--stdio" },
|
||||
-- init_options = {
|
||||
-- name = "Neovim",
|
||||
-- version = tostring(vim.version()),
|
||||
copilot = {
|
||||
-- settings = {
|
||||
-- ['copilot'] = {
|
||||
-- cmd = { "copilot-language-server", "--stdio" },
|
||||
-- init_options = {
|
||||
-- name = "Neovim",
|
||||
-- version = tostring(vim.version()),
|
||||
-- },
|
||||
-- editorPluginInfo = {
|
||||
-- name = "Neovim",
|
||||
-- version = tostring(vim.version()),
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
-- editorPluginInfo = {
|
||||
-- name = "Neovim",
|
||||
-- version = tostring(vim.version()),
|
||||
-- },
|
||||
-- },
|
||||
},
|
||||
}
|
||||
|
||||
local ensure_installed = vim.tbl_keys(servers or {})
|
||||
@@ -854,8 +868,8 @@ return {
|
||||
vim.lsp.config(server, cfg)
|
||||
vim.lsp.enable(server)
|
||||
end
|
||||
-- vim.lsp.inline_completion.enable();
|
||||
vim.lsp.enable("rust-analyzer", false)
|
||||
vim.lsp.inline_completion.enable();
|
||||
-- vim.lsp.enable("rust-analyzer", false)
|
||||
|
||||
|
||||
end
|
||||
@@ -940,82 +954,106 @@ return {
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
'mrcjkb/rustaceanvim',
|
||||
-- version = '^6', -- Recommended
|
||||
lazy = true,
|
||||
ft = {'rust'},
|
||||
opts = {
|
||||
server = {
|
||||
default_settings = {
|
||||
cargo = {
|
||||
allFeatures = false,
|
||||
loadOutDirsFromCheck = true,
|
||||
buildScripts = { enable = true },
|
||||
},
|
||||
},
|
||||
on_attach = function(_, bufnr)
|
||||
vim.keymap.set("n", "<leader>lr", function()
|
||||
vim.cmd.RustLsp("codeAction")
|
||||
end, { desc = "Code Action", buffer = bufnr })
|
||||
vim.keymap.set("n", "<leader>ld", function()
|
||||
vim.cmd.RustLsp("debuggables")
|
||||
end, { desc = "Rust Debuggables", buffer = bufnr })
|
||||
vim.keymap.set("n", "<leader>lD", function()
|
||||
vim.cmd.RustLsp("openDocs")
|
||||
end, { desc = "Open Documents", buffer = bufnr })
|
||||
vim.keymap.set("n", "<leader>lc", function()
|
||||
vim.cmd.RustLsp("openCargo")
|
||||
end, { desc = "Open Documents", buffer = bufnr })
|
||||
end,
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
vim.g.rustaceanvim = vim.tbl_deep_extend("keep", vim.g.rustaceanvim or {}, opts or {})
|
||||
end,
|
||||
},
|
||||
-- {
|
||||
-- 'mrcjkb/rustaceanvim',
|
||||
-- -- version = '^6', -- Recommended
|
||||
-- lazy = true,
|
||||
-- ft = {'rust'},
|
||||
-- opts = {
|
||||
-- server = {
|
||||
-- default_settings = {
|
||||
-- cargo = {
|
||||
-- allFeatures = false,
|
||||
-- loadOutDirsFromCheck = true,
|
||||
-- buildScripts = { enable = true },
|
||||
-- },
|
||||
-- },
|
||||
-- on_attach = function(_, bufnr)
|
||||
-- vim.keymap.set("n", "<leader>lr", function()
|
||||
-- vim.cmd.RustLsp("codeAction")
|
||||
-- end, { desc = "Code Action", buffer = bufnr })
|
||||
-- vim.keymap.set("n", "<leader>ld", function()
|
||||
-- vim.cmd.RustLsp("debuggables")
|
||||
-- end, { desc = "Rust Debuggables", buffer = bufnr })
|
||||
-- vim.keymap.set("n", "<leader>lD", function()
|
||||
-- vim.cmd.RustLsp("openDocs")
|
||||
-- end, { desc = "Open Documents", buffer = bufnr })
|
||||
-- vim.keymap.set("n", "<leader>lc", function()
|
||||
-- vim.cmd.RustLsp("openCargo")
|
||||
-- end, { desc = "Open Documents", buffer = bufnr })
|
||||
-- end,
|
||||
-- },
|
||||
-- },
|
||||
-- config = function(_, opts)
|
||||
-- vim.g.rustaceanvim = vim.tbl_deep_extend("keep", vim.g.rustaceanvim or {}, opts or {})
|
||||
-- end,
|
||||
-- },
|
||||
{
|
||||
-- Highlight, edit, and navigate code
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
build = ':TSUpdate',
|
||||
branch = 'main',
|
||||
dependencies = {
|
||||
'nvim-treesitter/nvim-treesitter-textobjects',
|
||||
-- 'p00f/nvim-ts-rainbow',
|
||||
},
|
||||
config = function()
|
||||
require('nvim-treesitter.configs').setup({
|
||||
-- Add languages to be installed here that you want installed for treesitter
|
||||
ensure_installed = {
|
||||
'c',
|
||||
"lua",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"vim",
|
||||
"vimdoc",
|
||||
"query",
|
||||
"html",
|
||||
"go",
|
||||
"bash",
|
||||
"zig",
|
||||
"typescript",
|
||||
"javascript",
|
||||
"dockerfile",
|
||||
"xml",
|
||||
"regex",
|
||||
"rust"
|
||||
},
|
||||
ignore_install = { 'org' },
|
||||
auto_install = true,
|
||||
-- disable = function(lang, buf)
|
||||
-- local max_filesize = 100 * 1024
|
||||
-- local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buff_get_name(buf))
|
||||
-- if ok and stats and stats.size > max_filesize then
|
||||
-- return true
|
||||
-- end
|
||||
-- end,
|
||||
highlight = { enable = true, },
|
||||
indent = { enable = true },
|
||||
local ts_parsers = {
|
||||
"bash",
|
||||
"dockerfile",
|
||||
"git_config", "git_rebase", "gitattributes", "gitcommit", "gitignore",
|
||||
"go", "gomod", "gosum",
|
||||
"json", "toml", "yaml",
|
||||
"lua",
|
||||
"make",
|
||||
"markdown",
|
||||
"python",
|
||||
"terraform",
|
||||
"vim", "vimdoc",
|
||||
'c',
|
||||
"lua",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"query",
|
||||
"html", "xml",
|
||||
"zig",
|
||||
"typescript", "javascript", "svelte",
|
||||
"regex",
|
||||
"rust",
|
||||
"http",
|
||||
}
|
||||
|
||||
local nts = require("nvim-treesitter")
|
||||
nts.install(ts_parsers)
|
||||
-- vim.api.nvim_create_autocmd('PackChanged', {
|
||||
-- callback = function()
|
||||
-- nts.update()
|
||||
-- end
|
||||
-- })
|
||||
|
||||
vim.api.nvim_create_autocmd("FileType", { -- enable treesitter highlighting and indents
|
||||
callback = function(args)
|
||||
local filetype = args.match
|
||||
local lang = vim.treesitter.language.get_lang(filetype)
|
||||
if vim.treesitter.language.add(lang) then
|
||||
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
|
||||
vim.treesitter.start()
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
-- vim.api.nvim_create_autocmd('FileType', {
|
||||
-- pattern = ts_parsers,
|
||||
-- callback = function()
|
||||
-- vim.treesitter.start()
|
||||
-- end,
|
||||
-- })
|
||||
end,
|
||||
},
|
||||
{
|
||||
'nvim-treesitter/nvim-treesitter-textobjects',
|
||||
branch = "main",
|
||||
init = function()
|
||||
vim.g.no_plugin_maps = true
|
||||
end,
|
||||
},
|
||||
{
|
||||
@@ -1028,7 +1066,16 @@ return {
|
||||
{
|
||||
'nvim-treesitter/nvim-treesitter-context',
|
||||
enabled = true,
|
||||
opts = { mode = "cursor", max_lines = 3 },
|
||||
config = function ()
|
||||
require("treesitter-context").setup({
|
||||
mode = "cursor",
|
||||
max_lines = 3,
|
||||
multiline_threshold = 1,
|
||||
separator = '-',
|
||||
min_window_height = 20,
|
||||
line_numbers = true,
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"mbbill/undotree",
|
||||
@@ -80,13 +80,8 @@ return {
|
||||
{
|
||||
"thunder-coding/zincoxide",
|
||||
opts = {
|
||||
-- name of zoxide binary in your "$PATH" or path to the binary
|
||||
-- the command is executed using vim.fn.system()
|
||||
-- eg. "zoxide" or "/usr/bin/zoxide"
|
||||
zincoxide_cmd = "zoxide",
|
||||
-- Kinda experimental as of now
|
||||
complete = true,
|
||||
-- Available options { "tabs", "window", "global" }
|
||||
behaviour = "tabs",
|
||||
},
|
||||
cmd = { "Z", "Zg", "Zt", "Zw" },
|
||||
@@ -178,8 +178,6 @@ return {
|
||||
{
|
||||
'stevearc/quicker.nvim',
|
||||
ft = "qf",
|
||||
---@module "quicker"
|
||||
---@type quicker.SetupOptions
|
||||
opts = {},
|
||||
},
|
||||
{
|
||||
@@ -0,0 +1,16 @@
|
||||
local ls = require("luasnip")
|
||||
local s = ls.snippet
|
||||
local t = ls.text_node
|
||||
local i = ls.insert_node
|
||||
-- local f = ls.function_node
|
||||
return {
|
||||
s({ trig = "fn", name = "Function", dscr = "Function" }, {
|
||||
t("fn "),
|
||||
i(1),
|
||||
t("() "),
|
||||
t("{\n"),
|
||||
t("\t"),
|
||||
i(0),
|
||||
t("\n}\n"),
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
local M = {}
|
||||
|
||||
local function get_current_time()
|
||||
return os.date("%H:%M")
|
||||
end
|
||||
|
||||
local function get_active_task_line()
|
||||
local lines = vim.api.nvim_buf_get_lines(0, 0, -1, false)
|
||||
local active_lines = {}
|
||||
for i, line in ipairs(lines) do
|
||||
if line:match("#status/in%-progress") then
|
||||
table.insert(active_lines, {line = line, lnum = i})
|
||||
end
|
||||
end
|
||||
|
||||
if #active_lines == 0 then
|
||||
print("No active task found (#status/in-progress).")
|
||||
return nil, "no_active"
|
||||
elseif #active_lines > 1 then
|
||||
print("Multiple active tasks found. Please ensure only one task is #status/in-progress.")
|
||||
return nil, "multiple_active"
|
||||
else
|
||||
return active_lines[1].line, active_lines[1].lnum
|
||||
end
|
||||
end
|
||||
|
||||
function M.create_new_task()
|
||||
local desc = vim.fn.input("Task Description: ")
|
||||
if desc == '' then return end
|
||||
|
||||
local project = vim.fn.input("Project (leave empty if none, e.g., '[[Project Name]]'): ")
|
||||
local priority_options = {"high", "medium", "low"}
|
||||
local priority_idx = vim.fn.inputlist("Priority:", priority_options)
|
||||
local priority = priority_options[tonumber(priority_idx)] or "medium"
|
||||
|
||||
local category_options = {"work", "meeting", "learning", "journal", "focused-work", "break"}
|
||||
local category_idx = vim.fn.inputlist("Category:", category_options)
|
||||
local category = category_options[tonumber(category_idx)] or "work"
|
||||
|
||||
local new_task_line = string.format("- [ ] %s %s #status/todo #priority/%s #%s",
|
||||
desc, project, priority, category)
|
||||
|
||||
vim.api.nvim_put({new_task_line}, "l", true, true)
|
||||
print("New task created: " .. new_task_line)
|
||||
end
|
||||
|
||||
function M.start_task()
|
||||
local current_line, lnum = get_active_task_line()
|
||||
if not current_line then return end
|
||||
|
||||
local new_line = current_line
|
||||
local current_time = get_current_time()
|
||||
|
||||
if new_line:match("start:: %d%d:%d%d") then
|
||||
print("Task already has a start time. Updating to current time.")
|
||||
new_line = new_line:gsub("start:: %d%d:%d%d", "start:: " .. current_time)
|
||||
else
|
||||
new_line = new_line .. " start:: " .. current_time
|
||||
end
|
||||
|
||||
-- Clear end time if present when starting a task again
|
||||
new_line = new_line:gsub(" end:: %d%d:%d%d", "")
|
||||
|
||||
vim.api.nvim_buf_set_lines(0, lnum - 1, lnum, false, {new_line})
|
||||
print("Task started/resumed: " .. current_time)
|
||||
end
|
||||
|
||||
function M.stop_task()
|
||||
local current_line, lnum = get_active_task_line()
|
||||
if not current_line then return end
|
||||
|
||||
local new_line = current_line
|
||||
local current_time = get_current_time()
|
||||
|
||||
if new_line:match("end:: %d%d:%d%d") then
|
||||
print("Task already has an end time. Updating to current time.")
|
||||
new_line = new_line:gsub("end:: %d%d:%d%d", "end:: " .. current_time)
|
||||
else
|
||||
new_line = new_line .. " end:: " .. current_time
|
||||
end
|
||||
|
||||
-- Option to change status to done
|
||||
local change_status = vim.fn.confirm("Change status to #status/done?", "&Yes\n&No", 2)
|
||||
if change_status == 1 then -- Yes
|
||||
new_line = new_line:gsub("#status/in%-progress", "#status/done")
|
||||
end
|
||||
|
||||
vim.api.nvim_buf_set_lines(0, lnum - 1, lnum, false, {new_line})
|
||||
print("Task stopped: " .. current_time)
|
||||
end
|
||||
|
||||
return M
|
||||
@@ -0,0 +1,143 @@
|
||||
-- When Nvim is idle or you switch focus/buffers, check if files changed
|
||||
vim.api.nvim_create_autocmd({ "FocusGained", "BufEnter", "CursorHold", "CursorHoldI" }, {
|
||||
pattern = "*",
|
||||
command = "checktime",
|
||||
})
|
||||
|
||||
-- Check if we need to reload the file when it changed
|
||||
vim.api.nvim_create_autocmd({ "FocusGained", "TermClose", "TermLeave" }, {
|
||||
desc = 'Check time',
|
||||
group = vim.api.nvim_create_augroup("sjb-checktime", { clear = true}),
|
||||
callback = function()
|
||||
if vim.o.buftype ~= 'nofile' then
|
||||
vim.cmd('checktime')
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd('TextYankPost', {
|
||||
desc = 'Highlight when yanking (copying) text',
|
||||
group = vim.api.nvim_create_augroup('sjb-highlight-yank', { clear = true }),
|
||||
callback = function()
|
||||
vim.hl.on_yank()
|
||||
end,
|
||||
})
|
||||
|
||||
-- windows to close
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = {
|
||||
"OverseerForm",
|
||||
"OverseerList",
|
||||
"floggraph",
|
||||
"fugitive",
|
||||
"git",
|
||||
"help",
|
||||
"lspinfo",
|
||||
"man",
|
||||
"neotest-output",
|
||||
"neotest-summary",
|
||||
"qf",
|
||||
"query",
|
||||
"spectre_panel",
|
||||
"startuptime",
|
||||
"toggleterm",
|
||||
"tsplayground",
|
||||
"vim",
|
||||
},
|
||||
group = vim.api.nvim_create_augroup('sjb-quick-close', { clear = true }),
|
||||
callback = function(event)
|
||||
vim.bo[event.buf].buflisted = false
|
||||
vim.keymap.set("n", "q", "<cmd>close<cr>", { buffer = event.buf, silent = true })
|
||||
end,
|
||||
})
|
||||
|
||||
-- wrap and check for spell in text filetypes
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
group = vim.api.nvim_create_augroup("sjb-wrap-spell", { clear = true }),
|
||||
pattern = { "gitcommit", "markdown" },
|
||||
callback = function()
|
||||
vim.opt_local.wrap = true
|
||||
vim.opt_local.spell = true
|
||||
end,
|
||||
})
|
||||
|
||||
-- Auto create dir when saving a file, in case some intermediate directory does not exist
|
||||
vim.api.nvim_create_autocmd({ "BufWritePre" }, {
|
||||
group = vim.api.nvim_create_augroup("sjb-auto-create-dir", { clear = true}),
|
||||
callback = function(event)
|
||||
if event.match:match("^%w%w+://") then
|
||||
return
|
||||
end
|
||||
local file = vim.loop.fs_realpath(event.match) or event.match
|
||||
vim.fn.mkdir(vim.fn.fnamemodify(file, ":p:h"), "p")
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("BufWritePost", {
|
||||
pattern = "*",
|
||||
callback = function()
|
||||
if vim.fn.isdirectory(".jj") == 1 then
|
||||
vim.fn.jobstart({"jj", "status"}, {
|
||||
on_exit = function(_, exit_code)
|
||||
if exit_code ~= 0 then
|
||||
vim.notify("jj command failed", vim.log.levels.WARN)
|
||||
end
|
||||
end,
|
||||
})
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
local gpgGroup = vim.api.nvim_create_augroup("customGpg", { clear = true })
|
||||
|
||||
vim.api.nvim_create_autocmd({ "BufReadPre", "FileReadPre" }, {
|
||||
pattern = "*.gpg",
|
||||
group = gpgGroup,
|
||||
callback = function()
|
||||
-- Make sure nothing is written to shada file while editing an encrypted file.
|
||||
vim.opt_local.shada = nil
|
||||
-- We don't want a swap file, as it writes unencrypted data to disk
|
||||
vim.opt_local.swapfile = false
|
||||
-- Switch to binary mode to read the encrypted file
|
||||
vim.opt_local.bin = true
|
||||
-- Save the current 'ch' value to a buffer-local variable
|
||||
vim.b.ch_save = vim.opt_local.ch:get()
|
||||
vim.cmd "set ch=2"
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({ "BufReadPost", "FileReadPost" }, {
|
||||
pattern = "*.gpg",
|
||||
group = gpgGroup,
|
||||
callback = function()
|
||||
vim.cmd "'[,']!gpg --decrypt 2> /dev/null"
|
||||
-- Switch to normal mode for editing
|
||||
vim.opt_local.bin = false
|
||||
-- Restore the 'ch' value from the buffer-local variable
|
||||
vim.opt_local.ch = vim.b.ch_save
|
||||
vim.cmd "unlet b:ch_save"
|
||||
vim.cmd(":doautocmd BufReadPost " .. vim.fn.expand "%:r")
|
||||
end,
|
||||
})
|
||||
|
||||
-- Convert all text to encrypted text before writing
|
||||
vim.api.nvim_create_autocmd({ "BufWritePre", "FileWritePre" }, {
|
||||
pattern = "*.gpg",
|
||||
group = gpgGroup,
|
||||
callback = function()
|
||||
-- Switch to binary mode to write the encrypted file
|
||||
vim.opt_local.bin = true
|
||||
-- So we can avoid the armor option
|
||||
vim.cmd("'[,']!gpg --default-recipient-self -e 2>/dev/null")
|
||||
end,
|
||||
})
|
||||
-- Undo the encryption so we are back in the normal text, directly after the file has been written.
|
||||
vim.api.nvim_create_autocmd({ "BufWritePost", "FileWritePost" }, {
|
||||
pattern = "*.gpg",
|
||||
group = gpgGroup,
|
||||
callback = function()
|
||||
vim.cmd("u")
|
||||
-- Switch to normal mode for editing
|
||||
vim.opt_local.bin = false
|
||||
end,
|
||||
})
|
||||
@@ -71,4 +71,5 @@ vim.keymap.set("n", "<leader>cx", function()
|
||||
local line = vim.fn.line "."
|
||||
vim.fn.setreg("+", string.format("%s:%d", file, line))
|
||||
vim.notify "Copied line reference to clipboard"
|
||||
end, { desc = "Copy line reference to clipboard" })
|
||||
end, { desc = "Copy line reference to clipboard" })
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
|
||||
function R(name)
|
||||
require("plenary.reload").reload_module(name)
|
||||
end
|
||||
|
||||
function websearch(url, o)
|
||||
-- Get visual selection or prompt for search
|
||||
local search_term
|
||||
|
||||
-- Check if there's a visual selection
|
||||
if vim.fn.mode() == 'v' or vim.fn.mode() == 'V' then
|
||||
-- Get the visual selection
|
||||
local start_pos = vim.fn.getpos("'<")
|
||||
local end_pos = vim.fn.getpos("'>")
|
||||
local lines = vim.fn.getline(start_pos[2], end_pos[2])
|
||||
local selected_text = table.concat(lines, " ")
|
||||
search_term = selected_text
|
||||
else
|
||||
search_term = (o and o.args) or vim.fn.input("Search: ")
|
||||
end
|
||||
|
||||
-- Encode the search term for URLs
|
||||
local escaped = vim.uri_encode(search_term)
|
||||
|
||||
-- Construct and execute the search URL
|
||||
local search_url = (url):format(escaped)
|
||||
|
||||
vim.ui.open(search_url)
|
||||
end
|
||||
-- Command to call the search function
|
||||
vim.api.nvim_create_user_command('DuckDuckGo', function(o) websearch('https://duckduckgo.com/?q=%s', o) end, { nargs = 1 })
|
||||
vim.api.nvim_create_user_command('Docsrs', function(o) websearch('https://docs.rs/%s', o) end, { nargs = 1})
|
||||
vim.api.nvim_create_user_command('RustStd', function(o) websearch('https://doc.rust-lang.org/std/?search=%s', o) end, { nargs = 1})
|
||||
|
||||
vim.keymap.set({ 'n', 'v'}, '<leader>sW', function() websearch('https://duckduckgo.com/?q=%s', null) end, { desc = "Search on DuckDuckGo" })
|
||||
+98
-53
@@ -1,19 +1,11 @@
|
||||
-- Steve Beaulac nvim configuration using kickstart git: 2ba39c6 --
|
||||
vim.g.mapleader = ' '
|
||||
vim.g.maplocalleader = ' '
|
||||
|
||||
vim.g.have_nerd_fonts = true
|
||||
|
||||
-- set <space> as my leader key
|
||||
vim.g.autoformat = true
|
||||
|
||||
-- vim.g.root_spec = { "lsp", { ".git", "lua" }, "cwd" }
|
||||
|
||||
vim.g.editorconfig = true
|
||||
|
||||
vim.wo.number = true
|
||||
|
||||
vim.opt.background = "dark"
|
||||
vim.opt.background = 'dark'
|
||||
vim.opt.backup = false
|
||||
vim.opt.clipboard:append("unnamedplus")
|
||||
vim.opt.modifiable = true
|
||||
@@ -114,50 +106,103 @@ vim.diagnostic.config({
|
||||
virtual_text = { current_line = true }
|
||||
})
|
||||
|
||||
-- Lazy plugin manager
|
||||
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', lazyrepo, '--branch=stable', lazypath }
|
||||
if vim.v.shell_error ~= 0 then
|
||||
error('Error cloning lazy.nvim:\n' .. out)
|
||||
end
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
require("lazy").setup({
|
||||
spec = {
|
||||
{ import = "plugins" }
|
||||
},
|
||||
rocks = {
|
||||
enabled = false,
|
||||
hererocks = false,
|
||||
},
|
||||
checker = {
|
||||
enabled = true,
|
||||
notify = false,
|
||||
},
|
||||
change_detection = {
|
||||
notify = false,
|
||||
},
|
||||
vim.filetype.add({
|
||||
extension = {
|
||||
['http'] = 'http',
|
||||
},
|
||||
})
|
||||
|
||||
vim.g.lazyvim_check_order = false
|
||||
|
||||
|
||||
require("config.keymaps")
|
||||
require("config.scripts")
|
||||
|
||||
-- When Nvim is idle or you switch focus/buffers, check if files changed
|
||||
vim.api.nvim_create_autocmd({ "FocusGained", "BufEnter", "CursorHold", "CursorHoldI" }, {
|
||||
pattern = "*",
|
||||
command = "checktime",
|
||||
vim.pack.add({
|
||||
{ src = "https://github.com/folke/snacks.nvim" },
|
||||
{ src = "https://github.com/olimorris/codecompanion.nvim" },
|
||||
{ src = 'https://github.com/L3MON4D3/LuaSnip' },
|
||||
{ src = 'https://github.com/rafamadriz/friendly-snippets' },
|
||||
{ src = 'https://github.com/MeanderingProgrammer/render-markdown.nvim' },
|
||||
{ src = 'https://github.com/Saghen/blink.cmp', version = vim.version.range('1.*') },
|
||||
{ src = 'https://github.com/cairijun/codecompanion-agentskills.nvim' },
|
||||
{ src = 'https://github.com/fang2hou/blink-copilot' },
|
||||
{ src = 'https://github.com/folke/todo-comments.nvim' },
|
||||
{ src = 'https://github.com/franco-ruggeri/codecompanion-spinner.nvim' },
|
||||
{ src = 'https://github.com/moyiz/blink-emoji.nvim' },
|
||||
{ src = 'https://github.com/nvim-lua/plenary.nvim' },
|
||||
{ src = 'https://github.com/ravitemer/codecompanion-history.nvim' },
|
||||
{ src = 'https://github.com/ttgrules/cc-adapter-copilot-cli-acp' },
|
||||
{ src = 'https://github.com/nvim-tree/nvim-web-devicons' },
|
||||
{ src = 'https://github.com/SjB/orgmode', version = 'sjb-wip' },
|
||||
{ src = 'https://github.com/nvim-treesitter/nvim-treesitter', version = 'main' },
|
||||
{ src = 'https://github.com/nvim-treesitter/nvim-treesitter-textobjects', version = 'main' },
|
||||
{ src = 'https://github.com/nvim-treesitter/nvim-treesitter-context' },
|
||||
{ src = 'https://github.com/nvim-mini/mini.extra' },
|
||||
{ src = 'https://github.com/nvim-mini/mini.ai' },
|
||||
{ src = 'https://github.com/nvim-mini/mini.move' },
|
||||
{ src = 'https://github.com/nvim-mini/mini.align' },
|
||||
{ src = 'https://github.com/nvim-mini/mini.bracketed' },
|
||||
{ src = 'https://github.com/nvim-mini/mini.operators' },
|
||||
{ src = 'https://github.com/nvim-mini/mini.surround' },
|
||||
{ src = 'https://github.com/nvim-mini/mini.splitjoin' },
|
||||
{ src = 'https://github.com/nvim-mini/mini.hipatterns' },
|
||||
{ src = 'https://github.com/nvim-mini/mini.files' },
|
||||
{ src = 'https://github.com/nvim-mini/mini.sessions' },
|
||||
{ src = 'https://github.com/mfussenegger/nvim-ansible' },
|
||||
{ src = 'https://github.com/obsidian-nvim/obsidian.nvim' },
|
||||
{ src = 'https://github.com/salkin-mada/openscad.nvim' },
|
||||
{ src = 'https://github.com/akinsho/org-bullets.nvim' },
|
||||
{ src = 'https://github.com/chipsenkbeil/org-roam.nvim' },
|
||||
{ src = 'https://github.com/iamcco/markdown-preview.nvim' },
|
||||
{ src = 'https://github.com/lervag/vimtex' },
|
||||
{ src = 'https://github.com/MeanderingProgrammer/render-markdown.nvim' },
|
||||
{ src = 'https://github.com/hat0uma/csvview.nvim' },
|
||||
{ src = 'https://github.com/j-hui/fidget.nvim' },
|
||||
{ src = 'https://github.com/utilyre/barbecue.nvim' },
|
||||
{ src = 'https://github.com/SmiteshP/nvim-navic' },
|
||||
{ src = 'https://github.com/folke/flash.nvim' },
|
||||
{ src = 'https://github.com/nvim-lualine/lualine.nvim' },
|
||||
{ src = 'https://github.com/hedyhli/outline.nvim' },
|
||||
{ src = 'https://github.com/stevearc/quicker.nvim' },
|
||||
{ src = 'https://github.com/christoomey/vim-tmux-navigator' },
|
||||
{ src = 'https://github.com/akinsho/toggleterm.nvim' },
|
||||
{ src = 'https://github.com/ten3roberts/window-picker.nvim' },
|
||||
{ src = 'https://github.com/folke/which-key.nvim' },
|
||||
{ src = 'https://github.com/al1-ce/just.nvim' },
|
||||
{ src = 'https://github.com/mistweaverco/kulala.nvim' },
|
||||
{ src = 'https://github.com/HakonHarnes/img-clip.nvim' },
|
||||
{ src = 'https://github.com/uhs-robert/sshfs.nvim' },
|
||||
{ src = 'https://github.com/esmuellert/codediff.nvim' },
|
||||
{ src = 'https://plugins.ejri.dev/mise.nvim' },
|
||||
{ src = 'https://github.com/NeogitOrg/neogit' },
|
||||
{ src = 'https://github.com/thunder-coding/zincoxide' },
|
||||
{ src = 'https://github.com/sindrets/diffview.nvim' },
|
||||
{ src = 'https://github.com/MunifTanjim/nui.nvim' },
|
||||
{ src = 'https://github.com/stevearc/conform.nvim' },
|
||||
{ src = 'https://github.com/lewis6991/gitsigns.nvim' },
|
||||
{ src = 'https://github.com/NicolasGB/jj.nvim' },
|
||||
{ src = 'https://github.com/julienvincent/hunk.nvim' },
|
||||
{ src = 'https://github.com/rafikdraoui/jj-diffconflicts' },
|
||||
{ src = 'https://github.com/Glhou/jjsigns.nvim', version = 'fix/skip-extra-lines' },
|
||||
{ src = 'https://github.com/williamboman/mason.nvim' },
|
||||
{ src = 'https://github.com/williamboman/mason-lspconfig.nvim' },
|
||||
{ src = 'https://github.com/WhoIsSethDaniel/mason-tool-installer.nvim' },
|
||||
{ src = 'https://github.com/neovim/nvim-lspconfig' },
|
||||
{ src = 'https://github.com/rcarriga/nvim-dap-ui' },
|
||||
{ src = 'https://github.com/mfussenegger/nvim-dap' },
|
||||
{ src = 'https://github.com/nvim-neotest/nvim-nio' },
|
||||
{ src = 'https://github.com/jay-babu/mason-nvim-dap.nvim' },
|
||||
{ src = 'https://github.com/Saecki/crates.nvim' },
|
||||
{ src = 'https://github.com/JoosepAlviste/nvim-ts-context-commentstring' },
|
||||
{ src = 'https://github.com/nvim-treesitter/nvim-treesitter-context' },
|
||||
{ src = 'https://github.com/mbbill/undotree' },
|
||||
{ src = 'https://github.com/Civitasv/cmake-tools.nvim' },
|
||||
{ src = 'https://github.com/folke/persistence.nvim' },
|
||||
{ src = 'https://github.com/otavioschwanck/arrow.nvim' },
|
||||
{ src = 'https://github.com/nvim-pack/nvim-spectre' },
|
||||
{ src = 'https://github.com/stevearc/overseer.nvim' },
|
||||
{ src = 'https://github.com/Davidyz/VectorCode' },
|
||||
{ src = 'https://github.com/franco-ruggeri/codecompanion-spinner.nvim' },
|
||||
{ src = 'https://github.com/ravitemer/codecompanion-history.nvim' },
|
||||
{ src = 'https://github.com/cairijun/codecompanion-agentskills.nvim' },
|
||||
{ src = 'https://github.com/ttgrules/cc-adapter-copilot-cli-acp' },
|
||||
{ src = 'https://github.com/carlos-algms/agentic.nvim' },
|
||||
{ src = 'https://github.com/zbirenbaum/copilot.lua' },
|
||||
{ src = 'https://github.com/copilotlsp-nvim/copilot-lsp' },
|
||||
{ src = 'https://github.com/PhantomYdn/fabric-ai.nvim' },
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "VeryLazy",
|
||||
callback = function()
|
||||
require("config.autocmds")
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
require('agentic').setup({
|
||||
-- Available by default: "claude-agent-acp" | "gemini-acp" | "codex-acp" | "opencode-acp" | "cursor-acp" | "auggie-acp" | "mistral-vibe-acp"
|
||||
provider = "opencode-acp", -- setting the name here is all you need to get started
|
||||
keymaps = {
|
||||
-- Keybindings for ALL buffers in the widget (chat, prompt, code, files)
|
||||
widget = {
|
||||
close = "q", -- String for a single keybinding
|
||||
change_mode = {
|
||||
{
|
||||
"<S-Tab>",
|
||||
mode = { "i", "n", "v" }, -- Specify modes for this keybinding
|
||||
},
|
||||
},
|
||||
switch_provider = "<localLeader>ras", -- Switch ACP provider
|
||||
switch_model = "<localLeader>ram", -- Switch model
|
||||
},
|
||||
|
||||
-- Keybindings for the prompt buffer only
|
||||
prompt = {
|
||||
submit = {
|
||||
"<CR>", -- Normal mode, just Enter
|
||||
{
|
||||
"<C-s>",
|
||||
mode = { "n", "v", "i" },
|
||||
},
|
||||
},
|
||||
|
||||
paste_image = {
|
||||
{
|
||||
"<localLeader>p",
|
||||
mode = { "n" },
|
||||
},
|
||||
{
|
||||
"<C-v>", -- Same as Claude-code in insert mode
|
||||
mode = { "i" },
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
-- Keybindings for diff preview navigation
|
||||
diff_preview = {
|
||||
next_hunk = "]c",
|
||||
prev_hunk = "[c",
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
vim.keymap.set({ "n", "v", "i" }, '<leader>rat', function() require("agentic").toggle() end, { desc = "Toggle Agentic Chat" })
|
||||
vim.keymap.set({ "n", "v" }, '<C-\'>', function() require("agentic").add_selection_or_file_to_context() end, { desc = "Add file or selection to Agentic to Context" })
|
||||
vim.keymap.set({ "n", "v", "i" }, '<leader>ran', function() require("agentic").new_session() end, { desc = "New Agentic Session" })
|
||||
|
||||
vim.keymap.set({ "n", "v", "i" }, '<A-i>r', function() require("agentic").restore_session() end, { desc = "Agentic Restore session" })
|
||||
vim.keymap.set({ "n" }, '<leader>rad', function() require("agentic").add_current_line_diagnostics() end, { desc = "Add current line diagnostic to Agentic" })
|
||||
vim.keymap.set({ "n" }, '<leader>raD', function() require("agentic").add_buffer_diagnostics() end, { desc = "Add all buffer diagnostics to Agentic" })
|
||||
@@ -0,0 +1,5 @@
|
||||
require('arrow').setup({
|
||||
show_icons = true,
|
||||
leader_key = ';', -- Recommended to be a single key
|
||||
buffer_leader_key = '<leader>;', -- Per Buffer Mappings
|
||||
})
|
||||
@@ -0,0 +1 @@
|
||||
require('barbecue').setup()
|
||||
@@ -0,0 +1,150 @@
|
||||
require('blink.cmp').setup({
|
||||
enabled = function()
|
||||
local filetype = vim.bo[0].filetype
|
||||
if filetype == "TelescopePrompt" or filetype == "minifiles" or filetype == "snacks_picker_input" then
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end,
|
||||
snippets = { preset = 'luasnip' },
|
||||
completion = {
|
||||
-- keyword = {
|
||||
-- -- 'prefix' will fuzzy match on the text before the cursor
|
||||
-- -- 'full' will fuzzy match on the text before *and* after the cursor
|
||||
-- -- example: 'foo_|_bar' will match 'foo_' for 'prefix' and 'foo__bar' for 'full'
|
||||
-- range = "full",
|
||||
-- },
|
||||
menu = {
|
||||
draw = {
|
||||
treesitter = { 'lsp' }
|
||||
}
|
||||
-- border = "single",
|
||||
},
|
||||
list = {
|
||||
selection = {
|
||||
preselect = false,
|
||||
auto_insert = false,
|
||||
}
|
||||
},
|
||||
documentation = {
|
||||
auto_show = true,
|
||||
auto_show_delay_ms = 500,
|
||||
-- window = {
|
||||
-- border = "single",
|
||||
-- },
|
||||
},
|
||||
ghost_text = { enabled = false },
|
||||
},
|
||||
cmdline = {
|
||||
enabled = true,
|
||||
},
|
||||
signature = { enabled = true },
|
||||
sources = {
|
||||
per_filetype = {
|
||||
org = {'orgmode'}
|
||||
},
|
||||
default = { 'orgmode', 'lsp', 'copilot', 'snippets', 'path', 'omni', 'buffer', 'codecompanion', 'markdown' },
|
||||
providers = {
|
||||
codecompanion = {
|
||||
name = "CodeCompanion" ,
|
||||
module = "codecompanion.providers.completion.blink",
|
||||
enabled = true,
|
||||
},
|
||||
orgmode = {
|
||||
name = 'Orgmode',
|
||||
module = 'orgmode.org.autocompletion.blink',
|
||||
fallbacks = { 'buffer' },
|
||||
},
|
||||
copilot = {
|
||||
name = 'copilot',
|
||||
module = 'blink-copilot',
|
||||
score_offset = 100,
|
||||
async = true,
|
||||
},
|
||||
markdown = {
|
||||
name = 'RenderMarkdown',
|
||||
module = 'render-markdown.integ.blink',
|
||||
score_offset = 80,
|
||||
},
|
||||
lsp = {
|
||||
name = 'lsp', -- IMPORTANT: use the same name as you would for nvim-cmp
|
||||
enabled = true,
|
||||
module = 'blink.cmp.sources.lsp',
|
||||
-- fallbacks = { 'snippets', 'buffer', 'path' },
|
||||
score_offset = 100,
|
||||
},
|
||||
path = {
|
||||
name = 'path', -- IMPORTANT: use the same name as you would for nvim-cmp
|
||||
module = 'blink.cmp.sources.path',
|
||||
score_offset = 50,
|
||||
fallbacks = { 'snippets', 'buffer' },
|
||||
opts = {
|
||||
trailing_slash = false,
|
||||
label_trailing_slash = true,
|
||||
get_cwd = function(context)
|
||||
return vim.fn.expand(("#%d:p:h"):format(context.bufnr))
|
||||
end,
|
||||
show_hidden_files_by_default = true,
|
||||
},
|
||||
},
|
||||
buffer = {
|
||||
name = "Buffer",
|
||||
enabled = true,
|
||||
max_items = 3,
|
||||
module = "blink.cmp.sources.buffer",
|
||||
min_keyword_length = 4,
|
||||
score_offset = 15, -- the higher the number, the higher the priority
|
||||
},
|
||||
snippets = {
|
||||
name = "snippets",
|
||||
enabled = true,
|
||||
max_items = 15,
|
||||
min_keyword_length = 2,
|
||||
module = "blink.cmp.sources.snippets",
|
||||
score_offset = 90, -- the higher the number, the higher the priority
|
||||
},
|
||||
emoji = {
|
||||
module = "blink-emoji",
|
||||
name = "Emoji",
|
||||
score_offset = 0, -- the higher the number, the higher the priority
|
||||
opts = { insert = true }, -- Insert emoji (default) or complete its name
|
||||
},
|
||||
},
|
||||
},
|
||||
appearance = {
|
||||
-- Blink does not expose its default kind icons so you must copy them all (or set your custom ones) and add Copilot
|
||||
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 = '',
|
||||
},
|
||||
},
|
||||
})
|
||||
@@ -0,0 +1,706 @@
|
||||
|
||||
vim.keymap.set({'n', 'v'}, '<leader>rct', '<cmd>CodeCompanionChat Toggle<cr>', { noremap = true, silent = true, desc = "CC Toggle" })
|
||||
vim.keymap.set({ 'n', 'v' }, '<leader>rca', '<cmd>CodeCompanionActions<cr>', { noremap = true, silent = true, desc = "CC Action" })
|
||||
vim.keymap.set({ 'n' }, '<leader>rce', '<cmd>CodeCompanion Explain<cr>', { desc = "CC Explain" })
|
||||
vim.keymap.set({ 'n' }, '<leader>rcf', '<cmd>CodeCompanion Fix code<cr>', { desc = "CC fix" })
|
||||
vim.keymap.set({ 'v' }, '<leader>rcc', '<cmd>CodeCompanionChat Add<cr>', { noremap = true, silent = true, desc = "CC Add" })
|
||||
vim.keymap.set({ 'v' }, '<leader>rcr', '<cmd>CodeCompanion Code Review<cr>', { desc = 'Code Review' })
|
||||
vim.keymap.set({ 'v' }, '<leader>rco', '<cmd>CodeCompanion Optimize Performance<cr>', { desc = 'Optimize Code' })
|
||||
vim.keymap.set({ 'v' }, '<leader>rce', '<cmd>CodeCompanion Explain Code<cr>', { desc = 'Explain Code' })
|
||||
vim.keymap.set({ 'v' }, '<leader>rcg', '<cmd>CodeCompanion Generate Tests<cr>', { desc = 'Generate Tests' })
|
||||
vim.keymap.set({ 'v' }, '<leader>rcd', '<cmd>CodeCompanion Debug Analysis<cr>', { desc = 'Debug Analysis' })
|
||||
|
||||
-- TODO: run this command
|
||||
-- build = "uv tool upgrade vectorcode", -- This helps keeping the CLI up-to-date
|
||||
vim.api.nvim_create_autocmd('PackChanged', {
|
||||
callback = function()
|
||||
vim.system({ "uv", "tool", "upgrade", "vectorcode" }, {}):wait()
|
||||
end
|
||||
})
|
||||
|
||||
local function get_abacus_key()
|
||||
local handle = io.popen("pass show abacus.ai-api")
|
||||
if not handle then return "" end
|
||||
local result = handle:read("*a")
|
||||
handle:close()
|
||||
-- Remove trailing newline that 'pass' often adds
|
||||
return result:gsub("%s+", "")
|
||||
end
|
||||
|
||||
local codecompanion = require("codecompanion")
|
||||
codecompanion.setup({
|
||||
adapters = {
|
||||
http = {
|
||||
opts = {
|
||||
show_presets = true,
|
||||
show_model_choices = true,
|
||||
},
|
||||
-- openai = function()
|
||||
-- return require("codecompanion.adapters").extend("openai", {
|
||||
-- env = { api_key = "cmd:pass show api.openai.com" }
|
||||
-- })
|
||||
-- end,
|
||||
openrouter = function()
|
||||
return require("codecompanion.adapters").extend("openai_compatible", {
|
||||
env = {
|
||||
url = "https://openrouter.ai/api",
|
||||
api_key = "OPENROUTER_API_KEY",
|
||||
chat_url = "/v1/chat/completions",
|
||||
},
|
||||
schema = {
|
||||
model = {
|
||||
default = "anthropic/claude-3.7-sonnet",
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
abacus = function()
|
||||
return require("codecompanion.adapters").extend("openai_compatible", {
|
||||
name = "abacus",
|
||||
formatted_name = "Abacus.AI",
|
||||
env = {
|
||||
url = "https://routellm.abacus.ai/v1",
|
||||
-- IMPORTANT: include /v1 in the base url
|
||||
api_key = get_abacus_key(),
|
||||
chat_url = "/chat/completions"
|
||||
},
|
||||
headers = {
|
||||
["Content-Type"] = "application/json",
|
||||
["Authorization"] = "Bearer ${api_key}",
|
||||
},
|
||||
schema = {
|
||||
model = {
|
||||
order = 1,
|
||||
mapping = "parameters",
|
||||
type = "enum",
|
||||
desc = "The model to use for chat completions.",
|
||||
default = "route-llm",
|
||||
choices = {
|
||||
-- Routing Model
|
||||
["route-llm"] = { opts = { desc = "Intelligent routing to best model" } },
|
||||
|
||||
-- OpenAI Models
|
||||
["gpt-5.2"] = { opts = { has_vision = true } },
|
||||
["gpt-5.1"] = { opts = { has_vision = true } },
|
||||
["gpt-5.1-chat-latest"] = { opts = { has_vision = true } },
|
||||
["gpt-5"] = { opts = { has_vision = true } },
|
||||
["gpt-5-mini"] = { opts = { has_vision = true } },
|
||||
["gpt-5-nano"] = { opts = { has_vision = true } },
|
||||
["gpt-4o"] = { opts = { has_vision = true } },
|
||||
["gpt-4o-mini"] = { opts = { has_vision = true } },
|
||||
["o4-mini"] = { opts = { can_reason = true } },
|
||||
["o3"] = { opts = { can_reason = true } },
|
||||
["o3-pro"] = { opts = { can_reason = true } },
|
||||
|
||||
-- Anthropic Models
|
||||
["claude-4-5-sonnet"] = { opts = { has_vision = true } },
|
||||
["claude-4-5-haiku"] = { opts = { has_vision = true } },
|
||||
["claude-4-5-opus"] = { opts = { has_vision = true } },
|
||||
["claude-3-opus"] = { opts = { has_vision = true } },
|
||||
|
||||
-- Google Models
|
||||
["gemini-3-pro"] = { opts = { has_vision = true } },
|
||||
["gemini-3-flash"] = { opts = { has_vision = true } },
|
||||
["gemini-2.5-pro"] = { opts = { has_vision = true } },
|
||||
["gemini-2.5-flash"] = { opts = { has_vision = true } },
|
||||
|
||||
-- xAI Models
|
||||
["grok-4-1-fast"] = {},
|
||||
["grok-4"] = {},
|
||||
["grok-code-fast-1"] = {},
|
||||
|
||||
-- Meta Models
|
||||
["llama-4-Maverick-17B"] = {},
|
||||
["llama-3.1-405B"] = {},
|
||||
["llama-3.1-70B"] = {},
|
||||
|
||||
-- DeepSeek Models
|
||||
["deepseek-v3.2"] = {},
|
||||
["deepseek-v3.1-Terminus"] = {},
|
||||
["deepseek-R1"] = { opts = { can_reason = true } },
|
||||
|
||||
-- Qwen Models
|
||||
["qwen-3-Max"] = {},
|
||||
["qwen3-coder-480b-a35b-instruct"] = {},
|
||||
["qwen-3-32B"] = {},
|
||||
["qwq-32B"] = { opts = { can_reason = true } },
|
||||
},
|
||||
},
|
||||
temperature = {
|
||||
order = 2,
|
||||
mapping = "parameters",
|
||||
type = "number",
|
||||
optional = true,
|
||||
default = 1.0,
|
||||
desc = "Controls randomness of output (0-2).",
|
||||
validate = function(n)
|
||||
return n >= 0 and n <= 2, "Must be between 0 and 2"
|
||||
end,
|
||||
},
|
||||
max_tokens = {
|
||||
order = 3,
|
||||
mapping = "parameters",
|
||||
type = "integer",
|
||||
optional = true,
|
||||
default = nil,
|
||||
desc = "Maximum tokens to generate.",
|
||||
validate = function(n)
|
||||
return n > 0, "Must be greater than 0"
|
||||
end,
|
||||
},
|
||||
top_p = {
|
||||
order = 4,
|
||||
mapping = "parameters",
|
||||
type = "number",
|
||||
optional = true,
|
||||
default = 1.0,
|
||||
desc = "Nucleus sampling parameter (0-1).",
|
||||
validate = function(n)
|
||||
return n >= 0 and n <= 1, "Must be between 0 and 1"
|
||||
end,
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
ollama = function()
|
||||
return require("codecompanion.adapters").extend("ollama", {
|
||||
env = {
|
||||
url = "http://129.100.33.66:11434",
|
||||
},
|
||||
schema = {
|
||||
model = {
|
||||
default = "qwen3.5", -- change to whatever you pulled
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
copilot = function()
|
||||
return require("codecompanion.adapters").extend("copilot", {
|
||||
schema = {
|
||||
model = {
|
||||
default = "gpt-5-mini", -- Consistent model choice
|
||||
},
|
||||
max_tokens = {
|
||||
default = 16284,
|
||||
}
|
||||
}
|
||||
})
|
||||
end,
|
||||
},
|
||||
acp = {
|
||||
opts = {
|
||||
show_presets = true,
|
||||
},
|
||||
copilot_cli = function()
|
||||
return require("codecompanion.adapters").extend("copilot_cli", {})
|
||||
end,
|
||||
codex = function()
|
||||
return require("codecompanion.adapters").extend("codex", {
|
||||
commands = {
|
||||
default = { "codex-acp" },
|
||||
},
|
||||
schema = {
|
||||
model = {
|
||||
default = "github-copilot/gpt-5.2-codex",
|
||||
},
|
||||
},
|
||||
defaults = {
|
||||
timeout = 20000,
|
||||
auth_method = "chatgpt", -- "openai-api-key"|"codex-api-key"|"chatgpt"
|
||||
},
|
||||
})
|
||||
end,
|
||||
opencode = function()
|
||||
return require("codecompanion.adapters").extend("codex", {
|
||||
commands = {
|
||||
default = { "opencode", "acp" },
|
||||
},
|
||||
schema = {
|
||||
model = {
|
||||
default = "github-copilot/gpt-5.2-codex",
|
||||
},
|
||||
},
|
||||
defaults = {
|
||||
timeout = 20000,
|
||||
auth_method = "chatgpt", -- "openai-api-key"|"codex-api-key"|"chatgpt"
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
},
|
||||
rules = {
|
||||
opts = {
|
||||
chat = {
|
||||
enabled = true,
|
||||
autoload = { "default" }
|
||||
},
|
||||
},
|
||||
},
|
||||
opts = {
|
||||
send_code = true,
|
||||
log_level = "WARN", -- Change to DEBUG for troubleshooting
|
||||
language = "English",
|
||||
-- NEW: Performance improvements
|
||||
job_start_delay = 500, -- Reduced from default 1500ms
|
||||
submit_delay = 1000, -- Reduced from default 2000ms
|
||||
},
|
||||
extensions = {
|
||||
spinner = {},
|
||||
-- ddgr_search = {
|
||||
-- opts = {
|
||||
-- require_approval_before = false,
|
||||
-- },
|
||||
-- },
|
||||
agentskills = {
|
||||
opts = {
|
||||
{ "~/Documents/ai-skills", recursive = true },
|
||||
},
|
||||
},
|
||||
-- vectorcode = { lazy = true },
|
||||
history = {
|
||||
lazy = true,
|
||||
enabled = true,
|
||||
opts = {
|
||||
keymap = "ghf",
|
||||
save_chat_keymap = "ghs",
|
||||
picker = "snacks",
|
||||
dir_to_save = vim.env.HOME .. "/Documents/ai-history",
|
||||
title_generation_opts = {
|
||||
adapter = "copilot",
|
||||
model = "gpt-5-mini",
|
||||
},
|
||||
summary = {
|
||||
create_summary_keymap = "ghc",
|
||||
browse_summaries_keymap = "ghb",
|
||||
},
|
||||
},
|
||||
},
|
||||
-- mcphub = {
|
||||
-- callback = "mcphub.extensions.codecompanion",
|
||||
-- opts = {
|
||||
-- make_vars = true,
|
||||
-- make_slash_commands = true,
|
||||
-- show_result_in_chat = true,
|
||||
-- },
|
||||
-- },
|
||||
},
|
||||
interactions = {
|
||||
chat = {
|
||||
variables = {
|
||||
project = {
|
||||
callback = function()
|
||||
-- Get project files structure
|
||||
local files = vim.fn.systemlist("fd . -type f")
|
||||
return table.concat(files, "\n")
|
||||
end,
|
||||
description = "Share project structure"
|
||||
}
|
||||
},
|
||||
tools = {
|
||||
opts = {
|
||||
auto_submit_errors = true, -- Send any errors to the LLM automatically?
|
||||
auto_submit_success = true, -- Send any successful output to the LLM automatically?
|
||||
system_prompt = {
|
||||
enabled = true,
|
||||
replace_main_system_prompt = false,
|
||||
},
|
||||
default_tools = {
|
||||
"file_search",
|
||||
"read_file",
|
||||
"cmd_runner",
|
||||
-- "ddgr_search",
|
||||
},
|
||||
},
|
||||
["fetch_enhanced"] = {
|
||||
callback = function(url, options)
|
||||
options = options or {}
|
||||
local max_length = options.max_length or 200000 -- 200KB default
|
||||
local timeout = options.timeout or 60
|
||||
|
||||
-- Use curl for better control
|
||||
local cmd = string.format(
|
||||
'curl -L -s --max-time %d --user-agent "CodeCompanion-Neovim" "%s"',
|
||||
timeout,
|
||||
url
|
||||
)
|
||||
|
||||
local handle = io.popen(cmd)
|
||||
if not handle then
|
||||
return nil, "Failed to execute curl"
|
||||
end
|
||||
|
||||
local result = handle:read("*a")
|
||||
local success = handle:close()
|
||||
|
||||
if not success then
|
||||
return nil, "Curl command failed"
|
||||
end
|
||||
|
||||
-- Truncate if too long
|
||||
if #result > max_length then
|
||||
result = result:sub(1, max_length) .. "\n[... truncated at " .. max_length .. " characters ...]"
|
||||
end
|
||||
|
||||
return result
|
||||
end,
|
||||
opts = {
|
||||
requires_approval = false,
|
||||
}
|
||||
},
|
||||
["fetch_unlimited"] = {
|
||||
description = "Fetch a data from the web",
|
||||
callback = function(url, options)
|
||||
options = options or {}
|
||||
|
||||
-- Use a local proxy service or direct system calls
|
||||
local temp_file = vim.fn.tempname()
|
||||
local cmd = string.format(
|
||||
'wget --timeout=60 --tries=3 --output-document="%s" "%s" 2>/dev/null && cat "%s" && rm "%s"',
|
||||
temp_file, url, temp_file, temp_file
|
||||
)
|
||||
|
||||
local handle = io.popen(cmd)
|
||||
if not handle then
|
||||
return nil, "Failed to fetch URL"
|
||||
end
|
||||
|
||||
local result = handle:read("*a")
|
||||
handle:close()
|
||||
|
||||
-- Optional: Process and clean the content
|
||||
-- Remove excessive whitespace, clean HTML if needed
|
||||
-- result = result:gsub("%s+", " "):gsub("^\s+", ""):gsub("%s+$", "")
|
||||
|
||||
return result
|
||||
end,
|
||||
opts = {
|
||||
requires_approval = false,
|
||||
description = "Fetch web content with unlimited size"
|
||||
}
|
||||
},
|
||||
["fetch"] = {
|
||||
description = "Fetch a webpage in a markdown format",
|
||||
callback = function(url, options)
|
||||
local cmd = string.format(
|
||||
'reader -o -i none %s 2>/dev/null',
|
||||
url
|
||||
)
|
||||
local handle = io.popen(cmd)
|
||||
if not handle then
|
||||
return nil, "Failed to fetch URL"
|
||||
end
|
||||
|
||||
local result = handle:read("*a")
|
||||
handle:close()
|
||||
|
||||
return result
|
||||
end,
|
||||
},
|
||||
-- ["mcp"] = { -- Name this tool whatever you like
|
||||
-- -- Callback provides the necessary functions to CodeCompanion
|
||||
-- callback = function()
|
||||
-- return require("mcphub.extensions.codecompanion")
|
||||
-- end,
|
||||
-- opts = {
|
||||
-- -- If true, CodeCompanion will ask for approval before executing the MCP tool call
|
||||
-- requires_approval = true,
|
||||
-- -- Optional: Pass parameters like temperature to the underlying LLM if the chat strategy supports it
|
||||
-- temperature = 0.7
|
||||
-- }
|
||||
-- },
|
||||
groups = {
|
||||
['plan'] = {
|
||||
description = "Planning my project and codes with enhanced web access",
|
||||
prompt = "Using all the ${tools} at your disposal including enhanced web fetching. Analyze the codes and use it to help me with my query. You have access to unlimited web content fetching.",
|
||||
tools = {
|
||||
"fetch", -- Backup unlimited fetch
|
||||
"file_search",
|
||||
"grep_search",
|
||||
"list_code_usages",
|
||||
"next_edit_suggestion",
|
||||
"read_file",
|
||||
"cmd_runner",
|
||||
},
|
||||
opts = {
|
||||
collapse_tools = true,
|
||||
-- Override default fetch behavior for this group
|
||||
tool_config = {
|
||||
fetch_enhanced = {
|
||||
max_length = 500000, -- 500KB for planning tasks
|
||||
chunk_processing = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
['research'] = {
|
||||
description = "Deep research with unlimited web access",
|
||||
prompt = "You are a research assistant with unlimited web access. Using the ${tools} fetch and analyze large documents, research papers, and comprehensive web content.",
|
||||
tools = {
|
||||
"fetch",
|
||||
"fetch_enhanced",
|
||||
"file_search",
|
||||
"read_file",
|
||||
},
|
||||
opts = {
|
||||
collapse_tools = false,
|
||||
},
|
||||
},
|
||||
-- NEW: Add development group for coding tasks
|
||||
['dev'] = {
|
||||
description = "Full-stack development with all necessary tools",
|
||||
prompt = "You are an expert full-stack developer. Use ${tools} to understand, modify, and test code. Always gather context before making changes.",
|
||||
tools = {
|
||||
"file_search",
|
||||
"grep_search",
|
||||
"fetch",
|
||||
"list_code_usages",
|
||||
"read_file",
|
||||
"insert_edit_into_file",
|
||||
"cmd_runner",
|
||||
"next_edit_suggestion",
|
||||
},
|
||||
opts = {
|
||||
collapse_tools = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
slash_commands = {
|
||||
["buffer"] = { opts = { provider = "snacks" } }, -- snacks
|
||||
["file"] = { opts = { provider = "snacks" } }, -- snackes
|
||||
['git_files'] = {
|
||||
description = 'List git files',
|
||||
---@param chat CodeCompanion.Chat
|
||||
callback = function(chat)
|
||||
local handle = io.popen 'git ls-files'
|
||||
if handle ~= nil then
|
||||
local result = handle:read '*a'
|
||||
handle:close()
|
||||
chat:add_reference({ content = result }, 'git', '<git_files>')
|
||||
return vim.notify('Git files added to the chat.')
|
||||
else
|
||||
return vim.notify('No git files available', vim.log.levels.INFO, { title = 'CodeCompanion' })
|
||||
end
|
||||
end,
|
||||
opts = {
|
||||
contains_code = false,
|
||||
},
|
||||
},
|
||||
-- NEW: Add helpful workspace command
|
||||
["workspace"] = {
|
||||
description = "Add workspace context",
|
||||
callback = function(chat)
|
||||
local cwd = vim.fn.getcwd()
|
||||
local workspace_info = string.format("Working directory: %s", cwd)
|
||||
|
||||
-- Get project type
|
||||
local files = vim.fn.glob(cwd .. "/*", false, true)
|
||||
for _, file in ipairs(files) do
|
||||
local basename = vim.fn.fnamemodify(file, ":t")
|
||||
if basename == "package.json" then
|
||||
workspace_info = workspace_info .. "\nProject type: Node.js/JavaScript"
|
||||
break
|
||||
elseif basename == "Cargo.toml" then
|
||||
workspace_info = workspace_info .. "\nProject type: Rust"
|
||||
break
|
||||
elseif basename == "go.mod" then
|
||||
workspace_info = workspace_info .. "\nProject type: Go"
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
chat:add_reference({ content = workspace_info }, 'workspace', '<workspace>')
|
||||
return vim.notify('Workspace context added.')
|
||||
end,
|
||||
opts = {
|
||||
contains_code = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
-- adapter = { name = "abacus", model = "route-llm" },
|
||||
-- adapter = { name = "opencode", model = "github-copilot/gpt-5.2-codex" },
|
||||
adapter = { name = "copilot", model = "gpt-5-mini" },
|
||||
},
|
||||
inline = {
|
||||
-- adapter = { name = "abacus", model = "route-llm" },
|
||||
adapter = { name = "copilot", model = "gpt-5.1-codex-mini" },
|
||||
},
|
||||
cmd = {
|
||||
adapter = { name = "copilot", model = "gpt-5-mini" },
|
||||
},
|
||||
background = {
|
||||
adapter = { name = "copilot", model = "gpt-5-mini" },
|
||||
},
|
||||
},
|
||||
prompt_library = {
|
||||
markdown = {
|
||||
dirs = {
|
||||
vim.fn.getcwd() .. "/.prompts",
|
||||
"~/.agents/prompts",
|
||||
},
|
||||
},
|
||||
["Code Review"] = {
|
||||
interaction = "chat",
|
||||
description = "Review the selected code for improvements",
|
||||
opts = {
|
||||
mapping = "<LocalLeader>rpc",
|
||||
modes = { "v" },
|
||||
adapter = {
|
||||
name = "copilot",
|
||||
model = "chatgpt-5.1-codex",
|
||||
},
|
||||
},
|
||||
prompts = {
|
||||
{
|
||||
role = "system",
|
||||
content = "You are an expert code reviewer. Analyze the code for: 1) Logic errors 2) Performance issues 3) Security vulnerabilities 4) Best practices 5) Code clarity and maintainability. Provide specific, actionable feedback.",
|
||||
},
|
||||
{
|
||||
role = "user",
|
||||
content = function(context)
|
||||
local code = require("codecompanion.helpers.actions").get_code(context.start_line, context.end_line)
|
||||
return "Please review this code:\n\n```" .. context.filetype .. "\n" .. code .. "\n```"
|
||||
end,
|
||||
},
|
||||
},
|
||||
cc_keywords = { "review", "critique", "smell", "security", "vulnerability", "best practice", "maintainab" },
|
||||
cc_threshold = 2,
|
||||
},
|
||||
["Optimize Performance"] = {
|
||||
interaction = "chat",
|
||||
description = "Get performance optimization suggestions",
|
||||
opts = {
|
||||
mapping = "<LocalLeader>rpo",
|
||||
modes = { "v" },
|
||||
adapter = {
|
||||
name = "copilot",
|
||||
model = "chatgpt-5.2-codex",
|
||||
},
|
||||
},
|
||||
prompts = {
|
||||
{
|
||||
role = "system",
|
||||
content = "You are a performance optimization expert. Focus on: 1) Time complexity improvements 2) Space efficiency 3) Algorithm optimization 4) Framework-specific optimizations 5) Caching strategies.",
|
||||
},
|
||||
{
|
||||
role = "user",
|
||||
content = function(context)
|
||||
local code = require("codecompanion.helpers.actions").get_code(context.start_line, context.end_line)
|
||||
return "How can I optimize the performance of this code?\n\n```" .. context.filetype .. "\n" .. code .. "\n```"
|
||||
end,
|
||||
},
|
||||
},
|
||||
cc_keywords = { "optimize", "performance", "slow", "latency", "throughput", "memory", "alloc" },
|
||||
},
|
||||
["Debug Analysis"] = {
|
||||
interaction = "chat",
|
||||
description = "Analyze and debug problematic code",
|
||||
opts = {
|
||||
mapping = "<LocalLeader>rpd",
|
||||
modes = { "v" },
|
||||
|
||||
adapter = {
|
||||
name = "copilot",
|
||||
model = "chatgpt-5.2-codex",
|
||||
},
|
||||
},
|
||||
prompts = {
|
||||
{
|
||||
role = "system",
|
||||
content = [[You are a debugging expert. Analyze code for:
|
||||
1. Potential bugs and issues
|
||||
2. Logic errors
|
||||
3. Runtime errors
|
||||
4. Common pitfalls
|
||||
5. Debugging strategies.
|
||||
6. Provide specific solutions.]],
|
||||
},
|
||||
{
|
||||
role = "user",
|
||||
content = function(context)
|
||||
local code = require("codecompanion.helpers.actions").get_code(context.start_line, context.end_line)
|
||||
return fmt(
|
||||
[[Help me debug this code from buffer %d and identify potential issues:
|
||||
|
||||
```%s
|
||||
%s
|
||||
```]],
|
||||
context.bufnr,
|
||||
context.filetype,
|
||||
code
|
||||
)
|
||||
end,
|
||||
opts = {
|
||||
contains_code = true,
|
||||
}
|
||||
},
|
||||
},
|
||||
cc_keyword = { "bug", "debug", "error", "exception", "crash", "stacktrace", "broken", "issue" },
|
||||
},
|
||||
["Architecture Review"] = {
|
||||
interaction = "chat",
|
||||
description = "Review architectural patterns and design",
|
||||
opts = {
|
||||
mapping = "<LocalLeader>rpa",
|
||||
modes = { "v" },
|
||||
|
||||
adapter = {
|
||||
name = "copilot",
|
||||
model = "chatgpt-5.2-codex",
|
||||
},
|
||||
},
|
||||
prompts = {
|
||||
{
|
||||
role = "system",
|
||||
content = "You are a software architect. Review code for: 1) Design patterns usage 2) SOLID principles 3) Separation of concerns 4) Scalability considerations 5) Maintainability. Suggest architectural improvements.",
|
||||
},
|
||||
{
|
||||
role = "user",
|
||||
content = function(context)
|
||||
local code = require("codecompanion.helpers.actions").get_code(context.start_line, context.end_line)
|
||||
return fmt(
|
||||
[[Please review the architecture and design of this code from buffer %d:
|
||||
|
||||
```%s
|
||||
%s
|
||||
```]],
|
||||
context.bufnr,
|
||||
context.filetype,
|
||||
code
|
||||
)
|
||||
end,
|
||||
opts = {
|
||||
contains_code = true,
|
||||
}
|
||||
},
|
||||
},
|
||||
cc_keywords = { "architecture", "design", "pattern", "solid", "scalab", "maintainab", "refactor" },
|
||||
},
|
||||
},
|
||||
display = {
|
||||
action_palette = {
|
||||
provider = "snacks",
|
||||
opts = {
|
||||
show_default_actions = true,
|
||||
show_default_prompt_library = true,
|
||||
}
|
||||
},
|
||||
chat = {
|
||||
show_settings = false,
|
||||
render_headers = false,
|
||||
icons = {
|
||||
chat_context = "📎️",
|
||||
},
|
||||
fold_context = true,
|
||||
-- NEW: Better chat window configuration
|
||||
window = {
|
||||
layout = "vertical",
|
||||
width = 0.45,
|
||||
height = 0.8,
|
||||
border = "rounded", -- Better visual
|
||||
},
|
||||
auto_scroll = false,
|
||||
start_in_insert_mode = false, -- More convenient
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,39 @@
|
||||
|
||||
local conform = require('conform')
|
||||
|
||||
conform.setup({
|
||||
notify_on_error = false,
|
||||
formatters = {
|
||||
shfmt = {
|
||||
prepend_args = { "-i", "2", "-ci" },
|
||||
},
|
||||
dprint = {
|
||||
condition = function(ctx)
|
||||
return vim.fs.find({ "dprint.json" }, { path = ctx.filename, upward = true })[1]
|
||||
end,
|
||||
},
|
||||
},
|
||||
formatters_by_ft = {
|
||||
c = { "clang_format" },
|
||||
cpp = { "clang_format" },
|
||||
lua = { 'stylua' },
|
||||
go = { "goimports", "gofmt" },
|
||||
rust = { "dprint", "rustfmt", lsp_format = "fallback" },
|
||||
python = { "isort", "black", stop_after_first = true },
|
||||
javascript = { "dprint", "prettier", stop_after_first = true },
|
||||
markdown = { "dprint", "prettier", stop_after_first = true },
|
||||
javascriptreact = { "dprint", "prettier", stop_after_first = true },
|
||||
typescript = { "dprint", "prettier", stop_after_first = true },
|
||||
typescriptreact = { "dprint", "prettier", stop_after_first = true },
|
||||
svelte = { "dprint", "prettier", stop_after_first = true },
|
||||
html = { "dprint", "prettier", stop_after_first = true },
|
||||
},
|
||||
})
|
||||
|
||||
vim.keymap.set({ 'n', 'v' }, '<leader>bf',
|
||||
function()
|
||||
conform.format { async = true, lsp_format = 'fallback' }
|
||||
end,
|
||||
{ desc = 'Format buffer' })
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
|
||||
vim.g.copilot_nes_debounce = 500
|
||||
|
||||
require('copilot').setup({
|
||||
nes = {
|
||||
enabled = false,
|
||||
keymap = {
|
||||
accept_and_goto = "<a-y>",
|
||||
accept = false,
|
||||
dismiss = "<Esc>",
|
||||
},
|
||||
},
|
||||
panel = {
|
||||
enabled = false,
|
||||
},
|
||||
})
|
||||
@@ -0,0 +1,36 @@
|
||||
|
||||
local crates = require("crates")
|
||||
local opts = { silent = true }
|
||||
|
||||
vim.keymap.set("n", "<leader>cct", crates.toggle, { desc = 'toggle' })
|
||||
vim.keymap.set("n", "<leader>ccr", crates.reload, { desc = 'reload' })
|
||||
vim.keymap.set("n", "<leader>ccv", crates.show_versions_popup, { desc = 'show versions' })
|
||||
vim.keymap.set("n", "<leader>ccf", crates.show_features_popup, { desc = 'show features' })
|
||||
vim.keymap.set("n", "<leader>ccd", crates.show_dependencies_popup, { desc = 'show dependencies' })
|
||||
vim.keymap.set("n", "<leader>ccu", crates.update_crate, { desc = 'update' })
|
||||
vim.keymap.set("v", "<leader>ccu", crates.update_crates, { desc = 'update' })
|
||||
vim.keymap.set("n", "<leader>cca", crates.update_all_crates, { desc = 'update all' })
|
||||
vim.keymap.set("n", "<leader>ccU", crates.upgrade_crate, { desc = 'upgrade' })
|
||||
vim.keymap.set("v", "<leader>ccU", crates.upgrade_crates, { desc = 'upgrade' })
|
||||
vim.keymap.set("n", "<leader>ccA", crates.upgrade_all_crates, { desc = 'upgrade all' })
|
||||
vim.keymap.set("n", "<leader>ccx", crates.expand_plain_crate_to_inline_table, { desc = 'expand' })
|
||||
vim.keymap.set("n", "<leader>ccX", crates.extract_crate_into_table, { desc = 'extract' })
|
||||
vim.keymap.set("n", "<leader>ccH", crates.open_homepage, { desc = 'open homepage' })
|
||||
vim.keymap.set("n", "<leader>ccR", crates.open_repository, { desc = 'open repository' })
|
||||
vim.keymap.set("n", "<leader>ccD", crates.open_documentation, { desc = 'open documents' })
|
||||
vim.keymap.set("n", "<leader>ccC", crates.open_crates_io, { desc = 'open crates.io' })
|
||||
vim.keymap.set("n", "<leader>ccL", crates.open_lib_rs, { desc = 'open lib.rs' })
|
||||
|
||||
require('crates').setup({
|
||||
completion = {
|
||||
crates = {
|
||||
enabled = true,
|
||||
},
|
||||
},
|
||||
lsp = {
|
||||
enabled = true,
|
||||
actions = true,
|
||||
completion = true,
|
||||
hover = true,
|
||||
},
|
||||
})
|
||||
@@ -0,0 +1,12 @@
|
||||
|
||||
require('csvview').setup({
|
||||
parser = { comments = { "#", "//" } },
|
||||
keymaps = {
|
||||
textobject_field_inner = { "if", mode = { "o", "x" } },
|
||||
textobject_field_outer = { "af", mode = { "o", "x" } },
|
||||
jump_next_field_end = { "<Tab>", mode = { "n", "v" } },
|
||||
jump_prev_field_end = { "<S-Tab>", mode = { "n", "v" } },
|
||||
jump_next_row = { "<Enter>", mode = { "n", "v" } },
|
||||
jump_prev_row = { "<S-Enter>", mode = { "n", "v" } },
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,15 @@
|
||||
require('fabric-ai').setup({
|
||||
-- Default configuration (all optional)
|
||||
fabric_path = "fabric-ai", -- Path to Fabric CLI
|
||||
patterns_path = nil, -- Custom patterns dir (auto-detect if nil)
|
||||
timeout = 300000, -- Command timeout in ms (5 minutes)
|
||||
window = {
|
||||
width = 0.8, -- 80% of editor width
|
||||
height = 0.8, -- 80% of editor height
|
||||
border = "rounded",
|
||||
},
|
||||
})
|
||||
|
||||
vim.keymap.set({ 'v' }, "<leader>fa", ":'<,'>Fabric<CR>", { desc = "Fabric AI" })
|
||||
vim.keymap.set({ 'n' }, '<leader>fa', ':Fabric<CR>', { desc = "Fabric AI" })
|
||||
vim.keymap.set({ 'n' }, '<leader>fu', ':Fabric url<CR>', { desc = "Fabric URL" })
|
||||
@@ -0,0 +1,32 @@
|
||||
|
||||
require('flash').setup({
|
||||
modes = {
|
||||
char = {
|
||||
jump_labels = true,
|
||||
search = { wrap = true },
|
||||
highlight = { backdrop = false },
|
||||
},
|
||||
search = {
|
||||
-- when `true`, flash will be activated during regular search by default.
|
||||
-- You can always toggle when searching with `require("flash").toggle()`
|
||||
enabled = true,
|
||||
highlight = { backdrop = false },
|
||||
jump = { history = true, register = true, nohlsearch = true, autojump = true },
|
||||
search = {
|
||||
wrap = true,
|
||||
-- `forward` will be automatically set to the search direction
|
||||
-- `mode` is always set to `search`
|
||||
-- `incremental` is set to `true` when `incsearch` is enabled
|
||||
},
|
||||
},
|
||||
treesitter = {
|
||||
search = { wrap = true },
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
vim.keymap.set({ "n" }, "<leader>/", function() require("flash").treesitter() end, { desc = "Flash Treesitter" })
|
||||
vim.keymap.set({ "x", "o" }, "s", function() require("flash").treesitter() end, { desc = "Flash Treesitter" })
|
||||
vim.keymap.set({ "o" }, "r", function() require("flash").remote() end, { desc = "Remote Flash" })
|
||||
vim.keymap.set({ "o", "x" }, "R", function() require("flash").treesitter_search() end, { desc = "Treesitter Search" })
|
||||
vim.keymap.set({ "c" }, "<c-s>", function() require("flash").toggle() end, { desc = "Toggle Flash Search" })
|
||||
@@ -0,0 +1,51 @@
|
||||
|
||||
vim.keymap.set({ 'n' }, '<leader>uG', "Gitsigns toggle_signs", { desc = 'Gitsigns toggle' })
|
||||
|
||||
require('gitsigns').setup({
|
||||
auto_attach = true,
|
||||
signs_staged_enable = true,
|
||||
signcolumn = true,
|
||||
current_line_blame_opts = {
|
||||
delay = 50
|
||||
},
|
||||
on_attach = function(bufnr)
|
||||
local gitsigns = require('gitsigns')
|
||||
|
||||
local function map(mode, l, r, opts)
|
||||
opts = opts or {}
|
||||
opts.buffer = bufnr
|
||||
vim.keymap.set(mode, l, r, opts)
|
||||
end
|
||||
|
||||
-- Actions
|
||||
-- visual mode
|
||||
map('v', '<leader>vs', function()
|
||||
gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' }
|
||||
end, { desc = 'stage git hunk' })
|
||||
|
||||
map('v', '<leader>vr', function()
|
||||
gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' }
|
||||
end, { desc = 'reset git hunk' })
|
||||
|
||||
-- normal mode
|
||||
|
||||
map('n', '[v', function() gitsigns.nav_hunk 'prev' end, { desc = 'git previous hunk' })
|
||||
map('n', ']v', function() gitsigns.nav_hunk 'next' end, { desc = 'git next hunk' })
|
||||
map('n', '<leader>vs', gitsigns.stage_hunk, { desc = 'git stage hunk' })
|
||||
map('n', '<leader>vr', gitsigns.reset_hunk, { desc = 'git reset hunk' })
|
||||
map('n', '<leader>vS', gitsigns.stage_buffer, { desc = 'git stage buffer' })
|
||||
map('n', '<leader>vu', gitsigns.undo_stage_hunk, { desc = 'git undo stage hunk' })
|
||||
map('n', '<leader>vR', gitsigns.reset_buffer, { desc = 'git reset buffer' })
|
||||
map('n', '<leader>vP', gitsigns.preview_hunk, { desc = 'git preview hunk' })
|
||||
map('n', '<leader>vb', gitsigns.blame_line, { desc = 'git blame line' })
|
||||
map('n', '<leader>vP', gitsigns.diffthis, { desc = 'git diff against index' })
|
||||
map('n', '<leader>vD', function()
|
||||
gitsigns.diffthis '@'
|
||||
end, { desc = 'git [D]iff against last commit' })
|
||||
-- Toggles
|
||||
map('n', '<leader>uvb', gitsigns.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' })
|
||||
map('n', '<leader>uvd', gitsigns.toggle_deleted, { desc = '[T]oggle git show [D]eleted' })
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
|
||||
local cmd = require("jj.cmd")
|
||||
local annotate = require("jj.annotate")
|
||||
|
||||
vim.keymap.set("n", "<leader>va", annotate.file, { desc = "JJ annotate file" })
|
||||
vim.keymap.set("n", "<leader>vA", annotate.line, { desc = "JJ annotate line" })
|
||||
vim.keymap.set("n", "<leader>vbc", cmd.bookmark_create, { desc = "JJ bookmark create" })
|
||||
vim.keymap.set("n", "<leader>vbd", cmd.bookmark_delete, { desc = "JJ bookmark delete" })
|
||||
vim.keymap.set("n", "<leader>vbm", cmd.bookmark_move, { desc = "JJ bookmark move" })
|
||||
vim.keymap.set("n", "<leader>vd", cmd.describe, { desc = "JJ describe" })
|
||||
vim.keymap.set("n", "<leader>vl", cmd.log, { desc = "JJ log" })
|
||||
vim.keymap.set("n", "<leader>ve", cmd.edit, { desc = "JJ edit" })
|
||||
vim.keymap.set("n", "<leader>vn", cmd.new, { desc = "JJ new" })
|
||||
vim.keymap.set("n", "<leader>vs", cmd.status, { desc = "JJ status" })
|
||||
vim.keymap.set("n", "<leader>vS", cmd.squash, { desc = "JJ squash" })
|
||||
vim.keymap.set("n", "<leader>vju", cmd.undo, { desc = "JJ undo" })
|
||||
vim.keymap.set("n", "<leader>vjr", cmd.redo, { desc = "JJ redo" })
|
||||
vim.keymap.set("n", "<leader>vr", cmd.rebase, { desc = "JJ rebase" })
|
||||
vim.keymap.set("n", "<leader>vf", cmd.fetch, { desc = "JJ fetch" })
|
||||
vim.keymap.set("n", "<leader>vx", cmd.abandon, { desc = "JJ abandon" })
|
||||
vim.keymap.set("n", "<leader>vp", cmd.push, { desc = "JJ push" })
|
||||
vim.keymap.set("n", "<leader>vpr", cmd.open_pr, { desc = "JJ open PR from bookmark in current revision or parent" })
|
||||
vim.keymap.set("n", "<leader>vpl", function()
|
||||
cmd.open_pr { list_bookmarks = true }
|
||||
end, { desc = "JJ open PR listing available bookmarks" })
|
||||
|
||||
|
||||
-- Diff commands
|
||||
local diff = require("jj.diff")
|
||||
vim.keymap.set("n", "<leader>vjd", function() diff.open_vdiff() end, { desc = "JJ diff current buffer" })
|
||||
vim.keymap.set("n", "<leader>vjD", function() diff.open_hsplit() end, { desc = "JJ hdiff current buffer" })
|
||||
|
||||
-- Pickers
|
||||
local picker = require("jj.picker")
|
||||
vim.keymap.set("n", "<leader>vjs", function() picker.status() end, { desc = "JJ Picker status" })
|
||||
vim.keymap.set("n", "<leader>vjh", function() picker.file_history() end, { desc = "JJ Picker history" })
|
||||
|
||||
-- Some functions like `log` can take parameters
|
||||
vim.keymap.set("n", "<leader>vL", function()
|
||||
cmd.log {
|
||||
revisions = "all()", -- equivalent to jj log -r ::
|
||||
}
|
||||
end, { desc = "JJ log all" })
|
||||
|
||||
|
||||
-- This is an alias i use for moving bookmarks its so good
|
||||
vim.keymap.set("n", "<leader>vt", function()
|
||||
cmd.j "tug"
|
||||
cmd.log {}
|
||||
end, { desc = "JJ tug" })
|
||||
|
||||
require("jj").setup({
|
||||
diff = {
|
||||
backend = "native",
|
||||
},
|
||||
cmd = {
|
||||
describe = {
|
||||
editor = {
|
||||
type = "buffer",
|
||||
}
|
||||
}
|
||||
},
|
||||
describe = {
|
||||
editor = {
|
||||
type = "buffer",
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
require("hunk").setup()
|
||||
require('jjsigns').setup({
|
||||
enabled = true,
|
||||
attach = {
|
||||
auto = false,
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,205 @@
|
||||
|
||||
vim.keymap.set("i", "<C-.>", function()
|
||||
if not vim.lsp.inline_completion.get() then
|
||||
return "<C-.>"
|
||||
end
|
||||
end, { expr = true, desc = "Accept the current inline completion" })
|
||||
|
||||
vim.api.nvim_create_autocmd('LspAttach', {
|
||||
group = vim.api.nvim_create_augroup('kickstart-lsp-attach', { clear = true }),
|
||||
callback = function(event)
|
||||
local function client_supports_method(client, method, bufnr)
|
||||
return client:supports_method(method, bufnr)
|
||||
end
|
||||
|
||||
local client = vim.lsp.get_client_by_id(event.data.client_id)
|
||||
if client and client:supports_method(vim.lsp.protocol.Methods.textDocument_completion, event.buf) then
|
||||
vim.lsp.completion.enable(true, client.id, event.buf, { autotrigger = true })
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
-- Diagnostic Config
|
||||
-- See :help vim.diagnostic.Opts
|
||||
vim.diagnostic.config({
|
||||
severity_sort = true,
|
||||
float = { border = 'rounded', source = 'if_many' },
|
||||
underline = { severity = vim.diagnostic.severity.ERROR },
|
||||
signs = vim.g.have_nerd_font and {
|
||||
text = {
|
||||
[vim.diagnostic.severity.ERROR] = ' ',
|
||||
[vim.diagnostic.severity.WARN] = ' ',
|
||||
[vim.diagnostic.severity.INFO] = ' ',
|
||||
[vim.diagnostic.severity.HINT] = ' ',
|
||||
},
|
||||
} or {},
|
||||
virtual_text = {
|
||||
source = 'if_many',
|
||||
spacing = 2,
|
||||
format = function(diagnostic)
|
||||
local diagnostic_message = {
|
||||
[vim.diagnostic.severity.ERROR] = diagnostic.message,
|
||||
[vim.diagnostic.severity.WARN] = diagnostic.message,
|
||||
[vim.diagnostic.severity.INFO] = diagnostic.message,
|
||||
[vim.diagnostic.severity.HINT] = diagnostic.message,
|
||||
}
|
||||
return diagnostic_message[diagnostic.severity]
|
||||
end,
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
require('mason').setup()
|
||||
-- require('mason-lspconfig').setup()
|
||||
|
||||
local servers = {
|
||||
lua_ls = {
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
version = 'LuaJIT',
|
||||
},
|
||||
workspace = {
|
||||
library = vim.api.nvim_get_runtime_file("", true),
|
||||
checkThirdParty = false,
|
||||
},
|
||||
completion = {
|
||||
callSnippet = "Replace",
|
||||
},
|
||||
diagnostics = {
|
||||
disable = { 'missing-fields' },
|
||||
globals = { 'vim', 'require' },
|
||||
},
|
||||
|
||||
},
|
||||
}
|
||||
},
|
||||
gopls = {
|
||||
settings = {
|
||||
gopls = {
|
||||
experimentalPostfixCompletions = true,
|
||||
analyses = {
|
||||
unusedparams = true,
|
||||
shadow = true,
|
||||
},
|
||||
staticcheck = true,
|
||||
hints = {
|
||||
enabled = true,
|
||||
rangeVariableTypes = true,
|
||||
prameterNames = true,
|
||||
functionTypeParameters = true,
|
||||
constantValues = true,
|
||||
compositeLiteralTypes = true,
|
||||
compositeLiteralFields = true,
|
||||
assignVariableTypes = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
harper_ls = {
|
||||
settings = {
|
||||
["harper-ls"] = {
|
||||
linters = {
|
||||
SentenceCapitalization = true,
|
||||
SpellCheck = true
|
||||
},
|
||||
dialect = "Canadian"
|
||||
}
|
||||
}
|
||||
},
|
||||
-- csharp_ls = {},
|
||||
zls = {},
|
||||
clangd = {
|
||||
settings = {
|
||||
["clang"] = {
|
||||
cmd = { "clangd", "--background-index", "--compile-commands-dir=" .. vim.loop.cwd() .. "/build" },
|
||||
}
|
||||
}
|
||||
},
|
||||
rust_analyzer= {
|
||||
settings = {
|
||||
['rust-analyzer'] = {
|
||||
cargo = {
|
||||
allFeatures = true,
|
||||
},
|
||||
checkOnSave = true,
|
||||
check = {
|
||||
command = "clippy",
|
||||
},
|
||||
procMacro = {
|
||||
enable = true,
|
||||
},
|
||||
lens = {
|
||||
debug = { enable = true },
|
||||
enable = true,
|
||||
implementations = { enable = true },
|
||||
references = {
|
||||
adt = { enable = true },
|
||||
enumVariant = { enable = true },
|
||||
method = { enable = true },
|
||||
trait = { enable = true },
|
||||
},
|
||||
run = { enable = true },
|
||||
updateTest = { enable = true },
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
ts_ls= {},
|
||||
html= {},
|
||||
eslint= {},
|
||||
jsonls= {},
|
||||
jdtls= {},
|
||||
copilot = {
|
||||
-- settings = {
|
||||
-- ['copilot'] = {
|
||||
-- cmd = { "copilot-language-server", "--stdio" },
|
||||
-- init_options = {
|
||||
-- name = "Neovim",
|
||||
-- version = tostring(vim.version()),
|
||||
-- },
|
||||
-- editorPluginInfo = {
|
||||
-- name = "Neovim",
|
||||
-- version = tostring(vim.version()),
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
},
|
||||
}
|
||||
|
||||
local ensure_installed = vim.tbl_keys(servers or {})
|
||||
require('mason-tool-installer').setup ({ ensure_installed = ensure_installed })
|
||||
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities = vim.tbl_deep_extend('force', capabilities, require('blink.cmp').get_lsp_capabilities({}, false))
|
||||
capabilities = vim.tbl_deep_extend('force', capabilities, {
|
||||
general = {
|
||||
-- dynamicRegistration = false,
|
||||
positionEncodings = { "utf-16" },
|
||||
},
|
||||
textDocument = {
|
||||
foldingRange = {
|
||||
dynamicRegistration = false,
|
||||
lineFoldingOnly = true
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
for server, cfg in pairs(servers) do
|
||||
cfg.capabilities = vim.tbl_deep_extend('force', {}, capabilities, cfg.capabilities or {})
|
||||
vim.lsp.config(server, cfg)
|
||||
vim.lsp.enable(server)
|
||||
end
|
||||
vim.lsp.inline_completion.enable();
|
||||
-- vim.lsp.enable("rust-analyzer", false)
|
||||
|
||||
|
||||
require ('mason-nvim-dap').setup({
|
||||
handlers = {
|
||||
function(config)
|
||||
-- all sources with no handler get passed here
|
||||
-- Keep original functionality
|
||||
require('mason-nvim-dap').default_setup(config)
|
||||
end,
|
||||
},
|
||||
})
|
||||
@@ -0,0 +1,69 @@
|
||||
local function truncate_branch_name(branch)
|
||||
if not branch or branch == "" then
|
||||
return ""
|
||||
end
|
||||
|
||||
-- Match the branch name to the specified format
|
||||
local _, _, ticket_number = string.find(branch, "skdillon/sko%-(%d+)%-")
|
||||
|
||||
-- If the branch name matches the format, display sko-{ticket_number}, otherwise display the full branch name
|
||||
if ticket_number then
|
||||
return "sko-" .. ticket_number
|
||||
else
|
||||
return branch
|
||||
end
|
||||
end
|
||||
|
||||
require("lualine").setup({
|
||||
options = {
|
||||
-- theme = "rose-pine",
|
||||
globalstatus = true,
|
||||
-- component_separators = { left = "", right = "" },
|
||||
-- section_separators = { left = "█", right = "█" },
|
||||
icons_enabled = true,
|
||||
component_separators = { left = '', right = ''},
|
||||
section_separators = { left = '', right = ''},
|
||||
tabline = {
|
||||
lualine_a = {},
|
||||
lualine_b = {'branch'},
|
||||
lualine_c = {'filename'},
|
||||
lualine_x = {},
|
||||
lualine_y = {},
|
||||
lualine_z = {}
|
||||
},
|
||||
},
|
||||
sections = {
|
||||
lualine_b = {
|
||||
{ "branch", icon = "", fmt = truncate_branch_name },
|
||||
"diff",
|
||||
"diagnostics",
|
||||
},
|
||||
lualine_c = {
|
||||
{ 'lsp_progress' },
|
||||
{
|
||||
'buffers',
|
||||
show_filename_only = true, -- Shows shortened relative path when set to false.
|
||||
hide_filename_extension = false, -- Hide filename extension when set to true.
|
||||
show_modified_status = true, -- Shows indicator when the buffer is modified.
|
||||
mode = 0,
|
||||
max_length = vim.o.columns * 2 / 3,
|
||||
filetype_names = {
|
||||
TelescopePrompt = ' ',
|
||||
},
|
||||
-- it can also be a function that returns
|
||||
-- the value of `max_length` dynamically.
|
||||
use_mode_colors = false,
|
||||
symbols = {
|
||||
modified = ' ●', -- Text to show when the buffer is modified
|
||||
alternate_file = '#', -- Text to show to identify the alternate file
|
||||
directory = '', -- Text to show when the buffer is a directory
|
||||
},
|
||||
},
|
||||
},
|
||||
lualine_x = {
|
||||
"windows",
|
||||
"fileformat",
|
||||
"filetype",
|
||||
},
|
||||
},
|
||||
})
|
||||
@@ -0,0 +1,13 @@
|
||||
-- build = "make install_jsregexp",
|
||||
require('luasnip.loaders.from_vscode').lazy_load()
|
||||
require('luasnip.loaders.from_vscode').lazy_load({ paths = "./json_snippets" })
|
||||
|
||||
local luasnip = require("luasnip")
|
||||
luasnip.add_snippets("zig", require("snippets.zig"))
|
||||
|
||||
vim.api.nvim_create_autocmd('PackChanged', {
|
||||
callback = function()
|
||||
vim.system({ "make", "install_jsregexp" }, {}):wait()
|
||||
end
|
||||
})
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
vim.g.mkdp_filetypes = { "markdown" }
|
||||
|
||||
vim.keymap.set("n", "<leader>xmp", "<cmd>MarkdownPreview<CR>", { desc ="Markdown Preview" })
|
||||
vim.keymap.set("n", "<leader>xms", "<cmd>MarkdownPreviewStop<CR>", { desc ="Markdown Preview Stop" })
|
||||
|
||||
vim.api.nvim_create_autocmd('PackChanged', {
|
||||
callback = function()
|
||||
vim.fn["mkdp#util#install"]()
|
||||
end
|
||||
})
|
||||
@@ -0,0 +1,79 @@
|
||||
local MiniExtra = require('mini.extra')
|
||||
local ai = require('mini.ai')
|
||||
local spec_treesitter = ai.gen_spec.treesitter
|
||||
|
||||
ai.setup({
|
||||
custom_textobjects = {
|
||||
F = spec_treesitter({ a = '@function.outer', i = '@function.inner' }),
|
||||
C = spec_treesitter({ a = '@comment.outer', i = '@comment.inner' }),
|
||||
P = spec_treesitter({ a = '@parameter.outer', i = '@parameter.inner' }),
|
||||
O = spec_treesitter({ a = '@block.outter', i = '@block.inner' }),
|
||||
k = spec_treesitter({ a = '@class.outer', i = '@class.inner' }),
|
||||
o = spec_treesitter({
|
||||
a = { '@conditional.outer', '@loop.outer' },
|
||||
i = { '@conditional.inner', '@loop.inner' },
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
require('mini.move').setup()
|
||||
require('mini.align').setup()
|
||||
require('mini.bracketed').setup()
|
||||
require('mini.operators').setup({
|
||||
evaluate = { prefix = 'g|', func = nil, },
|
||||
exchange = { prefix = 'g.', reindent_linewise = true, },
|
||||
multiply = { prefix = 'gm', func = nil, },
|
||||
replace = { prefix = 'gk', reindent_linewise = true, },
|
||||
sort = { prefix = 'gs', func = nil, }
|
||||
})
|
||||
|
||||
require('mini.surround').setup({
|
||||
-- Add custom surroundings to be used on top of builtin ones. For more
|
||||
-- information with examples, see `:h MiniSurround.config`.
|
||||
-- custom_surroundings = {
|
||||
-- s = { input = { '%[%[().-()%]%]' }, output = { left = '[[', right = ']]' } },
|
||||
-- },
|
||||
mappings = {
|
||||
add = 'sa', -- Add surrounding in Normal and Visual modes
|
||||
delete = 'sd', -- Delete surrounding
|
||||
find = 'sf', -- Find surrounding (to the right)
|
||||
find_left = 'sF', -- Find surrounding (to the left)
|
||||
highlight = 'sh', -- Highlight surrounding
|
||||
replace = 'sr', -- Replace surrounding
|
||||
update_n_lines = 'sn', -- Update `n_lines`
|
||||
|
||||
suffix_last = 'l', -- Suffix to search with "prev" method
|
||||
suffix_next = 'n', -- Suffix to search with "next" method
|
||||
}
|
||||
})
|
||||
|
||||
require('mini.splitjoin').setup()
|
||||
|
||||
local hi_words = MiniExtra.gen_highlighter.words
|
||||
require('mini.hipatterns').setup({
|
||||
highlighters = {
|
||||
-- Highlight standalone 'FIXME', 'HACK', 'TODO', 'NOTE'
|
||||
fixme = hi_words({ 'FIXME', 'Fixme', 'fixme' }, "MiniHipatternsFixme"),
|
||||
hack = hi_words({ 'HACK', 'Hack', 'hack' }, "MiniHipatternsHack"),
|
||||
todo = hi_words({ 'TODO', 'Todo', 'todo' }, "MiniHipatternsTodo"),
|
||||
note = hi_words({ 'NOTE', 'Note', 'note' }, "MiniHipatternsNote"),
|
||||
done = hi_words({ 'DONE', 'Done', 'done' }, "MiniHipatternsFixme"),
|
||||
|
||||
-- Highlight hex color strings (`#rrggbb`) using that color
|
||||
-- hex_color = hipatterns.gen_highlighter.hex_color(),
|
||||
},
|
||||
})
|
||||
|
||||
vim.keymap.set('n', "-", function() require("mini.files").open(vim.api.nvim_buf_get_name(0)) end, { desc = "Open parent directory" })
|
||||
vim.keymap.set('n', "<leader>-", function() require("mini.files").open() end, { desc = "File Explore" })
|
||||
require('mini.files').setup({
|
||||
mappings = {
|
||||
go_in = "<CR>", -- Map both Enter and L to enter directories or open files
|
||||
go_in_plus = "L",
|
||||
go_out = "-",
|
||||
go_out_plus = "H",
|
||||
close = "<Esc>",
|
||||
},
|
||||
})
|
||||
|
||||
require('mini.sessions').setup()
|
||||
@@ -0,0 +1,2 @@
|
||||
vim.keymap.set('v', '<leader>te', function() require('ansible').run() end, { buffer = true, silent = true })
|
||||
vim.keymap.set('n', '<leader>te', ":w<CR> :lua require('ansible').run()<CR>", { buffer = true, silent = true })
|
||||
@@ -0,0 +1,76 @@
|
||||
require("obsidian").setup({
|
||||
legacy_commands = false,
|
||||
picker = {
|
||||
name = "snacks.pick",
|
||||
},
|
||||
ui = {
|
||||
enable = true,
|
||||
},
|
||||
workspaces = {
|
||||
{
|
||||
name = "NCA notes",
|
||||
path = vim.fn.expand "~" .. "/Documents/nca-notes/",
|
||||
},
|
||||
},
|
||||
notes_subdir = "Inbox",
|
||||
daily_notes = {
|
||||
folder = "Dailies",
|
||||
date_format = "%Y-%m-%d-%a",
|
||||
alias_fomat = "%B %-d, %Y",
|
||||
default_tags = { "daily-notes" },
|
||||
},
|
||||
new_notes_location = "notes_subdir",
|
||||
templates = {
|
||||
subdir = "Templates",
|
||||
date_format = "%Y-%m-%d-%a",
|
||||
time_format = "%H:%M",
|
||||
tags = "",
|
||||
},
|
||||
completion = {
|
||||
nvim_cmp = false,
|
||||
blink = true,
|
||||
min_chars = 2,
|
||||
},
|
||||
link = {
|
||||
style = "wiki",
|
||||
},
|
||||
note_id_func = function(title)
|
||||
local suffix = ""
|
||||
if title ~= nil then
|
||||
suffix = title:gsub(" ", "-"):gsub("[^A-Za-z0-9-]", ""):lower()
|
||||
else
|
||||
for _ = 1, 4 do
|
||||
suffix = suffix .. string.char(math.random(65, 90))
|
||||
suffix = tostring(os.time()) .. "-" .. suffix
|
||||
end
|
||||
end
|
||||
return suffix
|
||||
end,
|
||||
|
||||
callbacks = {
|
||||
enter_note = function(note)
|
||||
vim.keymap.set('n', '<leader>k.', '<CMD>Obsidian toggle_checkbox<CR>', { desc = 'toggle checkbox', buffer = note.bufnr, silent = true })
|
||||
vim.keymap.set('n', '<leader>kp', '<CMD>Obsidian paste_img<CR>', { desc = 'paste img', buffer = note.bufnr, silent = true })
|
||||
vim.keymap.set('n', '<leader>kt', '<CMD>Obsidian tags<CR>', { desc = 'tags', buffer = note.bufnr, silent = true })
|
||||
vim.keymap.set('n', '<leader>k`', '<CMD>Obsidian backlinks<CR>', { desc = 'backlinks', buffer = note.bufnr, silent = true })
|
||||
vim.keymap.set('n', '<leader>kx', '<CMD>Obsidian follow_link<CR>', { desc = 'follow link', buffer = note.bufnr, silent = true })
|
||||
vim.keymap.set('n', '<leader>ksl', '<CMD>Obsidian links<CR>', { desc = 'links', buffer = note.bufnr, silent = true })
|
||||
vim.keymap.set('n', '<leader>kr', '<CMD>Obsidian rename<CR>', { desc = 'rename', buffer = note.bufnr, silent = true })
|
||||
vim.keymap.set('n', '<leader>ksc', '<CMD>Obsidian toc<CR>', { desc = 'toc', buffer = note.bufnr, silent = true })
|
||||
vim.keymap.set('v', '<leader>kx', '<CMD>Obsidian link<CR>', { desc = 'links', buffer = note.bufnr, silent = true })
|
||||
vim.keymap.set('v', '<leader>kl', '<CMD>Obsidian link_new<CR>', { desc = 'links', buffer = note.bufnr, silent = true })
|
||||
end,
|
||||
},
|
||||
})
|
||||
|
||||
vim.keymap.set("v", "<leader>kx", "<cmd>Obsidian extract_note<cr>", { desc = "Extract Note" })
|
||||
vim.keymap.set("n", "<leader>knn", "<cmd>Obsidian new<cr>", { desc = "New Obsidian note" })
|
||||
vim.keymap.set("n", "<leader>knt", "<cmd>Obsidian new_from_template<cr>", { desc = "New from template" })
|
||||
vim.keymap.set("n", "<leader>ksq", "<cmd>Obsidian quick_switch<cr>", { desc = "Quick Switch" })
|
||||
vim.keymap.set("n", "<leader>kss", "<cmd>Obsidian search<cr>", { desc = "Search Obsidian notes" })
|
||||
vim.keymap.set("n", "<leader>kdt", "<cmd>Obsidian today<cr>", { desc = "Daily Today" })
|
||||
vim.keymap.set("n", "<leader>kdy", "<cmd>Obsidian yesterday<cr>", { desc = "Daily Yesterday" })
|
||||
vim.keymap.set("n", "<leader>kdw", "<cmd>Obsidian tomorrow<cr>", { desc = "Daily Tomorrow" })
|
||||
vim.keymap.set("n", "<leader>kdd", "<cmd>Obsidian dailies<cr>", { desc = "Dailies" })
|
||||
vim.keymap.set("n", "<leader>kw", "<cmd>Obsidian workspace<cr>", { desc = "Change Workspace" })
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
vim.g.openscad_load_snippets = true
|
||||
require("openscad").setup({})
|
||||
@@ -0,0 +1,70 @@
|
||||
|
||||
require('orgmode').setup({
|
||||
ui = {
|
||||
input = {
|
||||
use_vim_ui = true
|
||||
}
|
||||
},
|
||||
org_agenda_files = {'~/Documents/notes/*project*org', '~/Documents/notes/Inbox*org', '~/Documents/journals/*.org'},
|
||||
org_default_notes_file = "~/Documents/notes/Inbox.org",
|
||||
org_todo_keywords = { 'TODO(t)', 'NEXT(n)', '|', 'DONE(d)', 'DELEGATED(a)' },
|
||||
mappings = {
|
||||
capture = {
|
||||
org_capture_refile = 'R',
|
||||
}
|
||||
},
|
||||
org_capture_templates = {
|
||||
t = {
|
||||
description = "Todo item",
|
||||
template = "* TODO %?\n SCHEDULED: %t\n DEADLINE: %T\n", -- Template content
|
||||
headline = "Tasks",
|
||||
},
|
||||
j = {
|
||||
description = "Journal entry",
|
||||
target = "~/Documents/notes/journals/%<%Y-%m-%d>.org",
|
||||
template = "* %<%Y-%m-%d %H:%M> %?\n",
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
require("org-bullets").setup({
|
||||
concealcursor = false, -- If false then when the cursor is on a line underlying characters are visible
|
||||
symbols = {
|
||||
-- list symbol
|
||||
list = "•",
|
||||
-- headlines can be a list
|
||||
headlines = { "◉", "○", "✸", "✿" },
|
||||
-- or a function that receives the defaults and returns a list
|
||||
headlines = function(default_list)
|
||||
table.insert(default_list, "♥")
|
||||
return default_list
|
||||
end,
|
||||
-- or false to disable the symbol. Works for all symbols
|
||||
headlines = false,
|
||||
-- or a table of tables that provide a name
|
||||
-- and (optional) highlight group for each headline level
|
||||
headlines = {
|
||||
{ "◉", "MyBulletL1" },
|
||||
{ "○", "MyBulletL2" },
|
||||
{ "✸", "MyBulletL3" },
|
||||
{ "✿", "MyBulletL4" },
|
||||
},
|
||||
checkboxes = {
|
||||
half = { "", "@org.checkbox.halfchecked" },
|
||||
done = { "✓", "@org.keyword.done" },
|
||||
todo = { "˟", "@org.keyword.todo" },
|
||||
},
|
||||
}
|
||||
})
|
||||
|
||||
require('org-roam').setup({
|
||||
bindings = {
|
||||
prefix = "<LocalLeader>oO",
|
||||
},
|
||||
directory = "~/Documents/notes",
|
||||
extensions = {
|
||||
dailies = {
|
||||
directory = "journals"
|
||||
},
|
||||
},
|
||||
})
|
||||
@@ -0,0 +1,9 @@
|
||||
require('outline').setup({
|
||||
symbol_folding = {
|
||||
-- Unfold entire symbol tree by default with false, otherwise enter a
|
||||
-- number starting from 1
|
||||
autofold_depth = false,
|
||||
-- autofold_depth = 1,
|
||||
},
|
||||
})
|
||||
vim.keymap.set('n', '<leader>so', '<cmd>Outline<CR>', { desc = "Toggle outline" })
|
||||
@@ -0,0 +1,4 @@
|
||||
vim.keymap.set('n', "<leader>xr", function() require("persistence").load() end, { desc = "Restore Session" })
|
||||
vim.keymap.set('n', "<leader>xs", function() require("persistence").save() end, { desc = "Save Session" })
|
||||
vim.keymap.set('n', "<leader>xl", function() require("persistence").load({ last = true }) end, { desc = "Restore Last Session" })
|
||||
vim.keymap.set('n', "<leader>xd", function() require("persistence").stop() end, { desc = "Don't Save Current Session" })
|
||||
@@ -0,0 +1 @@
|
||||
require('quicker').setup()
|
||||
@@ -0,0 +1,33 @@
|
||||
|
||||
require('render-markdown').setup({
|
||||
completions = { lsp = { enabled = true } },
|
||||
-- render_modes = { 'n', 'v' },
|
||||
render_modes = true,
|
||||
enabled = true,
|
||||
anti_conceal = {
|
||||
enabled = false,
|
||||
},
|
||||
quote = { repeat_linebreak = true },
|
||||
checkbox = {
|
||||
-- unchecked = { icon = '✘ ' },
|
||||
checked = { icon = '✔ ', scope_highlight = '@markup.strikethrough' },
|
||||
custom = {
|
||||
todo = { raw = '[-]', rendered = ' ', highlight = 'RenderMarkdownTodo', scope_highlight = nil },
|
||||
important = { raw = '[~]', rendered = ' ', highlight = 'DiagnosticWarn', },
|
||||
},
|
||||
},
|
||||
latex = {
|
||||
enabled = false,
|
||||
converter = "latex2text",
|
||||
},
|
||||
win_options = {
|
||||
conceallevel = {
|
||||
default = 0,
|
||||
rendered = 2, -- Conceal level 2: hide LaTeX code fully
|
||||
},
|
||||
concealcursor = {
|
||||
default = "",
|
||||
rendered = "n", -- Conceal only in normal mode
|
||||
},
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,282 @@
|
||||
require('snacks').setup({
|
||||
animate = {
|
||||
enabled = false,
|
||||
duration = { step = 1, total = 1 },
|
||||
easing = "linear",
|
||||
},
|
||||
bigfile = { enabled = true },
|
||||
dashboard = { enabled = false },
|
||||
explorer = { enabled = false },
|
||||
image = {
|
||||
enabled = true,
|
||||
inline = false,
|
||||
scale = 3, -- nil | 1 (default) | 2 | 3 | ...
|
||||
doc = {
|
||||
inline = true,
|
||||
enabled = true,
|
||||
max_width = nil,
|
||||
max_height = nil,
|
||||
conceal = true,
|
||||
},
|
||||
math = {
|
||||
enabled = true,
|
||||
}
|
||||
},
|
||||
terminal = {
|
||||
bo = {
|
||||
filetype = "snacks_terminal",
|
||||
},
|
||||
win = { style = "terminal" },
|
||||
wo = {},
|
||||
keys = {
|
||||
q = "hide",
|
||||
gf = function(self)
|
||||
local f = vim.fn.findfile(vim.fn.expand("<cfile>"), "**")
|
||||
if f == "" then
|
||||
Snacks.notify.warn("No file under cursor")
|
||||
else
|
||||
self:hide()
|
||||
vim.schedule(function()
|
||||
vim.cmd("e " .. f)
|
||||
end)
|
||||
end
|
||||
end,
|
||||
term_normal = {
|
||||
"<esc><esc>",
|
||||
function(self)
|
||||
self.esc_timer = self.esc_timer or (vim.uv or vim.loop).new_timer()
|
||||
if self.esc_timer:is_active() then
|
||||
self.esc_timer:stop()
|
||||
vim.cmd("stopinsert")
|
||||
else
|
||||
self.esc_timer:start(250, 0, function() end)
|
||||
return "<esc>"
|
||||
end
|
||||
end,
|
||||
mode = "t",
|
||||
expr = true,
|
||||
desc = "Double escape to normal mode",
|
||||
},
|
||||
},
|
||||
},
|
||||
indent = { enabled = false },
|
||||
notifier = {
|
||||
enabled = true,
|
||||
timeout = 1000,
|
||||
},
|
||||
picker = {
|
||||
enabled = true,
|
||||
layout = { preset = "ivy", layout = { position = "bottom" } },
|
||||
frecency = true,
|
||||
history_bonus = true,
|
||||
projects = {
|
||||
dev = { "~/Projects", },
|
||||
},
|
||||
actions = {
|
||||
flash = function(picker)
|
||||
require("flash").jump({
|
||||
pattern = "^",
|
||||
label = { after = { 0, 0 } },
|
||||
search = {
|
||||
mode = "search",
|
||||
exclude = {
|
||||
function(win)
|
||||
return vim.bo[vim.api.nvim_win_get_buf(win)].filetype ~= "snacks_picker_list"
|
||||
end,
|
||||
},
|
||||
},
|
||||
action = function(match)
|
||||
local idx = picker.list:row2idx(match.pos[1])
|
||||
picker.list:_move(idx, true, true)
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
win = {
|
||||
input = {
|
||||
keys = {
|
||||
['<c-e>'] = { 'layout_right', mode = { 'i', 'n' } },
|
||||
["<a-s>"] = { "flash", mode = { "n", "i" } },
|
||||
["s"] = { "flash" },
|
||||
},
|
||||
},
|
||||
},
|
||||
sources = {
|
||||
files = {
|
||||
-- add a custom action
|
||||
actions = {
|
||||
create_if_missing = function(picker, item)
|
||||
-- When typing in the input, item may be nil.
|
||||
-- We'll use the input text as the intended file path.
|
||||
local input = picker.input and picker.input:get() or ""
|
||||
if input == "" then return end
|
||||
|
||||
-- Make it relative to picker cwd if it’s not absolute
|
||||
local cwd = picker.opts.cwd or vim.loop.cwd()
|
||||
local path = input
|
||||
if not path:match("^/") and not path:match("^%a:[/\\]") then
|
||||
path = cwd .. "/" .. path
|
||||
end
|
||||
|
||||
-- Normalize path (optional)
|
||||
path = vim.fn.fnamemodify(path, ":p")
|
||||
|
||||
-- If file exists, just open it
|
||||
if vim.loop.fs_stat(path) then
|
||||
picker:close()
|
||||
vim.cmd.edit(path)
|
||||
return
|
||||
end
|
||||
|
||||
-- Ensure parent dirs exist (optional but nice)
|
||||
vim.fn.mkdir(vim.fn.fnamemodify(path, ":h"), "p")
|
||||
|
||||
-- Open a new buffer at that path (creates buffer even if file missing)
|
||||
picker:close()
|
||||
vim.cmd.edit(path)
|
||||
-- At this point buffer is new + unnamed-on-disk until you :w
|
||||
end,
|
||||
},
|
||||
|
||||
-- bind the action to a key in the picker UI
|
||||
win = {
|
||||
input = {
|
||||
keys = {
|
||||
["<M-n>"] = { "create_if_missing", mode = { "i", "n" }, desc = "Create file from input" },
|
||||
},
|
||||
},
|
||||
list = {
|
||||
keys = {
|
||||
["<M-n>"] = { "create_if_missing", mode = { "n" }, desc = "Create file from input" },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
scope = { enabled = false },
|
||||
scratch = {
|
||||
ft = "markdown",
|
||||
},
|
||||
statuscolumn = { enabled = true },
|
||||
styles = {
|
||||
notification = {
|
||||
-- wo = { wrap = true } -- Wrap notifications
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
vim.keymap.set('n', "<leader>o/", function() Snacks.picker.grep({dirs = { os.getenv("HOME") .. "/Documents/notes" }}) end, { desc = "Search Org Files" })
|
||||
vim.keymap.set('n', "<leader><Space>", function() Snacks.picker.smart() end, { desc = "Smart Find Files" })
|
||||
vim.keymap.set('n', "<leader>j", function() Snacks.picker.files({args = { "--no-require-git" }}) end, { desc = "Find Files" })
|
||||
vim.keymap.set('n', "<leader>,", function() Snacks.picker.buffers() end, { desc = "Buffers" })
|
||||
vim.keymap.set('n', "<leader>/", function() Snacks.picker.grep() end, { desc = "Grep" })
|
||||
vim.keymap.set('n', "<leader>:", function() Snacks.picker.command_history() end, { desc = "Command History" })
|
||||
vim.keymap.set('n', "<leader>n", function() Snacks.picker.notifications() end, { desc = "Notification History" })
|
||||
vim.keymap.set('n', "<leader>i", function() Snacks.picker.lsp_symbols() end, { desc = "Symbols" })
|
||||
vim.keymap.set('n', "<leader>I", function() Snacks.picker.lsp_workspace_symbols() end, { desc = "LSP Workspace Symbols" })
|
||||
vim.keymap.set('n', "<leader>fb", function() Snacks.picker.buffers() end, { desc = "Buffers" })
|
||||
vim.keymap.set('n', "<leader>fc", function() Snacks.picker.files({ cwd = vim.fn.stdpath("config") }) end, { desc = "Find Config File" })
|
||||
vim.keymap.set('n', "<leader>ff", function() Snacks.picker.files() end, { desc = "Find Files" })
|
||||
vim.keymap.set('n', "<leader>fg", function() Snacks.picker.git_files() end, { desc = "Find Git Files" })
|
||||
vim.keymap.set('n', "<leader>fp", function() Snacks.picker.projects() end, { desc = "Projects" })
|
||||
vim.keymap.set('n', "<leader>fr", function() Snacks.picker.recent() end, { desc = "Recent" })
|
||||
vim.keymap.set('n', "<leader>gb", function() Snacks.picker.git_branches() end, { desc = "Git Branches" })
|
||||
vim.keymap.set('n', "<leader>gl", function() Snacks.picker.git_log() end, { desc = "Git Log" })
|
||||
vim.keymap.set('n', "<leader>gL", function() Snacks.picker.git_log_line() end, { desc = "Git Log Line" })
|
||||
vim.keymap.set('n', "<leader>gs", function() Snacks.picker.git_status() end, { desc = "Git Status" })
|
||||
vim.keymap.set('n', "<leader>gS", function() Snacks.picker.git_stash() end, { desc = "Git Stash" })
|
||||
vim.keymap.set('n', "<leader>gd", function() Snacks.picker.git_diff() end, { desc = "Git Diff (Hunks)" })
|
||||
vim.keymap.set('n', "<leader>gf", function() Snacks.picker.git_log_file() end, { desc = "Git Log File" })
|
||||
vim.keymap.set('n', "<leader>sb", function() Snacks.picker.lines() end, { desc = "Buffer Lines" })
|
||||
vim.keymap.set('n', "<leader>sB", function() Snacks.picker.grep_buffers() end, { desc = "Grep Open Buffers" })
|
||||
vim.keymap.set('n', "<leader>sg", function() Snacks.picker.grep() end, { desc = "Grep" })
|
||||
vim.keymap.set('n', '<leader>s"', function() Snacks.picker.registers() end, { desc = "Registers" })
|
||||
vim.keymap.set('n', '<leader>s/', function() Snacks.picker.search_history() end, { desc = "Search History" })
|
||||
vim.keymap.set('n', "<leader>sa", function() Snacks.picker.autocmds() end, { desc = "Autocmds" })
|
||||
vim.keymap.set('n', "<leader>sb", function() Snacks.picker.lines() end, { desc = "Buffer Lines" })
|
||||
vim.keymap.set('n', "<leader>sc", function() Snacks.picker.command_history() end, { desc = "Command History" })
|
||||
vim.keymap.set('n', "<leader>sC", function() Snacks.picker.commands() end, { desc = "Commands" })
|
||||
vim.keymap.set('n', "<leader>sd", function() Snacks.picker.diagnostics() end, { desc = "Diagnostics" })
|
||||
vim.keymap.set('n', "<leader>sD", function() Snacks.picker.diagnostics_buffer() end, { desc = "Buffer Diagnostics" })
|
||||
vim.keymap.set('n', "<leader>sh", function() Snacks.picker.help() end, { desc = "Help Pages" })
|
||||
vim.keymap.set('n', "<leader>sH", function() Snacks.picker.highlights() end, { desc = "Highlights" })
|
||||
vim.keymap.set('n', "<leader>si", function() Snacks.picker.icons() end, { desc = "Icons" })
|
||||
vim.keymap.set('n', "<leader>sj", function() Snacks.picker.jumps() end, { desc = "Jumps" })
|
||||
vim.keymap.set('n', "<leader>sk", function() Snacks.picker.keymaps() end, { desc = "Keymaps" })
|
||||
vim.keymap.set('n', "<leader>sl", function() Snacks.picker.loclist() end, { desc = "Location List" })
|
||||
vim.keymap.set('n', "<leader>sm", function() Snacks.picker.marks() end, { desc = "Marks" })
|
||||
vim.keymap.set('n', "<leader>sM", function() Snacks.picker.man() end, { desc = "Man Pages" })
|
||||
vim.keymap.set('n', "<leader>sp", function() Snacks.picker.lazy() end, { desc = "Search for Plugin Spec" })
|
||||
vim.keymap.set('n', "<leader>sq", function() Snacks.picker.qflist() end, { desc = "Quickfix List" })
|
||||
vim.keymap.set('n', "<leader>sR", function() Snacks.picker.resume() end, { desc = "Resume" })
|
||||
vim.keymap.set('n', "<leader>su", function() Snacks.picker.undo() end, { desc = "Undo History" })
|
||||
vim.keymap.set('n', "<leader>sz", function() Snacks.picker.zoxide() end, { desc = "Zoxide" })
|
||||
vim.keymap.set('n', "<leader>uC", function() Snacks.picker.colorschemes() end, { desc = "Colorschemes" })
|
||||
vim.keymap.set('n', "gd", function() Snacks.picker.lsp_definitions() end, { desc = "Goto Definition" })
|
||||
vim.keymap.set('n', "gD", function() Snacks.picker.lsp_declarations() end, { desc = "Goto Declaration" })
|
||||
vim.keymap.set('n', "gri", function() Snacks.picker.lsp_implementations() end, { desc = "Goto Implementation" })
|
||||
vim.keymap.set('n', "gy", function() Snacks.picker.lsp_type_definitions() end, { desc = "Goto T[y]pe Definition" })
|
||||
vim.keymap.set('n', "<leader>ss", function() Snacks.picker.lsp_symbols() end, { desc = "LSP Symbols" })
|
||||
vim.keymap.set('n', "<leader>sS", function() Snacks.picker.lsp_workspace_symbols() end, { desc = "LSP Workspace Symbols" })
|
||||
vim.keymap.set('n', "<leader>Z", function() Snacks.zen() end, { desc = "Toggle Zen Mode" })
|
||||
vim.keymap.set('n', "<leader>z", function() Snacks.zen.zoom() end, { desc = "Toggle Zoom" })
|
||||
vim.keymap.set('n', "<leader>.", function() Snacks.scratch() end, { desc = "Toggle Scratch Buffer" })
|
||||
vim.keymap.set('n', "<leader>S", function() Snacks.scratch.select() end, { desc = "Select Scratch Buffer" })
|
||||
vim.keymap.set('n', "<leader>bd", function() Snacks.bufdelete() end, { desc = "Delete Buffer" })
|
||||
vim.keymap.set('n', "<leader>bR", function() Snacks.rename.rename_file() end, { desc = "Rename File" })
|
||||
vim.keymap.set('n', "<leader>gg", function() Snacks.lazygit() end, { desc = "Lazygit" })
|
||||
vim.keymap.set('n', "<leader>un", function() Snacks.notifier.hide() end, { desc = "Dismiss All Notifications" })
|
||||
vim.keymap.set('n', "grr", function() Snacks.picker.lsp_references() end, { nowait = true, desc = "References" })
|
||||
|
||||
vim.keymap.set({ "n", "x" }, "<leader>sw", function() Snacks.picker.grep_word() end, { desc = "Visual selection or word" })
|
||||
vim.keymap.set({ "n", "v" }, "<leader>gB", function() Snacks.gitbrowse() end, { desc = "Git Browse" })
|
||||
vim.keymap.set({ "n", "t" }, "<c-_>", function() Snacks.terminal.toggle() end, { desc = "Toggle Terminal" })
|
||||
vim.keymap.set({ "n", "t" }, "]]", function() Snacks.words.jump(vim.v.count1) end, { desc = "Next Reference" })
|
||||
vim.keymap.set({ "n", "t" }, "[[", function() Snacks.words.jump(-vim.v.count1) end, { desc = "Prev Reference" })
|
||||
|
||||
vim.keymap.set('n', '<leader>xN',
|
||||
function()
|
||||
Snacks.win({
|
||||
file = vim.api.nvim_get_runtime_file("doc/news.txt", false)[1],
|
||||
width = 0.6,
|
||||
height = 0.6,
|
||||
wo = {
|
||||
spell = false,
|
||||
wrap = false,
|
||||
signcolumn = "yes",
|
||||
statuscolumn = " ",
|
||||
conceallevel = 3,
|
||||
},
|
||||
})
|
||||
end,
|
||||
{ desc = "Neovim News" })
|
||||
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "VeryLazy",
|
||||
callback = function()
|
||||
-- Setup some globals for debugging (lazy-loaded)
|
||||
_G.dd = function(...)
|
||||
Snacks.debug.inspect(...)
|
||||
end
|
||||
_G.bt = function()
|
||||
Snacks.debug.backtrace()
|
||||
end
|
||||
vim.print = _G.dd -- Override print to use snacks for `:=` command
|
||||
|
||||
-- Create some toggle mappings
|
||||
Snacks.toggle.option("spell", { name = "Spelling" }):map("<leader>us")
|
||||
Snacks.toggle.option("wrap", { name = "Wrap" }):map("<leader>uw")
|
||||
Snacks.toggle.option("relativenumber", { name = "Relative Number" }):map("<leader>uL")
|
||||
Snacks.toggle.diagnostics():map("<leader>ud")
|
||||
Snacks.toggle.line_number():map("<leader>ul")
|
||||
Snacks.toggle.option("conceallevel", { off = 0, on = vim.o.conceallevel > 0 and vim.o.conceallevel or 2 }):map("<leader>uc")
|
||||
Snacks.toggle.treesitter():map("<leader>uT")
|
||||
Snacks.toggle.option("background", { off = "light", on = "dark", name = "Dark Background" }):map("<leader>ub")
|
||||
Snacks.toggle.inlay_hints():map("<leader>uh")
|
||||
Snacks.toggle.indent():map("<leader>ug")
|
||||
Snacks.toggle.dim():map("<leader>uD")
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
|
||||
vim.keymap.set({ 'n' }, "<leader>sr", function() require("spectre").open() end, { desc = "Replace in files (Spectre)" })
|
||||
|
||||
require('spectre').setup({
|
||||
open_cmd = "noswapfile vnew",
|
||||
highlight = {
|
||||
search = "SpectreSearch",
|
||||
replace = "SpectreReplace",
|
||||
},
|
||||
mapping = {
|
||||
["send_to_qf"] = {
|
||||
map = "<C-q>",
|
||||
cmd = "<cmd>lua require('spectre.actions').send_to_qf()<CR>",
|
||||
desc = "send all items to quickfix",
|
||||
},
|
||||
},
|
||||
})
|
||||
@@ -0,0 +1,8 @@
|
||||
vim.pack.add({{ src = 'https://github.com/ellisonleao/gruvbox.nvim' }})
|
||||
|
||||
require("gruvbox").setup({
|
||||
contrast = "hard",
|
||||
transparent_mode = true,
|
||||
})
|
||||
|
||||
vim.cmd("colorscheme gruvbox")
|
||||
@@ -0,0 +1,3 @@
|
||||
|
||||
vim.keymap.set('n', '<leader>st', function() Snacks.picker.todo_comments() end, { desc = 'Todo' })
|
||||
vim.keymap.set('n', '<leader>sT', function() Snacks.picker.todo_comments({ keywords = { "TODO", "FIX", "FIXME", "NOTE" } }) end, { desc = "Todo/Fix/Fixme/Note" })
|
||||
@@ -0,0 +1,18 @@
|
||||
require("toggleterm").setup({
|
||||
-- highlights = require("rose-pine.plugins.toggleterm"),
|
||||
size = 20,
|
||||
open_mapping = [[<c-\>]],
|
||||
hide_numbers = true,
|
||||
shade_terminals = true,
|
||||
shading_factor = 2,
|
||||
start_in_insert = true,
|
||||
insert_mappings = true,
|
||||
persiste_size = true,
|
||||
direction = 'horizontal',
|
||||
close_on_exit = true,
|
||||
float_opts = {
|
||||
border = "curved",
|
||||
}
|
||||
})
|
||||
|
||||
vim.keymap.set('t', "<Esc><Esc>", "<c-\\><c-n>", { desc = "Escape input" })
|
||||
@@ -0,0 +1,234 @@
|
||||
vim.keymap.set({'n'}, '<leader>gn', '<cmd>Neogit kind=auto<cr>', { desc = 'Neogit' })
|
||||
vim.keymap.set({'n'}, '<leader>gN', '<cmd>Neogit kind=floating<cr>', { desc = 'Neogit' })
|
||||
vim.keymap.set({'n'}, '<leader>xm', '<cmd>Lazy reload mise.nvim<cr>', { desc = "Reload mise environment" })
|
||||
vim.keymap.set({'n'}, '<leader>kp', '<cmd>PasteImage<cr>', { desc = "Paste image from system clipboard" })
|
||||
vim.keymap.set({ 'n' }, '<leader>uu', vim.cmd.UndotreeToggle, { desc = 'Format buffer' })
|
||||
|
||||
require('kulala').setup()
|
||||
|
||||
require("just").setup({
|
||||
fidget_message_limit = 32, -- limit for length of fidget progress message
|
||||
open_qf_on_error = true, -- opens quickfix when task fails
|
||||
open_qf_on_run = true, -- opens quickfix when running `run` task (`:JustRun`)
|
||||
open_qf_on_any = false; -- opens quickfix when running any task (overrides other open_qf options)
|
||||
autoscroll_qf = true, -- automatically scroll quickfix window on output
|
||||
register_commands = true, -- if set to true then commands (:Just*) will be registered
|
||||
notify = vim.notify, -- what to use to show messages/errors
|
||||
})
|
||||
require('img-clip').setup()
|
||||
require('sshfs').setup({
|
||||
mounts = {
|
||||
base_dir = vim.fn.expand("$HOME") .. "/Public", -- where remote mounts are created
|
||||
},
|
||||
-- Refer to the configuration section below
|
||||
-- or leave empty for defaults
|
||||
})
|
||||
require('mise').setup({
|
||||
unset_vars = true,
|
||||
load_on_setup = true,
|
||||
force_run = true,
|
||||
})
|
||||
|
||||
require('neogit').setup({
|
||||
-- disable_context_highlighting = true,
|
||||
disable_commit_confirmation = true,
|
||||
disable_insert_on_commit = false,
|
||||
disable_signs = true,
|
||||
integrations = { diffview = true, fz_lua = false },
|
||||
auto_refresh = false,
|
||||
console_timeout = 5000,
|
||||
auto_show_console = false,
|
||||
sections = {
|
||||
stashes = {
|
||||
folded = false,
|
||||
},
|
||||
recent = { folded = false },
|
||||
},
|
||||
})
|
||||
require('zincoxide').setup({
|
||||
zincoxide_cmd = "zoxide",
|
||||
complete = true,
|
||||
behaviour = "tabs",
|
||||
})
|
||||
|
||||
|
||||
|
||||
vim.keymap.set('n', "<leader>xo", "<cmd>OverseerOpen<CR>", { desc = "Open Overseer" })
|
||||
vim.keymap.set('n', "<leader>to", "<cmd>OverseerToggle<CR>", { desc = "Overseer Toggle" })
|
||||
vim.keymap.set('n', "<F5>", "<cmd>OverseerRun<CR>", { desc = "Run Overseer" })
|
||||
vim.keymap.set('n', "<F6>", "<cmd>OverseerToggle<CR>", { desc = "Overseer Toggle" })
|
||||
|
||||
require("overseer").setup({
|
||||
templates = { "builtin", "user" },
|
||||
component_aliases = {
|
||||
default = {
|
||||
{ 'display_duration', detail_level = 2 },
|
||||
'on_output_summarize',
|
||||
'on_exit_set_status',
|
||||
'on_result_diagnostics_quickfix',
|
||||
'on_complete_notify',
|
||||
{ "on_complete_dispose", require_view = { "SUCCESS", "FAILURE" } },
|
||||
},
|
||||
default_vscode = {
|
||||
'default',
|
||||
'on_result_diagnostics',
|
||||
'on_result_diagnostics_quickfix',
|
||||
'on_complete_notify',
|
||||
},
|
||||
}
|
||||
})
|
||||
|
||||
-- local pm = require("overseer.template.vscode.problem_matcher")
|
||||
-- pm.register_problem_matcher("$rustc", {
|
||||
-- fileLocation = { "autoDetect", "${cwd}" },
|
||||
-- pattern = {
|
||||
-- --regexp = "^(.*?)-->\\s+(.*?):(\\d+):(\\d+)$",
|
||||
-- -- vim_regexp = "\\v^(.*?)-->\\s+(.*?):(\\d+):(\\d+)$",
|
||||
-- regexp = "^\\s+-->\\s*([^:]*):(\\d+):(\\d+)$",
|
||||
-- vim_regexp = "\\v^\\s+-->\\s*([^:]*):(\\d+):(\\d+)$",
|
||||
-- file = 1,
|
||||
-- line = 2,
|
||||
-- column = 3,
|
||||
-- }
|
||||
-- })
|
||||
|
||||
local osys = require("cmake-tools.osys")
|
||||
require("cmake-tools").setup {
|
||||
cmake_command = "cmake", -- this is used to specify cmake command path
|
||||
ctest_command = "ctest", -- this is used to specify ctest command path
|
||||
cmake_use_preset = true,
|
||||
cmake_regenerate_on_save = true, -- auto generate when save CMakeLists.txt
|
||||
cmake_generate_options = { "-DCMAKE_EXPORT_COMPILE_COMMANDS=1" }, -- this will be passed when invoke `CMakeGenerate`
|
||||
cmake_build_options = {}, -- this will be passed when invoke `CMakeBuild`
|
||||
-- support macro expansion:
|
||||
-- ${kit}
|
||||
-- ${kitGenerator}
|
||||
-- ${variant:xx}
|
||||
cmake_build_directory = function()
|
||||
if osys.iswin32 then
|
||||
return "out\\${variant:buildType}"
|
||||
end
|
||||
return "out/${variant:buildType}"
|
||||
end, -- this is used to specify generate directory for cmake, allows macro expansion, can be a string or a function returning the string, relative to cwd.
|
||||
cmake_soft_link_compile_commands = true, -- this will automatically make a soft link from compile commands file to project root dir
|
||||
cmake_compile_commands_from_lsp = false, -- this will automatically set compile commands file location using lsp, to use it, please set `cmake_soft_link_compile_commands` to false
|
||||
cmake_kits_path = nil, -- this is used to specify global cmake kits path, see CMakeKits for detailed usage
|
||||
cmake_variants_message = {
|
||||
short = { show = true }, -- whether to show short message
|
||||
long = { show = true, max_length = 40 }, -- whether to show long message
|
||||
},
|
||||
cmake_dap_configuration = { -- debug settings for cmake
|
||||
name = "cpp",
|
||||
type = "codelldb",
|
||||
request = "launch",
|
||||
stopOnEntry = false,
|
||||
runInTerminal = true,
|
||||
console = "integratedTerminal",
|
||||
},
|
||||
cmake_executor = { -- executor to use
|
||||
name = "quickfix", -- name of the executor
|
||||
opts = {}, -- the options the executor will get, possible values depend on the executor type. See `default_opts` for possible values.
|
||||
default_opts = { -- a list of default and possible values for executors
|
||||
quickfix = {
|
||||
show = "always", -- "always", "only_on_error"
|
||||
position = "belowright", -- "vertical", "horizontal", "leftabove", "aboveleft", "rightbelow", "belowright", "topleft", "botright", use `:h vertical` for example to see help on them
|
||||
size = 10,
|
||||
encoding = "utf-8", -- if encoding is not "utf-8", it will be converted to "utf-8" using `vim.fn.iconv`
|
||||
auto_close_when_success = true, -- typically, you can use it with the "always" option; it will auto-close the quickfix buffer if the execution is successful.
|
||||
},
|
||||
toggleterm = {
|
||||
direction = "float", -- 'vertical' | 'horizontal' | 'tab' | 'float'
|
||||
close_on_exit = false, -- whether close the terminal when exit
|
||||
auto_scroll = true, -- whether auto scroll to the bottom
|
||||
singleton = true, -- single instance, autocloses the opened one, if present
|
||||
},
|
||||
overseer = {
|
||||
new_task_opts = {
|
||||
strategy = {
|
||||
"toggleterm",
|
||||
direction = "horizontal",
|
||||
autos_croll = true,
|
||||
quit_on_exit = "success"
|
||||
}
|
||||
}, -- options to pass into the `overseer.new_task` command
|
||||
on_new_task = function(task)
|
||||
require("overseer").open(
|
||||
{ enter = false, direction = "right" }
|
||||
)
|
||||
end, -- a function that gets overseer.Task when it is created, before calling `task:start`
|
||||
},
|
||||
terminal = {
|
||||
name = "Main Terminal",
|
||||
prefix_name = "[CMakeTools]: ", -- This must be included and must be unique, otherwise the terminals will not work. Do not use a simple spacebar " ", or any generic name
|
||||
split_direction = "horizontal", -- "horizontal", "vertical"
|
||||
split_size = 11,
|
||||
|
||||
-- Window handling
|
||||
single_terminal_per_instance = true, -- Single viewport, multiple windows
|
||||
single_terminal_per_tab = true, -- Single viewport per tab
|
||||
keep_terminal_static_location = true, -- Static location of the viewport if avialable
|
||||
auto_resize = true, -- Resize the terminal if it already exists
|
||||
|
||||
-- Running Tasks
|
||||
start_insert = false, -- If you want to enter terminal with :startinsert upon using :CMakeRun
|
||||
focus = false, -- Focus on terminal when cmake task is launched.
|
||||
do_not_add_newline = false, -- Do not hit enter on the command inserted when using :CMakeRun, allowing a chance to review or modify the command before hitting enter.
|
||||
}, -- terminal executor uses the values in cmake_terminal
|
||||
},
|
||||
},
|
||||
cmake_runner = { -- runner to use
|
||||
name = "terminal", -- name of the runner
|
||||
opts = {}, -- the options the runner will get, possible values depend on the runner type. See `default_opts` for possible values.
|
||||
default_opts = { -- a list of default and possible values for runners
|
||||
quickfix = {
|
||||
show = "always", -- "always", "only_on_error"
|
||||
position = "belowright", -- "bottom", "top"
|
||||
size = 10,
|
||||
encoding = "utf-8",
|
||||
auto_close_when_success = true, -- typically, you can use it with the "always" option; it will auto-close the quickfix buffer if the execution is successful.
|
||||
},
|
||||
toggleterm = {
|
||||
direction = "float", -- 'vertical' | 'horizontal' | 'tab' | 'float'
|
||||
close_on_exit = false, -- whether close the terminal when exit
|
||||
auto_scroll = true, -- whether auto scroll to the bottom
|
||||
singleton = true, -- single instance, autocloses the opened one, if present
|
||||
},
|
||||
overseer = {
|
||||
new_task_opts = {
|
||||
strategy = {
|
||||
"toggleterm",
|
||||
direction = "horizontal",
|
||||
autos_croll = true,
|
||||
quit_on_exit = "success"
|
||||
}
|
||||
}, -- options to pass into the `overseer.new_task` command
|
||||
on_new_task = function(task)
|
||||
end, -- a function that gets overseer.Task when it is created, before calling `task:start`
|
||||
},
|
||||
terminal = {
|
||||
name = "Main Terminal",
|
||||
prefix_name = "[CMakeTools]: ", -- This must be included and must be unique, otherwise the terminals will not work. Do not use a simple spacebar " ", or any generic name
|
||||
split_direction = "horizontal", -- "horizontal", "vertical"
|
||||
split_size = 11,
|
||||
|
||||
-- Window handling
|
||||
single_terminal_per_instance = true, -- Single viewport, multiple windows
|
||||
single_terminal_per_tab = true, -- Single viewport per tab
|
||||
keep_terminal_static_location = true, -- Static location of the viewport if avialable
|
||||
auto_resize = true, -- Resize the terminal if it already exists
|
||||
|
||||
-- Running Tasks
|
||||
start_insert = false, -- If you want to enter terminal with :startinsert upon using :CMakeRun
|
||||
focus = false, -- Focus on terminal when cmake task is launched.
|
||||
do_not_add_newline = false, -- Do not hit enter on the command inserted when using :CMakeRun, allowing a chance to review or modify the command before hitting enter.
|
||||
},
|
||||
},
|
||||
},
|
||||
cmake_notifications = {
|
||||
runner = { enabled = true },
|
||||
executor = { enabled = true },
|
||||
spinner = { "⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏" }, -- icons used for progress display
|
||||
refresh_rate_ms = 100, -- how often to iterate icons
|
||||
},
|
||||
cmake_virtual_text_support = true, -- Show the target related to current file using virtual text (at right corner)
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
|
||||
vim.g.no_plugin_maps = true
|
||||
local ts_parsers = {
|
||||
"bash",
|
||||
"dockerfile",
|
||||
"git_config", "git_rebase", "gitattributes", "gitcommit", "gitignore",
|
||||
"go", "gomod", "gosum",
|
||||
"json", "toml", "yaml",
|
||||
"lua",
|
||||
"make",
|
||||
"markdown",
|
||||
"python",
|
||||
"terraform",
|
||||
"vim", "vimdoc",
|
||||
'c',
|
||||
"lua",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"query",
|
||||
"html", "xml",
|
||||
"zig",
|
||||
"typescript", "javascript", "svelte",
|
||||
"regex",
|
||||
"rust",
|
||||
"http",
|
||||
}
|
||||
|
||||
local nts = require("nvim-treesitter")
|
||||
nts.install(ts_parsers)
|
||||
-- vim.api.nvim_create_autocmd('PackChanged', {
|
||||
-- callback = function()
|
||||
-- nts.update()
|
||||
-- end
|
||||
-- })
|
||||
|
||||
vim.api.nvim_create_autocmd("FileType", { -- enable treesitter highlighting and indents
|
||||
callback = function(args)
|
||||
local filetype = args.match
|
||||
local lang = vim.treesitter.language.get_lang(filetype)
|
||||
if vim.treesitter.language.add(lang) then
|
||||
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
|
||||
vim.treesitter.start()
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
-- vim.api.nvim_create_autocmd('FileType', {
|
||||
-- pattern = ts_parsers,
|
||||
-- callback = function()
|
||||
-- vim.treesitter.start()
|
||||
-- end,
|
||||
-- })
|
||||
|
||||
-- require('ts-context-commentstring').setup({
|
||||
-- enable_autocmd = false
|
||||
-- })
|
||||
|
||||
require("treesitter-context").setup({
|
||||
mode = "cursor",
|
||||
max_lines = 3,
|
||||
multiline_threshold = 1,
|
||||
separator = '-',
|
||||
min_window_height = 20,
|
||||
line_numbers = true,
|
||||
})
|
||||
@@ -0,0 +1,5 @@
|
||||
vim.keymap.set('n', "<c-h>", "<cmd><C-U>TmuxNavigateLeft<cr>" )
|
||||
vim.keymap.set('n', "<c-j>", "<cmd><C-U>TmuxNavigateDown<cr>" )
|
||||
vim.keymap.set('n', "<c-k>", "<cmd><C-U>TmuxNavigateUp<cr>" )
|
||||
vim.keymap.set('n', "<c-l>", "<cmd><C-U>TmuxNavigateRight<cr>" )
|
||||
-- vim.keymap.set('n', "<c-\\>", "<cmd><C-U>TmuxNavigatePrevious<cr>")
|
||||
@@ -0,0 +1,5 @@
|
||||
vim.g.tex_flavor = "latex"
|
||||
vim.g.vimtex_view_method = "zathura" -- Change to your preferred PDF viewer
|
||||
vim.g.vimtex_quickfix_mode = 0 -- Disable quickfix window
|
||||
-- vim.opt.conceallevel = 2 -- Enable concealment for nicer inline math display
|
||||
vim.g.tex_conceal = "abdmg" -- Conceal accents, bold, delimiters, math, Greek
|
||||
@@ -0,0 +1,58 @@
|
||||
require('which-key').setup({
|
||||
icons = {
|
||||
-- set icon mappings to true if you have a Nerd Font
|
||||
mappings = vim.g.have_nerd_font,
|
||||
-- If you are using a Nerd Font: set icons.keys to an empty table which will use the
|
||||
-- default whick-key.nvim defined Nerd Font icons, otherwise define a string table
|
||||
keys = vim.g.have_nerd_font and {} or {
|
||||
Up = '<Up> ',
|
||||
Down = '<Down> ',
|
||||
Left = '<Left> ',
|
||||
Right = '<Right> ',
|
||||
C = '<C-…> ',
|
||||
M = '<M-…> ',
|
||||
D = '<D-…> ',
|
||||
S = '<S-…> ',
|
||||
CR = '<CR> ',
|
||||
Esc = '<Esc> ',
|
||||
ScrollWheelDown = '<ScrollWheelDown> ',
|
||||
ScrollWheelUp = '<ScrollWheelUp> ',
|
||||
NL = '<NL> ',
|
||||
BS = '<BS> ',
|
||||
Space = '<Space> ',
|
||||
Tab = '<Tab> ',
|
||||
F1 = '<F1>',
|
||||
F2 = '<F2>',
|
||||
F3 = '<F3>',
|
||||
F4 = '<F4>',
|
||||
F5 = '<F5>',
|
||||
F6 = '<F6>',
|
||||
F7 = '<F7>',
|
||||
F8 = '<F8>',
|
||||
F9 = '<F9>',
|
||||
F10 = '<F10>',
|
||||
F11 = '<F11>',
|
||||
F12 = '<F12>',
|
||||
},
|
||||
},
|
||||
spec = {
|
||||
{ "g", group = "+goto" },
|
||||
{ "]", group = "+next" },
|
||||
{ "[", group = "+prev" },
|
||||
{ "<leader>c", group = "+code", mode = { 'n', 'x' } },
|
||||
{ "<leader>b", group = "+buffer" },
|
||||
{ "<leader>f", group = "+find" },
|
||||
{ "<leader>g", group = "+goto" },
|
||||
{ "<leader>k", group = "+obsidian" },
|
||||
{ "<leader>l", group = "+lsp" },
|
||||
{ "<leader>m", group = "+bookmark" },
|
||||
{ "<leader>o", group = "+notes" },
|
||||
{ "<leader>r", group = "+ai" },
|
||||
{ "<leader>s", group = "+search" },
|
||||
{ "<leader>t", group = "+trouble" },
|
||||
{ "<leader>v", group = "+vcs", mode = { 'n', 'v' } },
|
||||
{ "<leader>w", group = "+workspace" },
|
||||
{ "<leader>x", group = "+extra" },
|
||||
{ "<leader>u", group = "+toggle" },
|
||||
},
|
||||
})
|
||||
@@ -0,0 +1,18 @@
|
||||
|
||||
require('window-picker').setup({
|
||||
-- Default keys to annotate, keys will be used in order. The default uses the
|
||||
-- most accessible keys from the home row and then top row.
|
||||
keys = 'alskdjfhgwoeiruty',
|
||||
-- Swap windows by holding shift + letter
|
||||
swap_shift = true,
|
||||
-- Windows containing filetype to exclude
|
||||
exclude = { qf = true, NvimTree = true, aerial = true },
|
||||
-- Flash the cursor line of the newly focused window for 300ms.
|
||||
-- Set to 0 or false to disable.
|
||||
flash_duration = 300,
|
||||
})
|
||||
|
||||
vim.keymap.set('n', "<leader>a", "<cmd>WindowPick<cr>", { desc = "Windows Pick" })
|
||||
vim.keymap.set('n', "<C-w>a", "<cmd>WindowPick<cr>", { desc = "Windows Pick" })
|
||||
vim.keymap.set('n', "<C-w>D", "<cmd>WindowZap<cr>", { desc = "Windows Delete" })
|
||||
vim.keymap.set('n', "<C-w>S", "<cmd>WindowSwap<cr>", { desc = "Windows Swap" })
|
||||
Reference in New Issue
Block a user