Public Access
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7fcf86b27f
|
||
|
|
9036e94a51
|
||
|
|
e63b46fc68
|
||
|
|
ad70ada381
|
||
|
|
ef615fa7d3
|
||
|
|
c924bd3e4a
|
||
|
|
5c19da6658
|
||
|
|
1d741f11e7 | ||
|
|
b0cb2d35e8 | ||
|
|
3eb12e968b | ||
|
|
3d18acab7e | ||
|
|
0e17a48de3 | ||
|
|
21eda9b349 | ||
|
|
8fc32a88b4 | ||
|
|
fa679e6360 | ||
|
|
86dea72e93 | ||
|
|
5a1619cf4d | ||
|
|
6d17ee4abb | ||
|
|
9d9d954d77 | ||
|
|
ad10607c1f | ||
|
|
83b3f2ef19 | ||
|
|
d1c97a82fb | ||
|
|
3051e987b4 | ||
|
|
42613fd64e | ||
|
|
7572e669f2 | ||
|
|
58f93a943c | ||
|
|
3b14da94a9 | ||
|
|
3371860987 | ||
|
|
7c0f452607 | ||
|
|
8b199cd837 | ||
|
|
5be7301e24 | ||
|
|
a6e6a693b3 | ||
|
|
3262b28e57 | ||
|
|
f3a48ef353 | ||
|
|
82949130a9 | ||
|
|
1fb78370d0 | ||
|
|
c1b3609ef1 | ||
|
|
fc40bc496d | ||
|
|
68f8e18d2a | ||
|
|
78ba99002b | ||
|
|
97ee841c34 | ||
|
|
da0e476ae8 | ||
|
|
f018ac96af | ||
|
|
9d9108f2c2 | ||
|
|
527d184422 |
@@ -1 +0,0 @@
|
||||
nvim-pack-lock.json
|
||||
+3
-1
@@ -1,5 +1,7 @@
|
||||
{
|
||||
"diagnostics.globals": [
|
||||
"vim"
|
||||
"vim",
|
||||
"testMe",
|
||||
"result"
|
||||
]
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"tabWidth": 4,
|
||||
"useTabs": false
|
||||
}
|
||||
@@ -1,5 +1,15 @@
|
||||
require("options")
|
||||
require("plugins")
|
||||
require("lsp")
|
||||
require("keymaps")
|
||||
require("debugging")
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
vim.fn.system({
|
||||
"git",
|
||||
"clone",
|
||||
"--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")
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"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" }
|
||||
}
|
||||
@@ -1,136 +0,0 @@
|
||||
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" })
|
||||
@@ -1,54 +0,0 @@
|
||||
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
@@ -1,80 +0,0 @@
|
||||
-- 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,
|
||||
})
|
||||
@@ -1,34 +0,0 @@
|
||||
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
@@ -1,274 +0,0 @@
|
||||
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)
|
||||
@@ -0,0 +1,9 @@
|
||||
return {
|
||||
"windwp/nvim-autopairs",
|
||||
event = "InsertEnter",
|
||||
config = function()
|
||||
require("nvim-autopairs").setup({
|
||||
check_ts = true, -- enables Treesitter integration
|
||||
})
|
||||
end,
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
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" },
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
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
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
return {
|
||||
"numToStr/Comment.nvim",
|
||||
opts = {},
|
||||
lazy = false,
|
||||
config = function()
|
||||
require("Comment").setup()
|
||||
end,
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
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,
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
return {
|
||||
"nvim-lualine/lualine.nvim",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
config = function()
|
||||
require("lualine").setup({
|
||||
options = {
|
||||
theme = "dracula",
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
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,
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
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,
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
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,
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
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,
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
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,
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
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,
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
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,
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
return {
|
||||
"chomosuke/typst-preview.nvim",
|
||||
lazy = false, -- or ft = 'typst'
|
||||
version = "1.*",
|
||||
opts = {}, -- lazy.nvim will implicitly calls `setup {}`
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
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,
|
||||
})
|
||||
Reference in New Issue
Block a user