Compare commits

56 Commits
11 .. 12
Author SHA1 Message Date
jannikdonker c257c2adc4 more debugging stuff 2026-07-10 07:56:15 +02:00
jannikdonker 426064413c improved debugging config 2026-07-08 14:50:14 +02:00
jannikdonker ff762a4f92 removed build of blink.cmp 2026-06-29 09:51:46 +02:00
jannikdonker 9017052ec9 added terminal 2026-06-19 19:13:52 +02:00
jannikdonker c7e90a01ac trouble panel fixes (empty diagnostics and todo) 2026-06-19 18:41:38 +02:00
jannikdonker de3cecce41 blink update 2026-06-18 12:15:32 +02:00
jannikdonker 3c24466dd8 more improvements 2026-06-11 18:44:55 +02:00
jannikdonker 9af90374e2 jumping 2026-06-11 18:32:43 +02:00
jannikdonker d53091f919 some optimizations 2026-06-11 18:23:52 +02:00
jannikdonker bd6b4722e5 better hover 2026-06-11 14:12:20 +02:00
jannikdonker 41144f2c76 escape clears search highlights 2026-06-10 14:11:01 +02:00
jannikdonker 83a4d3086a added wgsl 2026-06-10 14:10:43 +02:00
jannikdonker f00317a6a6 removed flash 2026-06-08 12:36:22 +02:00
jannikdonker 6e8b327320 added tabs for assembly files 2026-06-03 13:09:49 +02:00
jannikdonker 61cf62ff0d added snacks image 2026-05-28 15:23:59 +02:00
jannikdonker 9dcc7ec81f added mdmath for latex image display. 2026-05-21 13:17:52 +02:00
jannikdonker 138dd2d924 markdown hover fix 2026-05-19 15:46:50 +02:00
jannikdonker 66bec6bde3 some fixes 2026-05-18 08:33:31 +02:00
jannikdonker 9946b25f5e barbar keymaps 2026-05-07 09:04:11 +02:00
jannikdonker 44a4e7102e formatting changes 2026-05-03 11:39:49 +02:00
jannikdonker ffd6fac633 added codesnap 2026-04-29 12:55:53 +02:00
jannikdonker 9a725dfc3e added markdown render 2026-04-28 11:37:01 +02:00
jannikdonker 0c40342e29 auto update file/buffer on focus 2026-04-27 08:12:49 +02:00
jannikdonker 7e84105a98 fixed treesitter auto install 2026-04-24 10:02:44 +02:00
jannikdonker d00a72615a added treesitter auto install 2026-04-24 08:36:07 +02:00
jannikdonker be4fd8426c added flash back 2026-04-24 08:34:29 +02:00
jannikdonker 282ab49097 removed flash keybindings 2026-04-23 08:55:36 +02:00
jannikdonker 2de3162fce force main branch of treesitter 2026-04-23 07:52:42 +02:00
jannikdonker 75d1243d0e rewrite and additions 2026-04-22 20:42:40 +02:00
jannikdonker 62f5f79ffd treesitter fix 2026-04-22 19:56:09 +02:00
jannikdonker 2005b410dc added python 2026-04-10 17:33:58 +02:00
Jannik Donker ba6246987e restructure of plugin loading 2026-03-12 11:24:54 +01:00
jannikdonker baa641ad7e jdtls update 2026-01-19 14:21:27 +01:00
jannikdonker 7580b05a25 updates 2025-11-29 20:18:10 +01:00
jannikdonker d97f429afe removed dapui autoclose 2025-11-28 20:26:06 +01:00
jannikdonker 52edde7ba3 added lock to ignore 2025-11-28 20:24:44 +01:00
jannikdonker ab6afd5f05 update 2025-11-15 20:17:07 +01:00
jannikdonker f1982a1b58 added Comment 2025-11-12 21:00:13 +01:00
jannikdonker 4a5e7b0855 added linux/mac handling for barbar (cmd or alt key) 2025-11-05 19:45:59 +01:00
jannikdonker 707b616009 added dapui and treesitter textobjects 2025-11-05 14:07:20 +01:00
jannikdonker 58c3a6875a changed trouble to auto focus window 2025-11-03 19:51:20 +01:00
jannikdonker a3e1bda066 added trouble 2025-11-03 19:46:35 +01:00
jannikdonker a22d7b0130 added barbar + deps 2025-11-03 19:28:26 +01:00
jannikdonker a27bfa4a54 added nvim-dap 2025-11-03 06:38:23 +01:00
jannikdonker 36585be18c added better jdtls config 2025-11-02 20:37:33 +01:00
jannikdonker 0e8da54a0a Merge branch '12' of ssh://git.jannikdonker.de:30009/jannikdonker/nvim into 12 2025-11-01 09:22:56 +01:00
jannikdonker 8a3232e34f added vim as a defined global 2025-11-01 09:19:19 +01:00
jannikdonker a45a2e520f added autoclose 2025-11-01 09:18:58 +01:00
jannikdonker 9a2150501e added json-lsp 2025-10-28 20:43:37 +01:00
jannikdonker cb63ab0296 cleanup dap 2025-10-15 09:29:11 +02:00
jannikdonker cb72792084 added leader-gd for defintion 2025-10-02 15:18:25 +02:00
jannikdonker aad2c79943 added spellcheck stuff 2025-09-19 13:19:46 +02:00
jannikdonker 9fa5fd2099 added java 2025-09-16 11:58:03 +02:00
jannikdonker 36d84be18a fixes
treesitter fix
added lightbulb for code actions
added keybind for code action and renaming
2025-09-16 08:36:05 +02:00
jannikdonker 7d31286524 cleanup 2025-09-16 08:26:07 +02:00
jannikdonker 86aa1a5312 initial commit 2025-09-15 18:50:29 +02:00
25 changed files with 589 additions and 571 deletions
+1
View File
@@ -0,0 +1 @@
nvim-pack-lock.json
+1 -3
View File
@@ -1,7 +1,5 @@
{ {
"diagnostics.globals": [ "diagnostics.globals": [
"vim", "vim"
"testMe",
"result"
] ]
} }
+4
View File
@@ -0,0 +1,4 @@
{
"tabWidth": 4,
"useTabs": false
}
+5 -15
View File
@@ -1,15 +1,5 @@
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" require("options")
if not (vim.uv or vim.loop).fs_stat(lazypath) then require("plugins")
vim.fn.system({ require("lsp")
"git", require("keymaps")
"clone", require("debugging")
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable",
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
require("vim-options")
require("lazy").setup("plugins")
-25
View File
@@ -1,25 +0,0 @@
{
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
"LuaSnip": { "branch": "master", "commit": "fb525166ccc30296fb3457441eb979113de46b00" },
"blink.cmp": { "branch": "main", "commit": "9bcb14b43852a6f2bfd5ac9ef29cb5cf09b1b39b" },
"gruvbox": { "branch": "main", "commit": "00e38a379bab3389e187b3953566d67d494dfddd" },
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
"lualine.nvim": { "branch": "master", "commit": "a94fc68960665e54408fe37dcf573193c4ce82c9" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "f54e3c11fc9ebfcfc27e696182b0295b071d0811" },
"mason.nvim": { "branch": "main", "commit": "8024d64e1330b86044fed4c8494ef3dcd483a67c" },
"neo-tree.nvim": { "branch": "v3.x", "commit": "f481de16a0eb59c985abac8985e3f2e2f75b4875" },
"neoscroll.nvim": { "branch": "master", "commit": "f957373912e88579e26fdaea4735450ff2ef5c9c" },
"none-ls-extras.nvim": { "branch": "main", "commit": "924fe88a9983c7d90dbb31fc4e3129a583ea0a90" },
"none-ls.nvim": { "branch": "main", "commit": "db2a48b79cfcdab8baa5d3f37f21c78b6705c62e" },
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
"nvim-autopairs": { "branch": "master", "commit": "2647cce4cb64fb35c212146663384e05ae126bdf" },
"nvim-lspconfig": { "branch": "master", "commit": "0112e1f77983141e1453bd37d124302f1c876c46" },
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "89ebe73cd2836db80a22d9748999ace0241917a5" },
"nvim-web-devicons": { "branch": "master", "commit": "19d6211c78169e78bab372b585b6fb17ad974e82" },
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
"telescope.nvim": { "branch": "master", "commit": "6312868392331c9c0f22725041f1ec2bef57c751" },
"trouble.nvim": { "branch": "main", "commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3" },
"typst-preview.nvim": { "branch": "master", "commit": "dea4525d5420b7c32eebda7de15a6beb9d6574fa" }
}
+136
View File
@@ -0,0 +1,136 @@
local dap, dapui = require("dap"), require("dapui")
-- Install debug adapters via Mason (same pattern as the LSP tool loop in
-- plugins.lua). codelldb -> c/cpp/rust, debugpy -> python,
-- js-debug-adapter -> node/ts, haskell-debug-adapter -> haskell.
-- java-debug-adapter is installed by the LSP ensure loop and wired through
-- jdtls (see lua/lsp.lua).
-- Note: haskell-debug-adapter builds from source via cabal on first install
-- (needs ghc/cabal on PATH) so it can take a few minutes to appear.
local registry = require("mason-registry")
registry.refresh(function()
for _, tool in ipairs({ "debugpy", "codelldb", "js-debug-adapter", "haskell-debug-adapter" }) do
local ok, pkg = pcall(registry.get_package, tool)
if ok and not pkg:is_installed() then pkg:install() end
end
end)
dapui.setup()
require("nvim-dap-virtual-text").setup()
-- Auto-wire adapters + default launch configs for every mason-installed
-- adapter. Empty handlers = use mason-nvim-dap's default handler for all.
-- To add a language later: install its adapter in the loop above; it is
-- configured here automatically. Override by defining dap.configurations.<ft>
-- below this call.
require("mason-nvim-dap").setup({
ensure_installed = {},
automatic_installation = false,
handlers = {},
})
-- JS/TS (node): mason-nvim-dap ships no default handler for js-debug-adapter,
-- so wire the pwa-node adapter and launch/attach configs manually.
dap.adapters["pwa-node"] = {
type = "server",
host = "localhost",
port = "${port}",
executable = {
command = "node",
args = {
vim.fs.joinpath(vim.fn.stdpath("data"), "mason", "packages",
"js-debug-adapter", "js-debug", "src", "dapDebugServer.js"),
"${port}",
},
},
}
for _, ft in ipairs({ "javascript", "typescript" }) do
dap.configurations[ft] = {
{
type = "pwa-node",
request = "launch",
name = "Launch file",
program = "${file}",
cwd = "${workspaceFolder}",
},
{
type = "pwa-node",
request = "attach",
name = "Attach to process",
processId = require("dap.utils").pick_process,
cwd = "${workspaceFolder}",
},
}
end
-- Haskell (plain ghc): mason-nvim-dap's default handler auto-wires the
-- haskell-debug-adapter, but its default launch config assumes `stack ghci`
-- (with a literal "TARGET" placeholder). Override it to drive ghci-dap
-- directly so a bare `.hs` file debugs with <F5> — no cabal/stack project
-- required. ghci-dap resolves via PATH (mason bin). Switch ghciCmd to
-- `cabal exec -- ghci-dap ...` or `stack ghci --with-ghc=ghci-dap ...` if you
-- later move to a build tool. Verified end-to-end: loads ${file}, stops at
-- entry, hits breakpoints.
dap.configurations.haskell = {
{
type = "haskell",
request = "launch",
name = "Debug (ghc)",
workspace = "${workspaceFolder}",
startup = "${file}",
stopOnEntry = true,
logFile = vim.fs.joinpath(vim.fn.stdpath("data"), "haskell-dap.log"),
logLevel = "WARNING",
ghciEnv = vim.empty_dict(),
ghciPrompt = "H>>= ",
ghciInitialPrompt = "ghci> ",
ghciCmd = "ghci-dap --interactive -i${workspaceFolder} ${startup}",
},
}
-- Run debuggees in dap-ui's Console terminal so programs that read user input
-- work. Without this, nvim-dap uses an output-only internal console with no
-- stdin (the program just hangs on input()/getLine/scanf). dap-ui registers its
-- Console as dap.defaults.fallback.terminal_win_cmd, so any adapter that runs
-- the program in an integrated terminal is routed there. Adapters disagree on
-- the key -- debugpy/pwa-node use `console`, codelldb uses `terminal` -- and
-- each ignores the other, so set both on every launch config. Applies to the
-- mason-auto-generated configs (python/cpp/rust) too, since it runs after their
-- setup. To type: focus the Console window and press `i` (terminal insert).
for _, configs in pairs(dap.configurations) do
for _, cfg in ipairs(configs) do
if cfg.request == "launch" then
if cfg.console == nil then cfg.console = "integratedTerminal" end
if cfg.terminal == nil then cfg.terminal = "integrated" end
end
end
end
-- Open/close the dap-ui panels automatically with the session.
dap.listeners.before.attach.dapui_config = function() dapui.open() end
dap.listeners.before.launch.dapui_config = function() dapui.open() end
dap.listeners.before.event_terminated.dapui_config = function() dapui.close() end
dap.listeners.before.event_exited.dapui_config = function() dapui.close() end
-- VS Code standard F-keys
local map = vim.keymap.set
map("n", "<F5>", dap.continue, { desc = "Debug: continue / start" })
map("n", "<S-F5>", dap.terminate, { desc = "Debug: stop" })
map("n", "<C-S-F5>", dap.restart, { desc = "Debug: restart" })
map("n", "<F6>", dap.pause, { desc = "Debug: pause" })
map("n", "<F9>", dap.toggle_breakpoint, { desc = "Debug: toggle breakpoint" })
map("n", "<F10>", dap.step_over, { desc = "Debug: step over" })
map("n", "<F11>", dap.step_into, { desc = "Debug: step into" })
map("n", "<S-F11>", dap.step_out, { desc = "Debug: step out" })
-- Leader maps (preserve the previous <leader>d* bindings + a few niceties;
-- discoverable via <C-k> Pick keymaps thanks to desc).
map("n", "<leader>duo", dapui.open, { desc = "Debug: open UI" })
map("n", "<leader>duc", dapui.close, { desc = "Debug: close UI" })
map("n", "<leader>dbp", dap.toggle_breakpoint, { desc = "Debug: toggle breakpoint" })
map("n", "<leader>drc", dap.run_to_cursor, { desc = "Debug: run to cursor" })
map("n", "<leader>dr", dap.repl.toggle, { desc = "Debug: toggle REPL" })
map("n", "<leader>de", function() dapui.eval() end, { desc = "Debug: eval under cursor" })
map("n", "<leader>dB", function()
dap.set_breakpoint(vim.fn.input("Breakpoint condition: "))
end, { desc = "Debug: conditional breakpoint" })
+54
View File
@@ -0,0 +1,54 @@
local map = vim.keymap.set
-- Clear search highlighting on Escape
map("n", "<Esc>", "<cmd>nohlsearch<cr>", { silent = true, desc = "Clear search highlight" })
-- Visual line navigation (move by display line over wrapped text)
for _, mode in ipairs({ "n", "x" }) do
map(mode, "j", "gj", { silent = true, desc = "Down (display line)" })
map(mode, "k", "gk", { silent = true, desc = "Up (display line)" })
end
-- Hover: native LSP hover (press K again to focus the window).
-- Border comes from the global `winborder` option.
map("n", "K", function() vim.lsp.buf.hover({ max_width = 80 }) end,
{ desc = "LSP: hover docs" })
-- LSP (rename/code-action/references use native gr* defaults on 0.11+)
map("n", "<leader>gf",
function() require("conform").format({ lsp_format = "fallback" }) end,
{ desc = "LSP: format buffer" })
map("x", "<leader>gs",
function() require("conform").format({ lsp_format = "fallback" }) end,
{ desc = "LSP: format selection" })
map("n", "<leader>gd", vim.lsp.buf.definition, { desc = "LSP: go to definition" })
map("n", "<leader>gD", vim.lsp.buf.declaration, { desc = "LSP: go to declaration" })
-- Trouble
map("n", "<leader>xx", "<cmd>Trouble diagnostics toggle focus=true<cr>",
{ desc = "Trouble: workspace diagnostics" })
map("n", "<leader>xX", "<cmd>Trouble diagnostics toggle filter.buf=0 focus=true<cr>",
{ desc = "Trouble: buffer diagnostics" })
map("n", "<leader>xt", "<cmd>Trouble todo toggle focus=true<cr>", { desc = "Trouble: todo list" })
-- Pickers / files
map("n", "<C-f>", "<cmd>Pick files<cr>", { desc = "Find: files" })
map("n", "<C-g>", "<cmd>Pick grep_live<cr>", { desc = "Find: grep project (disk)" })
map("n", "<C-S-g>", "<cmd>Pick buf_lines scope='all'<cr>", { desc = "Find: grep open buffers" })
map("n", "<C-b>", "<cmd>Pick buffers<cr>", { desc = "Find: buffers" })
map("n", "<C-h>", "<cmd>Pick help<cr>", { desc = "Find: help tags" })
map("n", "<C-e>", "<cmd>Oil<cr>", { desc = "File explorer (Oil)" })
map("n", "<C-k>", "<cmd>Pick keymaps<cr>", { desc = "Find: keymaps" })
-- Spell
map("n", "<leader>sc", function()
vim.wo.spell = not vim.wo.spell
vim.notify("Spell: " .. (vim.wo.spell and "ON" or "OFF"))
end, { desc = "Spell: toggle" })
map("n", "<leader>sl", function()
local cur = vim.opt.spelllang:get()[1] or ""
local new = cur == "en" and "de" or "en"
vim.opt.spelllang = new
vim.notify("Spell lang: " .. new)
end, { desc = "Spell: switch language (en/de)" })
+80
View File
@@ -0,0 +1,80 @@
-- Per-server overrides
vim.lsp.config("sourcekit", {
filetypes = { "swift", "objective-c", "objective-c++" },
})
vim.lsp.config("svelte", {
settings = {
svelte = {
plugin = {
svelte = {
format = {
config = { tabWidth = 4, useTabs = false },
},
},
},
},
},
})
vim.lsp.config("tinymist", {
cmd = { "tinymist" },
filetypes = { "typst" },
settings = { formatterMode = "typstyle" },
})
vim.lsp.enable({
"lua_ls", "ts_ls", "svelte", "tailwindcss", "cssls", "bashls",
"rust_analyzer", "wgsl-analyzer", "clangd", "taplo", "sourcekit",
"tinymist", "jsonls", "hls", "pylsp", "vala_ls",
})
-- JDTLS (managed manually because it needs per-project workspace)
vim.api.nvim_create_autocmd("FileType", {
pattern = "java",
callback = function()
local jdtls = require("jdtls")
local data = vim.fn.stdpath("data")
local mason_jdtls = vim.fs.joinpath(data, "mason", "packages", "jdtls")
local workspace = vim.fs.joinpath(data, "jdtls-workspace",
vim.fn.fnamemodify(vim.fn.getcwd(), ":p:h:t"))
local sys = vim.uv.os_uname().sysname
local cfg_dir = sys == "Windows_NT" and "config_win"
or sys == "Linux" and "config_linux"
or "config_mac"
local launcher = vim.fn.glob(vim.fs.joinpath(
mason_jdtls, "plugins", "org.eclipse.equinox.launcher_*.jar"))
jdtls.start_or_attach({
cmd = {
"java",
"-Declipse.application=org.eclipse.jdt.ls.core.id1",
"-Dosgi.bundles.defaultStartLevel=4",
"-Declipse.product=org.eclipse.jdt.ls.core.product",
"-Dlog.protocol=true",
"-Dlog.level=ALL",
"-Xmx1g",
"--add-modules=ALL-SYSTEM",
"--add-opens", "java.base/java.util=ALL-UNNAMED",
"--add-opens", "java.base/java.lang=ALL-UNNAMED",
"-jar", launcher,
"-configuration", vim.fs.joinpath(mason_jdtls, cfg_dir),
"-data", workspace,
},
root_dir = vim.fs.root(0, { ".git", "mvnw", "gradlew" }),
settings = { java = {} },
init_options = {
bundles = {
vim.fn.glob(vim.fs.joinpath(data, "mason", "share",
"java-debug-adapter", "com.microsoft.java.debug.plugin.jar")),
},
},
})
-- Register Java debug configs (the rest of DAP lives in
-- lua/debugging.lua; Java must set up here, inside the jdtls attach).
require("jdtls").setup_dap({ hotcodereplace = "auto" })
require("jdtls.dap").setup_dap_main_class_configs()
end,
})
+34
View File
@@ -0,0 +1,34 @@
vim.g.mapleader = " "
local o = vim.o
o.number = true
o.relativenumber = true
o.tabstop = 4
o.shiftwidth = 4
o.expandtab = true
o.signcolumn = "yes"
o.swapfile = false
o.winborder = "single"
o.termguicolors = true
o.autoread = true
vim.api.nvim_create_autocmd({ "FocusGained", "BufEnter", "CursorHold", "CursorHoldI" }, {
command = "if mode() != 'c' | checktime | endif",
})
vim.filetype.add({ extension = { asm = "asm", s = "asm", S = "asm" } })
vim.api.nvim_create_autocmd("FileType", {
pattern = "asm",
callback = function()
vim.bo.tabstop = 8
vim.bo.shiftwidth = 8
vim.bo.softtabstop = 8
vim.bo.expandtab = false
end,
})
vim.diagnostic.config({
virtual_text = false,
virtual_lines = { current_line = true },
severity_sort = true,
})
+274
View File
@@ -0,0 +1,274 @@
vim.pack.add({
{ src = "https://github.com/ellisonleao/gruvbox.nvim" },
{ src = "https://github.com/stevearc/oil.nvim" },
{ src = "https://github.com/echasnovski/mini.pick" },
{ src = "https://github.com/echasnovski/mini.extra" },
{ src = "https://github.com/echasnovski/mini.icons" },
{ src = "https://github.com/echasnovski/mini.jump" },
{ src = "https://github.com/echasnovski/mini.jump2d" },
{ src = "https://github.com/neovim/nvim-lspconfig" },
{ 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/Saghen/blink.cmp" },
{ src = "https://github.com/saghen/blink.lib" },
{ src = "https://github.com/mason-org/mason.nvim" },
{ src = "https://github.com/nvim-lualine/lualine.nvim.git" },
{ src = "https://github.com/chomosuke/typst-preview.nvim" },
{ src = "https://codeberg.org/mfussenegger/nvim-jdtls.git" },
{ src = "https://github.com/windwp/nvim-autopairs" },
{ src = "https://codeberg.org/mfussenegger/nvim-dap.git" },
{ src = "https://github.com/echasnovski/mini.ai" },
{ src = "https://github.com/windwp/nvim-ts-autotag" },
{ src = "https://github.com/nvim-lua/plenary.nvim" },
{ src = "https://github.com/folke/todo-comments.nvim" },
{ src = "https://github.com/stevearc/conform.nvim" },
{ src = "https://github.com/lewis6991/gitsigns.nvim" },
{ src = "https://github.com/MeanderingProgrammer/render-markdown.nvim" },
{ src = "https://github.com/folke/trouble.nvim" },
{ src = "https://github.com/nvim-neotest/nvim-nio" },
{ src = "https://github.com/rcarriga/nvim-dap-ui" },
{ src = "https://github.com/theHamsta/nvim-dap-virtual-text" },
{ src = "https://github.com/jay-babu/mason-nvim-dap.nvim" },
{ src = "https://github.com/michaelrommel/nvim-silicon" },
{ src = "https://github.com/hat0uma/csvview.nvim.git" },
{ src = "https://github.com/Thiago4532/mdmath.nvim" },
{ src = "https://github.com/folke/snacks.nvim" },
})
pcall(vim.cmd.colorscheme, "gruvbox")
-- Simple setup({}) plugins
for _, name in ipairs({
"oil", "mini.pick", "mini.extra", "mini.icons", "mason", "typst-preview",
"nvim-autopairs", "gitsigns", "mini.jump",
"mini.ai", "nvim-ts-autotag", "todo-comments", "csvview",
}) do
pcall(function() require(name).setup() end)
end
-- Open the Trouble window even when there are no results (e.g. no
-- diagnostics) instead of erroring out with "No results".
require("trouble").setup({ open_no_results = true })
require("mini.icons").mock_nvim_web_devicons()
-- Labeled jump-anywhere motion (flash replacement); trigger with <leader>j.
require("mini.jump2d").setup({
mappings = { start_jumping = "<leader>j" },
})
local cmp = require('blink.cmp')
cmp.setup({
keymap = {
preset = "super-tab" }
})
local prettier = { "prettierd", "prettier", stop_after_first = true }
require("conform").setup({
formatters_by_ft = {
python = { "black" },
c = { "clang-format" },
cpp = { "clang-format" },
java = { "clang-format" },
javascript = prettier,
typescript = prettier,
css = prettier,
html = prettier,
json = prettier,
markdown = prettier,
yaml = prettier,
haskell = { "fourmolu" },
},
formatters = {
prettier = { prepend_args = { "--tab-width", "4", "--use-tabs", "false" } },
prettierd = { env = { PRETTIERD_DEFAULT_CONFIG = vim.fn.expand("~/.config/nvim/.prettierrc.json") } },
}
})
require("render-markdown").setup({
latex = { enabled = false }, -- mdmath.nvim renders math as images
code = { inline_pad = 0, highlight_inline = "RenderMarkdownCode" },
})
require("mdmath").setup({
dynamic_scale = 0.5,
})
require("snacks").setup({
image = {
enabled = true,
doc = { inline = false },
},
terminal = {},
})
-- Toggle a bottom terminal panel (reuses the same shell instance).
vim.keymap.set({ "n", "t" }, "<leader>t",
function()
Snacks.terminal(nil, {
win = { position = "bottom", height = 10 },
})
end,
{ desc = "Toggle terminal" })
-- Rebuild mdmath JS deps on plugin update
vim.api.nvim_create_autocmd("PackChanged", {
callback = function(ev)
if ev.data.spec.name == "mdmath.nvim" and ev.data.kind == "update" then
vim.system({ "npm", "install" }, { cwd = ev.data.path .. "/mdmath-js" })
end
end,
})
vim.api.nvim_create_autocmd("FileType", {
pattern = "markdown",
callback = function(ev)
local win = vim.api.nvim_get_current_win()
if vim.api.nvim_win_get_config(win).relative == "" then return end
local buf = ev.buf
local lines = vim.api.nvim_buf_get_lines(buf, 0, -1, false)
local changed = false
for i, line in ipairs(lines) do
local new = line:gsub("`(\\[^`]-)`", "$%1$")
if new ~= line then
lines[i] = new
changed = true
end
end
if changed then
vim.bo[buf].modifiable = true
vim.api.nvim_buf_set_lines(buf, 0, -1, false, lines)
vim.bo[buf].modifiable = false
end
end,
})
local silicon_bg = {
typescript = "#1e3a5f",
javascript = "#5c4a1a",
java = "#5c2a1a",
svelte = "#5c1f0a",
css = "#1f3a5c",
python = "#1a3556",
haskell = "#3d1f5c",
c = "#2a3a4d",
cpp = "#2a4d3d",
swift = "#5c3a1a",
lua = "#1f1f5c",
markdown = "#3a2e1f",
tex = "#3a2e1f",
typst = "#3a2e1f",
toml = "#2e2e2e",
yaml = "#2e2e2e",
conf = "#2e2e2e",
ini = "#2e2e2e",
json = "#2e2e2e",
}
require("nvim-silicon").setup({
font = "JetBrainsMono Nerd Font=16",
theme = "gruvbox-dark",
pad_horiz = 60,
pad_vert = 50,
shadow_color = "#0a0a0a",
shadow_blur_radius = 10,
no_round_corner = true,
output = function()
return vim.fn.expand("~/Desktop/silicon_")
.. os.date("!%Y%m%dT%H%M%SZ") .. ".png"
end,
window_title = function()
return vim.fn.fnamemodify(vim.api.nvim_buf_get_name(0), ":t")
end,
})
-- silicon's --tab-width replaces each tab with a fixed number of spaces
-- instead of advancing to the next tab stop, so tab-indented files (e.g.
-- assembly) come out misaligned. Expand tabs ourselves before shooting.
local s = require("nvim-silicon")
local function expand_tabs(line, ts)
local out, col = {}, 0
for i = 1, #line do
local ch = line:sub(i, i)
if ch == "\t" then
local n = ts - (col % ts)
out[#out + 1] = string.rep(" ", n)
col = col + n
else
out[#out + 1] = ch
col = col + 1
end
end
return table.concat(out)
end
local orig_format_lines = s.format_lines
s.format_lines = function(cmdline, args, options)
local lines, cl = orig_format_lines(cmdline, args, options)
local ts = vim.bo.tabstop
for i, line in ipairs(lines) do
lines[i] = expand_tabs(line, ts)
end
return lines, cl
end
local function silicon_shot(to_clipboard)
s.options.background = silicon_bg[vim.bo.filetype] or "#1d2021"
if to_clipboard then s.clip() else s.file() end
end
vim.keymap.set("x", "<leader>cc", function() silicon_shot(true) end,
{ desc = "Silicon: copy code screenshot to clipboard" })
vim.keymap.set("x", "<leader>cs", function() silicon_shot(false) end,
{ desc = "Silicon: save code screenshot to file" })
require("lualine").setup({ options = { theme = "gruvbox_dark" } })
-- Treesitter (main branch: no configs.setup; install parsers manually)
require("nvim-treesitter").install({
"lua", "vim", "vimdoc", "bash", "c", "cpp", "rust", "python",
"javascript", "typescript", "tsx", "svelte", "css", "html",
"json", "toml", "yaml", "markdown", "markdown_inline",
"java", "typst", "vala",
})
vim.api.nvim_create_autocmd("FileType", {
callback = function()
local lang = vim.treesitter.language.get_lang(vim.bo.filetype)
if lang and not pcall(vim.treesitter.language.inspect, lang) then
local ok, list = pcall(require("nvim-treesitter").language_list)
if ok and vim.list_contains(list, lang) then
require("nvim-treesitter").install(lang)
end
end
pcall(vim.treesitter.start)
end,
})
-- TS textobjects
local tso = require("nvim-treesitter-textobjects.select")
local textobj = {
af = "@function.outer",
["if"] = "@function.inner",
ac = "@class.outer",
ic = "@class.inner",
al = "@loop.outer",
il = "@loop.inner"
}
for lhs, query in pairs(textobj) do
vim.keymap.set({ "x", "o" }, lhs,
function() tso.select_textobject(query, "textobjects") end,
{ desc = "Textobject: " .. query:gsub("@", "") })
end
-- Mason: ensure tools
local registry = require("mason-registry")
local ensure = {
"bash-language-server", "clang-format", "clangd", "java-debug-adapter",
"jdtls", "json-lsp", "lua-language-server", "rust-analyzer",
"svelte-language-server", "tailwindcss-language-server", "taplo",
"typescript-language-server", "pylsp", "black", "vala",
"prettierd",
}
registry.refresh(function()
for _, tool in ipairs(ensure) do
local ok, pkg = pcall(registry.get_package, tool)
if ok and not pkg:is_installed() then pkg:install() end
end
end)
-9
View File
@@ -1,9 +0,0 @@
return {
"windwp/nvim-autopairs",
event = "InsertEnter",
config = function()
require("nvim-autopairs").setup({
check_ts = true, -- enables Treesitter integration
})
end,
}
-55
View File
@@ -1,55 +0,0 @@
return {
"saghen/blink.cmp",
-- optional: provides snippets for the snippet source
dependencies = { "L3MON4D3/LuaSnip" },
-- use a release tag to download pre-built binaries
version = "1.*",
-- AND/OR build from source, requires nightly: https://rust-lang.github.io/rustup/concepts/channels.html#working-with-nightly-rust
-- build = 'cargo build --release',
-- If you use nix, you can build from source using latest nightly rust with:
-- build = 'nix run .#build-plugin',
---@module 'blink.cmp'
---@type blink.cmp.Config
opts = {
-- 'default' (recommended) for mappings similar to built-in completions (C-y to accept)
-- 'super-tab' for mappings similar to vscode (tab to accept)
-- 'enter' for enter to accept
-- 'none' for no mappings
--
-- All presets have the following mappings:
-- C-space: Open menu or open docs if already open
-- C-n/C-p or Up/Down: Select next/previous item
-- C-e: Hide menu
-- C-k: Toggle signature help (if signature.enabled = true)
--
-- See :h blink-cmp-config-keymap for defining your own keymap
keymap = { preset = "super-tab" },
appearance = {
-- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font'
-- Adjusts spacing to ensure icons are aligned
nerd_font_variant = "mono",
},
-- (Default) Only show the documentation popup when manually triggered
completion = { documentation = { auto_show = false } },
snippets = { preset = "luasnip" },
-- Default list of enabled providers defined so that you can extend it
-- elsewhere in your config, without redefining it, due to `opts_extend`
sources = {
default = { "lsp", "path", "snippets", "buffer" },
},
-- (Default) Rust fuzzy matcher for typo resistance and significantly better performance
-- You may use a lua implementation instead by using `implementation = "lua"` or fallback to the lua implementation,
-- when the Rust fuzzy matcher is not available, by using `implementation = "prefer_rust"`
--
-- See the fuzzy documentation for more information
fuzzy = { implementation = "prefer_rust_with_warning" },
},
opts_extend = { "sources.default" },
}
-52
View File
@@ -1,52 +0,0 @@
return {
"ellisonleao/gruvbox.nvim",
name = "gruvbox",
lazy = false,
priority = 1000,
config = function()
-- Default options:
require("gruvbox").setup({
terminal_colors = true, -- add neovim terminal colors
undercurl = true,
underline = true,
bold = true,
italic = {
strings = true,
emphasis = true,
comments = true,
operators = false,
folds = true,
},
strikethrough = true,
invert_selection = false,
invert_signs = false,
invert_tabline = false,
invert_intend_guides = false,
inverse = true, -- invert background for search, diffs, statuslines and errors
contrast = "", -- can be "hard", "soft" or empty string
palette_overrides = {},
overrides = {},
dim_inactive = false,
transparent_mode = false,
})
vim.cmd("colorscheme gruvbox")
local filepath = os.getenv("HOME") .. "/.config/kitty/current-theme.conf"
local file = io.open(filepath, "r")
if not file then
vim.notify("Could not open kitty theme file: " .. filepath, vim.log.levels.ERROR)
return
end
local first_line = file:read("*l")
file:close()
if first_line and first_line:lower():find("light") then
vim.o.background = "light"
else
vim.o.background = "dark"
end
end
}
-8
View File
@@ -1,8 +0,0 @@
return {
"numToStr/Comment.nvim",
opts = {},
lazy = false,
config = function()
require("Comment").setup()
end,
}
-58
View File
@@ -1,58 +0,0 @@
return {
{
"williamboman/mason.nvim",
config = function()
require("mason").setup()
end,
},
{
"williamboman/mason-lspconfig.nvim",
opts = {
ensure_installed = {
"lua_ls",
"ts_ls",
"svelte",
"tailwindcss",
"cssls",
"tinymist",
},
},
},
{
"neovim/nvim-lspconfig",
dependencies = {
"williamboman/mason-lspconfig.nvim",
},
config = function()
local capabilities = require("blink.cmp").get_lsp_capabilities(vim.lsp.protocol.make_client_capabilities())
local lspconfig = require("lspconfig")
local mason_lspconfig = require("mason-lspconfig")
local mason_servers = mason_lspconfig.get_installed_servers()
local manual_servers = {
"sourcekit",
}
for _, server in ipairs(vim.tbl_extend("force", mason_servers, manual_servers)) do
lspconfig[server].setup({
capabilities = capabilities,
})
end
local map = vim.keymap.set
map("n", "gd", vim.lsp.buf.definition, {})
map("n", "K", vim.lsp.buf.hover, {})
map({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, {})
vim.diagnostic.config({
virtual_text = true,
signs = true,
update_in_insert = true,
underline = true,
severity_sort = false,
float = true,
})
end,
},
}
-11
View File
@@ -1,11 +0,0 @@
return {
"nvim-lualine/lualine.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
config = function()
require("lualine").setup({
options = {
theme = "dracula",
},
})
end,
}
-22
View File
@@ -1,22 +0,0 @@
return {
"karb94/neoscroll.nvim",
config = function()
local neoscroll = require("neoscroll")
neoscroll.setup({
mappings = { "<C-u>", "<C-d>", "zz" },
hide_cursor = false, -- Hide cursor while scrolling
stop_eof = true, -- Stop at <EOF> when scrolling downwards
respect_scrolloff = false, -- Stop scrolling when the cursor reaches the scrolloff margin of the file
cursor_scrolls_alone = true, -- The cursor will keep on scrolling even if the window cannot scroll further
duration_multiplier = 0.25, -- Global duration multiplier
easing = "cubic", -- Default easing function
pre_hook = nil, -- Function to run before the scrolling animation starts
post_hook = nil, -- Function to run after the scrolling animation ends
performance_mode = false, -- Disable "Performance Mode" on all buffers.
ignored_events = { -- Events ignored while scrolling
"WinScrolled",
"CursorMoved",
},
})
end,
}
-14
View File
@@ -1,14 +0,0 @@
return {
{
"nvim-neo-tree/neo-tree.nvim",
branch = "v3.x",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons",
"MunifTanjim/nui.nvim",
},
config = function()
vim.keymap.set("n", "<C-t>", ":Neotree toggle<CR>")
end,
},
}
-35
View File
@@ -1,35 +0,0 @@
return {
"nvimtools/none-ls.nvim",
dependencies = {
"nvimtools/none-ls-extras.nvim",
},
config = function()
local null_ls = require("null-ls")
local formatting = null_ls.builtins.formatting
local prettypst = {
name = "prettypst",
method = require("null-ls").methods.FORMATTING,
filetypes = { "typst" },
generator = require("null-ls.helpers").formatter_factory({
command = vim.fn.stdpath("data") .. "/mason/bin/prettypst",
args = { "-" },
to_stdin = true,
}),
}
null_ls.setup({
sources = {
formatting.stylua,
formatting.black,
formatting.isort,
formatting.prettier.with({
extra_filetypes = { "svelte" },
}),
prettypst,
},
})
vim.keymap.set("n", "<leader>gf", vim.lsp.buf.format, {})
end,
}
-47
View File
@@ -1,47 +0,0 @@
return {
"nvim-lualine/lualine.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
config = function()
require("lualine").setup({
options = {
icons_enabled = true,
theme = "auto",
component_separators = { left = "", right = "" },
section_separators = { left = "", right = "" },
disabled_filetypes = {
statusline = {},
winbar = {},
},
ignore_focus = {},
always_divide_middle = true,
always_show_tabline = true,
globalstatus = false,
refresh = {
statusline = 100,
tabline = 100,
winbar = 100,
},
},
sections = {
lualine_a = { "mode" },
lualine_b = { "branch", "diff", "diagnostics" },
lualine_c = { "filename" },
lualine_x = { "encoding", "fileformat", "filetype" },
lualine_y = { "progress" },
lualine_z = { "location" },
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = { "filename" },
lualine_x = { "location" },
lualine_y = {},
lualine_z = {},
},
tabline = {},
winbar = {},
inactive_winbar = {},
extensions = {},
})
end,
}
-27
View File
@@ -1,27 +0,0 @@
return {
{
"nvim-telescope/telescope.nvim",
tag = "0.1.6",
dependencies = {
"nvim-lua/plenary.nvim",
},
config = function()
local builtin = require("telescope.builtin")
vim.keymap.set("n", "<C-f>", builtin.find_files, {})
vim.keymap.set("n", "<C-g>", builtin.live_grep, {})
end,
},
{
"nvim-telescope/telescope-ui-select.nvim",
config = function()
require("telescope").setup({
extensions = {
["ui-select"] = {
require("telescope.themes").get_dropdown({}),
},
},
})
require("telescope").load_extension("ui-select")
end,
},
}
-92
View File
@@ -1,92 +0,0 @@
return {
{
"nvim-treesitter/nvim-treesitter-textobjects",
dependencies = { "nvim-treesitter/nvim-treesitter" },
},
{
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
config = function()
local configs = require("nvim-treesitter.configs")
configs.setup({
ensure_installed = { "lua", "javascript", "html", "css", "svelte", "rust", "typescript", "python" },
auto_install = { enable = true },
highlight = { enable = true },
indent = { enable = true },
textobjects = {
select = {
enable = true,
-- Automatically jump forward to textobj, similar to targets.vim
lookahead = true,
keymaps = {
-- You can use the capture groups defined in textobjects.scm
["af"] = "@function.outer",
["if"] = "@function.inner",
["ai"] = "@conditional.outer",
["ii"] = "@conditional.inner",
},
-- You can choose the select mode (default is charwise 'v')
--
-- Can also be a function which gets passed a table with the keys
-- * query_string: eg '@function.inner'
-- * method: eg 'v' or 'o'
-- and should return the mode ('v', 'V', or '<c-v>') or a table
-- mapping query_strings to modes.
selection_modes = {},
-- If you set this to `true` (default is `false`) then any textobject is
-- extended to include preceding or succeeding whitespace. Succeeding
-- whitespace has priority in order to act similarly to eg the built-in
-- `ap`.
--
-- Can also be a function which gets passed a table with the keys
-- * query_string: eg '@function.inner'
-- * selection_mode: eg 'v'
-- and should return true or false
include_surrounding_whitespace = true,
},
move = {
enable = true,
set_jumps = true, -- whether to set jumps in the jumplist
goto_next_start = {
["]m"] = "@function.outer",
["]]"] = { query = "@class.outer", desc = "Next class start" },
--
-- You can use regex matching (i.e. lua pattern) and/or pass a list in a "query" key to group multiple queries.
["]o"] = "@loop.*",
-- ["]o"] = { query = { "@loop.inner", "@loop.outer" } }
--
-- You can pass a query group to use query from `queries/<lang>/<query_group>.scm file in your runtime path.
-- Below example nvim-treesitter's `locals.scm` and `folds.scm`. They also provide highlights.scm and indent.scm.
["]s"] = { query = "@local.scope", query_group = "locals", desc = "Next scope" },
["]z"] = { query = "@fold", query_group = "folds", desc = "Next fold" },
},
goto_next_end = {
["]M"] = "@function.outer",
["]["] = "@class.outer",
},
goto_previous_start = {
["[m"] = "@function.outer",
["[["] = "@class.outer",
},
goto_previous_end = {
["[M"] = "@function.outer",
["[]"] = "@class.outer",
},
-- Below will go to either the start or the end, whichever is closer.
-- Use if you want more granular movements
-- Make it even more gradual by adding multiple queries and regex.
goto_next = {
["]d"] = "@conditional.outer",
},
goto_previous = {
["[d"] = "@conditional.outer",
},
},
},
})
end,
},
}
-25
View File
@@ -1,25 +0,0 @@
return {
{
"folke/trouble.nvim",
opts = {}, -- use defaults, or configure as needed
config = function()
local trouble = require("trouble")
vim.keymap.set("n", "<leader>xx", function()
trouble.toggle("diagnostics")
end, { desc = "Trouble: Diagnostics (Toggle)" })
-- vim.keymap.set("n", "<leader>xw", function()
-- trouble.toggle("workspace_diagnostics")
-- end, { desc = "Trouble: Workspace Diagnostics" })
-- vim.keymap.set("n", "<leader>xd", function()
-- trouble.toggle("document_diagnostics")
-- end, { desc = "Trouble: Document Diagnostics" })
-- vim.keymap.set("n", "<leader>xq", function()
-- trouble.toggle("quickfix")
-- end, { desc = "Trouble: Quickfix" })
-- vim.keymap.set("n", "<leader>xl", function()
-- trouble.toggle("loclist")
-- end, { desc = "Trouble: Location List" })
end,
},
}
-6
View File
@@ -1,6 +0,0 @@
return {
"chomosuke/typst-preview.nvim",
lazy = false, -- or ft = 'typst'
version = "1.*",
opts = {}, -- lazy.nvim will implicitly calls `setup {}`
}
-67
View File
@@ -1,67 +0,0 @@
vim.cmd("set tabstop=4")
vim.cmd("set shiftwidth=4")
vim.wo.relativenumber = true
vim.opt.number = true
vim.g.mapleader = " "
-- Enable line wrapping
vim.opt.wrap = true
vim.opt.linebreak = true
vim.opt.showbreak = ""
-- Make 'j' and 'k' navigate visual lines (not logical lines)
vim.keymap.set("n", "j", "gj", { noremap = true, silent = true })
vim.keymap.set("n", "k", "gk", { noremap = true, silent = true })
vim.keymap.set("v", "j", "gj", { noremap = true, silent = true })
vim.keymap.set("v", "k", "gk", { noremap = true, silent = true })
-- -- Spellchecker
-- vim.api.nvim_create_autocmd("FileType", {
-- callback = function()
-- local buftype = vim.api.nvim_buf_get_option(0, "buftype")
-- local filetype = vim.api.nvim_buf_get_option(0, "filetype")
--
-- local skip_buftypes = { "nofile", "prompt", "terminal" }
-- local skip_filetypes = { "cmp_menu", "cmp_doc", "TelescopePrompt", "NvimTree" }
--
-- -- If current buffer is in skip list, do nothing
-- for _, bt in ipairs(skip_buftypes) do
-- if buftype == bt then
-- return
-- end
-- end
-- for _, ft in ipairs(skip_filetypes) do
-- if filetype == ft then
-- return
-- end
-- end
--
-- -- Else, enable spellcheck
-- vim.opt_local.spell = true
-- vim.opt_local.spelllang = "en"
-- end,
-- })
-- Toggle spell check with <leader>sc
vim.keymap.set("n", "<leader>sc", function()
vim.wo.spell = not vim.wo.spell
print("Spell checking: " .. (vim.wo.spell and "ON" or "OFF"))
end, { desc = "Toggle spell checking" })
-- Switch between English and German with <leader>sl
vim.keymap.set("n", "<leader>sl", function()
local current = vim.opt.spelllang:get()[1] or ""
local new_lang = current == "en" and "de" or "en"
vim.opt.spelllang = new_lang
print("Spell language: " .. new_lang)
end, { desc = "Switch spell language" })
-- Clear search highlights when entering insert mode.
vim.api.nvim_create_autocmd("InsertEnter", {
callback = function()
-- Delay the nohlsearch slightly to ensure it takes effect
vim.defer_fn(function()
vim.cmd("nohlsearch")
end, 10)
end,
})