initial commit

This commit is contained in:
Robin Jenni
2026-03-10 18:39:47 +01:00
commit fae6e1fb6f
30 changed files with 832 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
return { "catppuccin/nvim", name = "catppuccin", priority = 1000, opts = { transparent_background = true } }
+46
View File
@@ -0,0 +1,46 @@
return {
'numToStr/Comment.nvim',
opts = {
---Add a space b/w comment and the line
padding = true,
---Whether the cursor should stay at its position
sticky = true,
---Lines to be ignored while (un)comment
ignore = nil,
---LHS of toggle mappings in NORMAL mode
toggler = {
---Line-comment toggle keymap
line = 'gcc',
---Block-comment toggle keymap
block = 'gbc',
},
---LHS of operator-pending mappings in NORMAL and VISUAL mode
opleader = {
---Line-comment keymap
line = 'gc',
---Block-comment keymap
block = 'gb',
},
---LHS of extra mappings
extra = {
---Add comment on the line above
above = 'gcO',
---Add comment on the line below
below = 'gco',
---Add comment at the end of line
eol = 'gcA',
},
---Enable keybindings
---NOTE: If given `false` then the plugin won't create any mappings
mappings = {
---Operator-pending mapping; `gcc` `gbc` `gc[count]{motion}` `gb[count]{motion}`
basic = true,
---Extra mapping; `gco`, `gcO`, `gcA`
extra = true,
},
---Function to call before (un)comment
pre_hook = nil,
---Function to call after (un)comment
post_hook = nil,
}
}
+4
View File
@@ -0,0 +1,4 @@
return {
'stevearc/dressing.nvim',
opts = {},
}
+42
View File
@@ -0,0 +1,42 @@
return {
"ThePrimeagen/harpoon",
branch = "harpoon2",
opts = {
menu = {
width = vim.api.nvim_win_get_width(0) - 4,
},
settings = {
save_on_toggle = true,
},
},
keys = function()
local keys = {
{
"<leader>h",
function()
require("harpoon"):list():add()
end,
desc = "Harpoon File",
},
{
"<leader>H",
function()
local harpoon = require("harpoon")
harpoon.ui:toggle_quick_menu(harpoon:list())
end,
desc = "Harpoon Quick Menu",
},
}
for i = 1, 5 do
table.insert(keys, {
"<leader>" .. i,
function()
require("harpoon"):list():select(i)
end,
desc = "Harpoon to File " .. i,
})
end
return keys
end,
}
+7
View File
@@ -0,0 +1,7 @@
return {
"lukas-reineke/indent-blankline.nvim",
main = "ibl",
---@module "ibl"
---@type ibl.config
opts = {},
}
+18
View File
@@ -0,0 +1,18 @@
return {
'nvimdev/lspsaga.nvim',
config = function()
require('lspsaga').setup({
lightbulb = {
enable = false
}
})
vim.keymap.set('n', 'K', '<cmd>Lspsaga hover_doc<CR>', {
silent = true,
desc = 'Saga hover docs',
})
end,
dependencies = {
'nvim-treesitter/nvim-treesitter',
'nvim-tree/nvim-web-devicons',
}
}
+202
View File
@@ -0,0 +1,202 @@
return { {
'williamboman/mason.nvim',
lazy = false,
opts = {}
}, -- Autocompletion
{
'hrsh7th/nvim-cmp',
event = 'InsertEnter',
config = function()
local cmp = require('cmp')
cmp.setup({
sources = { {
name = 'nvim_lsp'
} },
mapping = cmp.mapping.preset.insert({
['<C-Space>'] = cmp.mapping.complete(),
['<C-u>'] = cmp.mapping.scroll_docs(-4),
['<C-d>'] = cmp.mapping.scroll_docs(4),
-- Use enter to confirm completion
['<CR>'] = cmp.mapping.confirm({
select = false
}),
-- Navigate completions with <C-j> and <C-k>
["<C-j>"] = cmp.mapping.select_next_item({
behavior = cmp.SelectBehavior.Insert
}),
["<C-k>"] = cmp.mapping.select_prev_item({
behavior = cmp.SelectBehavior.Insert
}),
['<Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.confirm({ select = true })
elseif vim.snippet and vim.snippet.active() then
vim.snippet.jump(1)
else
fallback()
end
end, { 'i', 's' }),
}),
snippet = {
expand = function(args)
vim.snippet.expand(args.body)
end
}
})
end
}, -- LSP
{
'neovim/nvim-lspconfig',
cmd = { 'LspInfo', 'LspInstall', 'LspStart' },
event = { 'BufReadPre', 'BufNewFile' },
dependencies = { { 'hrsh7th/cmp-nvim-lsp' }, { 'williamboman/mason.nvim' }, { 'williamboman/mason-lspconfig.nvim' } },
init = function()
-- Reserve a space in the gutter
-- This will avoid an annoying layout shift in the screen
vim.opt.signcolumn = 'yes'
end,
config = function()
-- Add cmp_nvim_lsp capabilities settings to lspconfig
-- This should be executed before you configure any language server
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
-- Define the autoformat function locally
local buffer_autoformat = function(bufnr)
local group = 'lsp_autoformat'
vim.api.nvim_create_augroup(group, {
clear = false
})
vim.api.nvim_clear_autocmds({
group = group,
buffer = bufnr
})
vim.api.nvim_create_autocmd('BufWritePre', {
buffer = bufnr,
group = group,
desc = 'LSP format on save',
callback = function()
-- note: do not enable async formatting
vim.lsp.buf.format({
async = false,
timeout_ms = 10000
})
end
})
end
-- LspAttach is where you enable features that only work
-- if there is a language server active in the file
vim.api.nvim_create_autocmd('LspAttach', {
desc = 'LSP actions',
callback = function(event)
-- Autoformat on save
local id = vim.tbl_get(event, 'data', 'client_id')
local client = id and vim.lsp.get_client_by_id(id)
if client == nil then
return
end
if client.supports_method('textDocument/formatting') then
buffer_autoformat(event.buf)
end
-- vim.keymap.set('n', 'K', '<cmd>lua vim.lsp.buf.hover()<cr>',
-- { buffer = event.buf, desc = "Hover over selection" })
vim.keymap.set('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<cr>',
{ buffer = event.buf, desc = "Go to definition" })
-- Go to definition in split window: Split window, move to left and open definition
vim.keymap.set('n', 'gD', '<cmd>vsplit | wincmd L | lua vim.lsp.buf.declaration()<cr>',
{ noremap = true, silent = true, desc = "Go to definition in split window" })
vim.keymap.set('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<cr>',
{ buffer = event.buf, desc = "Go to implementation" })
vim.keymap.set('n', 'go', '<cmd>lua vim.lsp.buf.type_definition()<cr>',
{ buffer = event.buf, desc = "Go to type definition" })
vim.keymap.set('n', 'gr', '<cmd>lua vim.lsp.buf.references()<cr>',
{ buffer = event.buf, desc = "Show references" })
vim.keymap.set('n', 'gs', '<cmd>lua vim.lsp.buf.signature_help()<cr>',
{ buffer = event.buf, desc = "Show signature help" })
vim.keymap.set('n', 'gR', '<cmd>lua vim.lsp.buf.rename()<cr>',
{ buffer = event.buf, desc = "Rename" })
vim.keymap.set({ 'n', 'x' }, 'f', '<cmd>lua vim.lsp.buf.format({async = true})<cr>',
{ buffer = event.buf, desc = "Format selection" })
vim.keymap.set('n', '<F4>', '<cmd>lua vim.lsp.buf.code_action()<cr>',
{ buffer = event.buf, desc = "Code action" })
end
})
vim.lsp.config('eslint', {
capabilities = capabilities,
settings = {
eslint = {
enable = true,
packageManager = "yarn",
configFiles = ".eslint.config.mjs",
validate = "on"
}
}
})
require('mason').setup()
require('mason-lspconfig').setup({
ensure_installed = { "eslint", "clangd" },
handlers = { -- this first function is the "default handler"
-- it applies to every language server without a "custom handler"
function(server_name)
vim.lsp.config(server_name, {
capabilities = capabilities
})
vim.lsp.enable(server_name)
end,
lua_ls = function()
vim.lsp.config('lua_ls', {
capabilities = capabilities,
settings = {
Lua = {
diagnostics = {
globals = { 'vim' },
},
},
},
})
vim.lsp.enable('lua_ls')
end,
tinymist = function()
vim.lsp.config('tinymist', {
capabilities = capabilities,
settings = {
formatterMode = "typstyle",
exportPdf = "onSave",
},
})
vim.lsp.enable('tinymist')
end,
}
})
-- sourcekit is NOT managed by mason, set up separately
local lspconfig = require('lspconfig')
lspconfig["sourcekit"].setup({
capabilities = capabilities,
cmd = {
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/sourcekit-lsp",
},
root_dir = function(filename, _)
local util = require("lspconfig.util")
return util.root_pattern("buildServer.json")(filename)
or util.root_pattern("*.xcodeproj", "*.xcworkspace")(filename)
or util.find_git_ancestor(filename)
or util.root_pattern("Package.swift")(filename)
end,
})
end
} }
+49
View File
@@ -0,0 +1,49 @@
return {
'nvim-lualine/lualine.nvim',
dependencies = { 'nvim-tree/nvim-web-devicons' },
config = function()
local config = require("lualine")
config.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
}
+18
View File
@@ -0,0 +1,18 @@
return {
{
"williamboman/mason.nvim",
version = "1.11.0",
lazy = false,
opts = {}
},
{
"williamboman/mason-lspconfig.nvim",
version = "1.32.0"
},
{
"williamboman/mason-registry",
version = "1.4.0"
},
-- ... everything else stays as-is
}
+7
View File
@@ -0,0 +1,7 @@
return {
'windwp/nvim-autopairs',
event = "InsertEnter",
config = true
-- use opts = {} for passing setup options
-- this is equivalent to setup({}) function
}
+30
View File
@@ -0,0 +1,30 @@
return {
"nvim-tree/nvim-tree.lua",
version = "*",
lazy = false,
dependencies = { "nvim-tree/nvim-web-devicons" },
config = function()
-- disable netrw
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
-- Enable 24-bit color
vim.opt.termguicolors = true
require("nvim-tree").setup({
filters = {
dotfiles = false,
},
git = {
enable = true,
ignore = false,
timeout = 500
}
})
vim.keymap.set("n", "<leader>e", ":NvimTreeToggle<CR>", {
noremap = true,
silent = true,
desc = "Toggle File Explorer"
})
end
}
+14
View File
@@ -0,0 +1,14 @@
return {
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
config = function()
local configs = require("nvim-treesitter.configs")
configs.setup({
ensure_installed = { "lua", 'gdscript', 'godot_resource', 'gdshader', "vim", "javascript", "html", "rust", "typescript", "glsl", "wgsl" },
sync_install = false,
highlight = { enable = true },
indent = { enable = true },
})
end
}
+11
View File
@@ -0,0 +1,11 @@
return {
"olimorris/onedarkpro.nvim",
priority = 1000, -- Ensure it loads first
config = function()
require("onedarkpro").setup({
options = {
transparency = false
}
})
end
}
+11
View File
@@ -0,0 +1,11 @@
return {
"hedyhli/outline.nvim",
lazy = true,
cmd = { "Outline", "OutlineOpen" },
keys = { -- Example mapping to toggle outline
{ "<leader>o", "<cmd>Outline<CR>", desc = "Toggle outline" },
},
opts = {
-- Your setup opts here
},
}
+20
View File
@@ -0,0 +1,20 @@
return {
'nvim-telescope/telescope.nvim',
tag = '0.1.8',
dependencies = { 'nvim-lua/plenary.nvim' },
config = function()
local actions = require("telescope.actions")
require('telescope').setup({
defaults = {
mappings = {
i = {
["<C-j>"] = actions.move_selection_next,
["<C-k>"] = actions.move_selection_previous
}
}
},
pickers = {},
extensions = {}
})
end
}
+18
View File
@@ -0,0 +1,18 @@
return {
"christoomey/vim-tmux-navigator",
cmd = {
"TmuxNavigateLeft",
"TmuxNavigateDown",
"TmuxNavigateUp",
"TmuxNavigateRight",
"TmuxNavigatePrevious",
"TmuxNavigatorProcessList",
},
keys = {
{ "<c-h>", "<cmd><C-U>TmuxNavigateLeft<cr>" },
{ "<c-j>", "<cmd><C-U>TmuxNavigateDown<cr>" },
{ "<c-k>", "<cmd><C-U>TmuxNavigateUp<cr>" },
{ "<c-l>", "<cmd><C-U>TmuxNavigateRight<cr>" },
{ "<c-\\>", "<cmd><C-U>TmuxNavigatePrevious<cr>" },
},
}
+12
View File
@@ -0,0 +1,12 @@
return {
"folke/todo-comments.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
opts = {},
keys = {
{
"<leader>t",
"<cmd>Trouble todo toggle<cr>",
desc = "Todo List (Trouble)",
},
},
}
+37
View File
@@ -0,0 +1,37 @@
return {
"folke/trouble.nvim",
opts = {}, -- for default options, refer to the configuration section for custom setup.
cmd = "Trouble",
keys = {
{
"<leader>xx",
"<cmd>Trouble diagnostics toggle<cr>",
desc = "Diagnostics (Trouble)",
},
{
"<leader>xX",
"<cmd>Trouble diagnostics toggle filter.buf=0<cr>",
desc = "Buffer Diagnostics (Trouble)",
},
{
"<leader>cs",
"<cmd>Trouble symbols toggle focus=false<cr>",
desc = "Symbols (Trouble)",
},
{
"<leader>cl",
"<cmd>Trouble lsp toggle focus=false win.position=right<cr>",
desc = "LSP Definitions / references / ... (Trouble)",
},
{
"<leader>xL",
"<cmd>Trouble loclist toggle<cr>",
desc = "Location List (Trouble)",
},
{
"<leader>xQ",
"<cmd>Trouble qflist toggle<cr>",
desc = "Quickfix List (Trouble)",
},
},
}
+63
View File
@@ -0,0 +1,63 @@
return {
"RRethy/vim-illuminate",
event = "BufReadPost",
config = function()
-- default configuration
require('illuminate').configure({
-- providers: provider used to get references in the buffer, ordered by priority
providers = {
'lsp',
'treesitter',
'regex',
},
-- delay: delay in milliseconds
delay = 100,
-- filetype_overrides: filetype specific overrides.
-- The keys are strings to represent the filetype while the values are tables that
-- supports the same keys passed to .configure except for filetypes_denylist and filetypes_allowlist
filetype_overrides = {},
-- filetypes_denylist: filetypes to not illuminate, this overrides filetypes_allowlist
filetypes_denylist = {
'dirbuf',
'dirvish',
'fugitive',
},
-- filetypes_allowlist: filetypes to illuminate, this is overridden by filetypes_denylist
-- You must set filetypes_denylist = {} to override the defaults to allow filetypes_allowlist to take effect
filetypes_allowlist = {},
-- modes_denylist: modes to not illuminate, this overrides modes_allowlist
-- See `:help mode()` for possible values
modes_denylist = {},
-- modes_allowlist: modes to illuminate, this is overridden by modes_denylist
-- See `:help mode()` for possible values
modes_allowlist = {},
-- providers_regex_syntax_denylist: syntax to not illuminate, this overrides providers_regex_syntax_allowlist
-- Only applies to the 'regex' provider
-- Use :echom synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name')
providers_regex_syntax_denylist = {},
-- providers_regex_syntax_allowlist: syntax to illuminate, this is overridden by providers_regex_syntax_denylist
-- Only applies to the 'regex' provider
-- Use :echom synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name')
providers_regex_syntax_allowlist = {},
-- under_cursor: whether or not to illuminate under the cursor
under_cursor = true,
-- large_file_cutoff: number of lines at which to use large_file_config
-- The `under_cursor` option is disabled when this cutoff is hit
large_file_cutoff = 10000,
-- large_file_config: config to use for large files (based on large_file_cutoff).
-- Supports the same keys passed to .configure
-- If nil, vim-illuminate will be disabled for large files.
large_file_overrides = nil,
-- min_count_to_highlight: minimum number of matches required to perform highlighting
min_count_to_highlight = 1,
-- should_enable: a callback that overrides all other settings to
-- enable/disable illumination. This will be called a lot so don't do
-- anything expensive in it.
should_enable = function(bufnr) return true end,
-- case_insensitive_regex: sets regex case sensitivity
case_insensitive_regex = false,
-- disable_keymaps: disable default keymaps
disable_keymaps = false,
})
end,
}
+6
View File
@@ -0,0 +1,6 @@
return {
"szw/vim-maximizer",
keys = {
{ "<C-w>m", "<cmd>MaximizerToggle<CR>", desc = "Maximize/minimize a split" },
},
}
+9
View File
@@ -0,0 +1,9 @@
{
"lervag/vimtex",
lazy = false, -- we don't want to lazy load VimTeX
-- tag = "v2.15", -- uncomment to pin to a specific release
init = function()
-- VimTeX configuration goes here, e.g.
vim.g.vimtex_view_method = "zathura"
end
}
+21
View File
@@ -0,0 +1,21 @@
return {
"folke/which-key.nvim",
event = "VeryLazy",
opts = {
spec = {
{ "<leader>x", group = "Trouble" },
{ "<leader>f", group = "Telescope" }
}
},
keys = {
{
"<leader>?",
function()
require("which-key").show({ global = false })
end,
desc = "Buffer Local Keymaps (which-key)",
},
{ "<leader>f", group = "+Telescope" },
{ "<leader>x", group = "+Trouble" }
},
}