initial commit

This commit is contained in:
2025-10-14 12:29:46 +02:00
parent 0439bb0ff7
commit 903704e4d7
99 changed files with 8495 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
local function setup()
local from_home = '/.cache/nvim-lsp/eclipse.jdt.ls/org.eclipse.jdt.ls.product/target/repository/bin/jdtls'
local home_dir = os.getenv('HOME')
local path = home_dir .. from_home
local config = {
cmd = { path },
root_dir = vim.fs.dirname(vim.fs.find({ '.gradlew', '.git', 'mvnw' }, { upward = true })[1]),
settings = {
java = {
configuration = {
runtimes = {
{
name = "JavaSE-1.8",
path = "/home/quirinecker/.sdkman/candidates/java/8.0.302-open"
},
{
name = "JavaSE-11",
path = "/home/quirinecker/.sdkman/candidates/java/11.0.2-open"
},
{
name = "JavaSE-17",
path = "/home/quirinecker/.sdkman/candidates/java/17-open"
},
{
name = "JavaSE-18",
path = "/home/quirinecker/.sdkman/candidates/java/18-open"
}
}
}
}
}
}
require('jdtls').start_or_attach(config)
vim.cmd [[
command! -buffer -nargs=? -complete=custom,v:lua.require'jdtls'._complete_compile JdtCompile lua require('jdtls').compile(<f-args>)
command! -buffer -nargs=? -complete=custom,v:lua.require'jdtls'._complete_set_runtime JdtSetRuntime lua require('jdtls').set_runtime(<f-args>)
command! -buffer JdtUpdateConfig lua require('jdtls').update_project_config()
command! -buffer JdtJol lua require('jdtls').jol()
command! -buffer JdtBytecode lua require('jdtls').javap()
command! -buffer JdtJshell lua require('jdtls').jshell()
]]
end

View File

@@ -0,0 +1 @@
vim.opt.wrap = true

View File

@@ -0,0 +1 @@
require('config')

View File

@@ -0,0 +1,45 @@
{
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
"LuaSnip": { "branch": "master", "commit": "33b06d72d220aa56a7ce80a0dd6f06c70cd82b9d" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" },
"cmp-emoji": { "branch": "main", "commit": "e8398e2adf512a03bb4e1728ca017ffeac670a9f" },
"cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
"friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" },
"gen.nvim": { "branch": "main", "commit": "b9721662daedd880ca0a0358cf6ffbff60617ab3" },
"lazy.nvim": { "branch": "main", "commit": "7c493713bc2cb392706866eeba53aaef6c8e9fc6" },
"lspkind.nvim": { "branch": "master", "commit": "d79a1c3299ad0ef94e255d045bed9fa26025dab6" },
"lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" },
"markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "8e46de9241d3997927af12196bd8faa0ed08c29a" },
"mason-nvim-dap.nvim": { "branch": "main", "commit": "8b9363d83b5d779813cdd2819b8308651cec2a09" },
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
"nightfox.nvim": { "branch": "main", "commit": "7557f26defd093c4e9bc17f28b08403f706f5a44" },
"noice.nvim": { "branch": "main", "commit": "7b1960c48078a8b2fb44a89db82f4fa637b2d7c8" },
"nui.nvim": { "branch": "main", "commit": "53e907ffe5eedebdca1cd503b00aa8692068ca46" },
"nvim": { "branch": "main", "commit": "faf15ab0201b564b6368ffa47b56feefc92ce3f4" },
"nvim-autopairs": { "branch": "master", "commit": "b464658e9b880f463b9f7e6ccddd93fb0013f559" },
"nvim-cmp": { "branch": "main", "commit": "3403e2e9391ed0a28c3afddd8612701b647c8e26" },
"nvim-dap": { "branch": "master", "commit": "b08e05d7cff6024a9c29b64287d295db7c191450" },
"nvim-jdtls": { "branch": "master", "commit": "ece818f909c6414cbad4e1fb240d87e003e10fda" },
"nvim-lspconfig": { "branch": "master", "commit": "5a812abc65d529ea7673059a348814c21d7f87ff" },
"nvim-notify": { "branch": "master", "commit": "fbef5d32be8466dd76544a257d3f3dce20082a07" },
"nvim-projectconfig": { "branch": "master", "commit": "db11fd7d51f7180ede292a7584eb62bb48f91863" },
"nvim-treesitter": { "branch": "master", "commit": "337b503688eccb3046547661e4c738e674548fcf" },
"nvim-treesitter-context": { "branch": "master", "commit": "3288c5af7d3820d716272f1d05ab661cc540a5d6" },
"nvim-web-devicons": { "branch": "master", "commit": "e73d2774d12d0ecf9e05578d692ba1ea50508cf2" },
"oil.nvim": { "branch": "master", "commit": "7a55ede5e745e31ea8e4cb5483221524922294bf" },
"onedark.nvim": { "branch": "master", "commit": "67a74c275d1116d575ab25485d1bfa6b2a9c38a6" },
"plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" },
"renamer.nvim": { "branch": "develop", "commit": "1614d466df53899f11dd5395eaac3c09a275c384" },
"rust-tools.nvim": { "branch": "master", "commit": "676187908a1ce35ffcd727c654ed68d851299d3e" },
"supermaven-nvim": { "branch": "main", "commit": "07d20fce48a5629686aefb0a7cd4b25e33947d50" },
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
"telescope.nvim": { "branch": "master", "commit": "2eca9ba22002184ac05eddbe47a7fe2d5a384dfc" },
"trouble.nvim": { "branch": "main", "commit": "46cf952fc115f4c2b98d4e208ed1e2dce08c9bf6" },
"vim-fugitive": { "branch": "master", "commit": "320b18fba2a4f2fe3c8225c778c687e0d2620384" },
"vimtex": { "branch": "master", "commit": "3401dc81a14b7251bd813e2411eaf0d3b65bd2af" },
"workspace-diagnostics.nvim": { "branch": "main", "commit": "573ff93c47898967efdfbc6587a1a39e3c2d365e" }
}

View File

@@ -0,0 +1,7 @@
vim.api.nvim_create_autocmd({ 'TextYankPost' }, {
desc = "Highlight when yanking",
group = vim.api.nvim_create_augroup("YankHighlight", { clear = true }),
callback = function()
vim.highlight.on_yank()
end,
})

View File

@@ -0,0 +1,44 @@
local lib = require('lib.window')
local command = function(name, callback)
vim.api.nvim_create_user_command(name, callback, {})
end
command('Settings', function()
local path = vim.fn.expand('~/.config/dotfiles/homes/quirinecker/.config/nvim')
lib.new_window(path, 'Settings')
end)
command('TransparencyFix', function()
require('lualine').setup(require('plugins.lualine').opts)
end)
command('MavenStartCommand', function()
local Path = require("plenary.path")
local cwd = Path:new(vim.fn.getcwd()):absolute()
local baseName = vim.fn.fnamemodify(vim.api.nvim_buf_get_name(0), ":t")
if vim.fn.filereadable(cwd .. "/pom.xml") ~= 1 then
vim.notify("No pom.xml found in current directory", vim.log.levels.ERROR)
return
end
if not baseName:match(".java$") then
vim.notify("Current buffer is not a java file", vim.log.levels.ERROR)
return
end
local lines = vim.api.nvim_buf_get_lines(0, 0, -1, false)
local className = baseName:gsub(".java", "")
local packageName = ""
for _, line in ipairs(lines) do
if line:match("^package ") then
local value = vim.split(line, " ")[2]
packageName = value:gsub(";", "")
end
end
vim.fn.setreg("+", "mvn exec:java -Dexec.mainClass=" .. packageName .. "." .. className)
vim.notify("Copied Start Command to Clipboard", vim.log.levels.INFO)
end)

View File

@@ -0,0 +1,6 @@
require('config.settings')
require('config.keymap')
require('config.commands')
require('config.setup')
require('config.lazy')
require('config.autocommands')

View File

@@ -0,0 +1,44 @@
local keymap = vim.keymap.set
keymap({ 'v', 'n' }, ' ', '', {})
local function vn_map(map, action)
keymap({ 'v', 'n' }, map, action)
end
-- splitting
-- Clipboard
vn_map('<leader>y', [["+y]])
keymap('n', '<leader>yy', [["+yy]])
vn_map('<leader>op', [[o<Esc>"+p]])
vn_map('<leader>p', [["+p]])
vn_map('<leader>cl', ':bd <cr>')
vn_map('<leader>ss', ':w <cr>')
vn_map('<leader>sq', ':wq <cr>')
vn_map('<leader>sc', ':w <cr> :bd <cr>')
-- Quickfix List
vim.keymap.set('n', '<alt>n', ':cnext<cr>')
vim.keymap.set('n', '<alt>p', ':cprevious<cr>')
-- Terminal
vim.keymap.set('n', '<leader>tt', function()
os.execute("kitty")
end)
-- Copy Path to clipboard
vim.keymap.set('n', '<leader>yrp', function()
local path = vim.fn.expand("%:p")
local relative_path = vim.fn.fnamemodify(path, ":~:.")
vim.fn.setreg("+", relative_path)
vim.notify('Copied "' .. relative_path .. '" to the clipboard!')
end)
vim.keymap.set('n', '<leader>yap', function()
local path = vim.fn.expand("%:p")
vim.fn.setreg("+", path)
vim.notify('Copied "' .. path .. '" to the clipboard!')
end)

View File

@@ -0,0 +1,6 @@
-- require('lazy').setup("plugins")
require('lazy').setup({
spec = {
{import = "plugins.spec"},
}
})

View File

@@ -0,0 +1,35 @@
-- Mapleader
vim.g.mapleader = ' '
-- Colors
vim.opt.termguicolors = true
-- tabsize
vim.opt.tabstop = 4
vim.opt.shiftwidth = 4
vim.opt.softtabstop = 4
vim.opt.expandtab = true
-- Line Wrap
vim.opt.wrap = false
-- Searching
vim.opt.hlsearch = false
vim.opt.incsearch = true
-- Line Numbering
vim.opt.number = true
vim.opt.relativenumber = true
-- Other
vim.opt.scrolloff = 8
vim.opt.signcolumn = "yes"
vim.opt.colorcolumn = "120"
vim.opt.smartindent = true
-- Disabling Netrw
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
-- Tabline
vim.opt.showtabline = 1

View File

@@ -0,0 +1,12 @@
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)

View File

@@ -0,0 +1 @@
package com.example.demo;

View File

@@ -0,0 +1,7 @@
M = {}
function M.has_file(filename)
return vim.fn.filereadable(filename) == 1
end
return M

View File

@@ -0,0 +1,15 @@
return {
new_window = function(o_path, o_title)
if o_path == nil then
o_path = vim.fn.getcwd()
end
if o_title == nil then
o_title = "neovim"
end
print(string.format("ghostty --working-directory='%s' --title='%s' -e nvim .", o_path, o_title))
return vim.fn.jobstart(string.format("ghostty --working-directory='%s' --title='%s' -e nvim .", o_path, o_title),
{ detach = true })
end
}

View File

@@ -0,0 +1,62 @@
local function CurrentTime()
return os.date("%H:%M:%S")
end
local function Text(text)
return function()
return text
end
end
local theme = require('plugins.config.lualine.nord_theme')
local opts = {
options = {
theme = theme.spec,
component_separators = '|',
section_separators = { left = '', right = '' },
},
sections = {
lualine_a = {
{ 'mode', separator = { left = '', right = '' } },
},
lualine_b = { {
'tabs',
seperator = " ",
cond = function()
return #vim.fn.gettabinfo() >= 2
end,
tabs_color = {
inactive = { fg = theme.colors.nord5 },
active = { fg = theme.colors.nord8 },
}
}, 'filename', 'branch', 'diff' },
lualine_c = {},
lualine_x = {},
lualine_y = { 'filetype', { 'diagnostics', always_visible = true }, 'progress' },
lualine_z = {
{ CurrentTime, separator = { right = '', left = '' } },
},
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = {},
lualine_x = {},
lualine_y = {},
lualine_z = {},
},
tabline = {
lualine_a = {},
lualine_b = {},
lualine_c = {},
lualine_x = {},
lualine_y = {},
lualine_z = {},
},
extensions = {},
}
require('lualine').setup(opts)

View File

@@ -0,0 +1,31 @@
local M = {}
M.colors = {
blue = '#80a0ff',
cyan = '#79dac8',
transparent = nil,
white = '#c6c6c6',
red = '#ff5189',
violet = '#d183e8',
grey = '#303030',
}
M.theme = {
normal = {
a = { fg = M.colors.transparent, bg = M.colors.violet },
b = { fg = M.colors.white, bg = M.colors.grey },
c = { fg = M.colors.transparent, bg = M.colors.transparent },
},
insert = { a = { fg = M.colors.transparent, bg = M.colors.blue } },
visual = { a = { fg = M.colors.transparent, bg = M.colors.cyan } },
replace = { a = { fg = M.colors.transparent, bg = M.colors.red } },
inactive = {
a = { fg = M.colors.white, bg = M.colors.transparent },
b = { fg = M.colors.white, bg = M.colors.transparent },
c = { fg = M.colors.transparent, bg = M.colors.transparent },
},
}
return M

View File

@@ -0,0 +1,30 @@
local M = {}
M.colors = {
nord1 = '#3B4252',
nord3 = '#4C566A',
nord5 = '#E5E9F0',
nord6 = '#ECEFF4',
nord7 = '#8FBCBB',
nord8 = '#88C0D0',
nord13 = '#EBCB8B',
transparent = nil,
}
M.spec = {
normal = {
a = { fg = M.colors.transparent, bg = M.colors.nord8, gui = 'bold' },
b = { fg = M.colors.nord5, bg = M.colors.nord1 },
c = { fg = M.colors.transparent, bg = M.colors.transparent },
},
insert = { a = { fg = M.colors.transparent, bg = M.colors.nord6, gui = 'bold' } },
visual = { a = { fg = M.colors.transparent, bg = M.colors.nord7, gui = 'bold' } },
replace = { a = { fg = M.colors.transparent, bg = M.colors.nord13, gui = 'bold' } },
inactive = {
a = { fg = M.colors.nord1, bg = M.colors.transparent, gui = 'bold' },
b = { fg = M.colors.nord5, bg = M.colors.transparent },
c = { fg = M.colors.transparent, bg = M.colors.transparent },
},
}
return M

View File

@@ -0,0 +1,6 @@
return {
"NStefan002/2048.nvim",
cmd = "Play2048",
enabled = false,
config = true,
}

View File

@@ -0,0 +1,4 @@
return {
"brenoprata10/nvim-highlight-colors",
opts = {}
}

View File

@@ -0,0 +1,5 @@
return {
'numToStr/Comment.nvim',
lazy = false,
opts = {}
}

View File

@@ -0,0 +1,105 @@
local function setup()
-- Set up nvim-cmp
local cmp = require 'cmp'
local lspkind = require('lspkind')
local cmp_select = { behavior = cmp.SelectBehavior.Select }
cmp.setup({
snippet = {
-- REQUIRED - you must specify a snippet engine
expand = function(args)
local luasnip = require("luasnip")
if not luasnip then
return
end
luasnip.lsp_expand(args.body)
end,
},
window = {
-- completion = cmp.config.window.bordered(),
-- documentation = cmp.config.window.bordered(),
},
mapping = cmp.mapping.preset.insert({
['<C-p>'] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Select }),
['<C-n>'] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Select }),
['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.abort(),
['<CR>'] = cmp.mapping.confirm({ select = false }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
}),
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
{ name = 'luasnip' }, -- For luasnip users.
-- { name = 'emoji' }
}, {
{ name = 'buffer' },
}),
formatting = {
format = lspkind.cmp_format({
mode = 'symbol',
maxwidth = 50,
ellipsis_char = 'b',
before = function(entry, vim_item)
return vim_item
end
})
}
})
-- Set configuration for specific filetype.
cmp.setup.filetype('gitcommit', {
sources = cmp.config.sources({
{ name = 'cmp_git' }, -- You can specify the `cmp_git` source if you were installed it.
}, {
{ name = 'buffer' },
})
})
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline({ '/', '?' }, {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = 'buffer' }
}
})
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline(':', {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({
{ name = 'path' }
}, {
{ name = 'cmdline' }
})
})
-- auto pairs
local cmp_autopairs = require('nvim-autopairs.completion.cmp')
cmp.event:on(
'confirm_done',
cmp_autopairs.on_confirm_done()
)
end
return {
'hrsh7th/nvim-cmp',
event = { "InsertEnter", "CmdlineEnter" },
config = function()
setup()
end,
dependencies = {
'hrsh7th/cmp-nvim-lsp',
'hrsh7th/cmp-buffer',
'hrsh7th/cmp-path',
'hrsh7th/cmp-cmdline',
'hrsh7th/nvim-cmp',
'onsails/lspkind.nvim',
'saadparwaiz1/cmp_luasnip',
'hrsh7th/cmp-emoji',
{ 'windwp/nvim-autopairs', opts = {} },
require('plugins.spec.snippets'),
require('plugins.spec.lsp'),
require('plugins.spec.jdtls')
}
}

View File

@@ -0,0 +1,23 @@
return {
"tpope/vim-dadbod",
config = function()
local augroup = vim.api.nvim_create_augroup("SqlCompletion", {})
vim.api.nvim_create_autocmd({ "FileType" }, {
group = augroup,
pattern = { "sql", "mysql", "plsql" },
callback = function()
require('cmp').setup.buffer({
sources = {
{ name = 'vim-dadbod-completion' }
}
})
end
})
end,
dependencies = {
"kristijanhusak/vim-dadbod-ui",
"pbogut/vim-dadbod-ssh",
"kristijanhusak/vim-dadbod-completion"
}
}

View File

@@ -0,0 +1,13 @@
return {
'tpope/vim-fugitive',
keys = {
{ '<leader>gg', ':Git<cr>', 'Git Status' },
{ '<leader>gc', function()
if vim.bo.filetype == 'fugitive' then
vim.cmd.close()
end
vim.cmd("Git commit")
end, '(g)it (c)ommit' }
},
cmd = 'Git'
}

View File

@@ -0,0 +1,28 @@
return {
"David-Kunz/gen.nvim",
opts = {
model = "deepseek-r1:14b", -- The default model to use.
host = "localhost", -- The host running the Ollama service.
port = "11434", -- The port on which the Ollama service is listening.
quit_map = "q", -- set keymap for close the response window
retry_map = "<c-r>", -- set keymap to re-send the current prompt
init = function(options) pcall(io.popen, "ollama serve > /dev/null 2>&1 &") end,
-- Function to initialize Ollama
command = function(options)
local body = { model = options.model, stream = true }
return "curl --silent --no-buffer -X POST http://" ..
options.host .. ":" .. options.port .. "/api/chat -d $body"
end,
-- The command for the Ollama service. You can use placeholders $prompt, $model and $body (shellescaped).
-- This can also be a command string.
-- The executed command must return a JSON object with { response, context }
-- (context property is optional).
-- list_models = '<omitted lua function>', -- Retrieves a list of model names
display_mode = "split", -- The display mode. Can be "float" or "split".
show_prompt = true, -- Shows the prompt submitted to Ollama.
show_model = true, -- Displays which model you are using at the beginning of your chat session.
no_auto_close = true, -- Never closes the window automatically.
debug = false -- Prints errors and the command which is run.
}
}

View File

@@ -0,0 +1,8 @@
return {
'edluffy/hologram.nvim',
event = 'VeryLazy',
enabled = false,
opts = {
auto_display = true
}
}

View File

@@ -0,0 +1,5 @@
local plugins = {
'mfussenegger/nvim-jdtls',
}
return plugins

View File

@@ -0,0 +1,15 @@
return {
enabled = false,
"mfussenegger/nvim-jdtls",
config = function()
local capabilities = require("cmp_nvim_lsp").default_capabilities()
require("jdtls").start_or_attach({
cmd = { "jdtls" },
root_dir = vim.fs.dirname(vim.fs.find({ 'gradlew', '.git', 'mvnw', 'pom.xml' }, { upward = true })[1]),
capabilities = capabilities
})
end,
dependencies = {
require("plugins.spec.lsp")
}
}

View File

@@ -0,0 +1,188 @@
local function keymap(args)
-- get client
local bufnr = args.buf
local client = vim.lsp.get_client_by_id(args.data.client_id)
if not client then
return
end
-- loading workspace diagnostics
require('workspace-diagnostics').populate_workspace_diagnostics(client, bufnr)
-- Enable completion triggered by <c-x><c-o>
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
-- Mappings.
-- See `:help vim.lsp.*` for documentation on any of the below functions
local bufopts = { noremap = true, silent = true, buffer = bufnr }
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts)
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts)
vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts)
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts)
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, bufopts)
vim.keymap.set('n', '<A-k>', function()
vim.diagnostic.open_float({ focusable = false, border = "rounded" })
end, bufopts)
vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, bufopts)
vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, bufopts)
vim.keymap.set('n', '<space>wl', function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end, bufopts)
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, bufopts)
vim.keymap.set('n', '<space>ca', vim.lsp.buf.code_action, bufopts)
vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, bufopts)
-- autoformat
if client.supports_method('textDocument/formatting') then
vim.api.nvim_create_autocmd('BufWritePre', {
group = vim.api.nvim_create_augroup('LspFormatting', { clear = true }),
buffer = args.buf,
callback = function()
if vim.fn.exists(":LspEslintFixAll") == 1 then
vim.cmd(":LspEslintFixAll")
else
vim.lsp.buf.format { bufnr = args.buf, id = client.id }
end
end
})
end
-- vim.lsp.inlay_hint.enable(true, { bufnr })
end
local function diagnostic_icons()
local signs = {
Error = "",
Warn = "",
Hint = "",
Info = ""
}
for type, icon in pairs(signs) do
local hl = "DiagnosticSign" .. type
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
end
end
local function configToHandler(server, config)
return function()
require("lspconfig")[server].setup(config)
end
end
local function lsp_setup()
local lspconfig = require("lspconfig")
-- adding edge cases for workspace diagnostics
require('workspace-diagnostics').setup {
workspace_files = function()
local gitPath = vim.fn.systemlist("git rev-parse --show-toplevel")[1]
local workspace_files = vim.fn.split(vim.fn.system("git ls-files " .. gitPath), "\n")
-- this makes nuxt laod the nuxt typescript definition
table.insert(workspace_files, '.nuxt/nuxt.d.ts')
return workspace_files
end
}
vim.api.nvim_create_autocmd("LspAttach", {
desc = "LSP actions",
callback = keymap
})
local capabilities = require("cmp_nvim_lsp").default_capabilities()
local with_defaults = function(config)
config.capabilities = capabilities
return config
end
require('mason').setup({})
require('mason-lspconfig').setup { ensure_installed = {} }
vim.lsp.enable({
'vue_ls',
'nil_ls',
'nixd',
'rust_analyzer',
'lua_ls',
'gdscript',
'jsonls',
'r_language_server',
'tailwindcss',
'html',
'taplo',
'protols',
'yamlls',
'clangd',
'eslint',
'nushell',
'tinymist'
-- 'jdtls'
})
-- not collision between deno lsp and ts lsp
if require("lib.lsp").has_file("deno.json") then
vim.lsp.enable("denols")
else
vim.lsp.enable("vtsls")
-- vim.lsp.enable("ts_ls") this is disabled vtsls for vue required
end
vim.lsp.config('*', with_defaults({}))
vim.lsp.config('vue_ls', with_defaults(require("plugins.spec.server_configurations.vue")))
vim.lsp.config('nil_ls', with_defaults(require("plugins.spec.server_configurations.nix")['nil']))
vim.lsp.config('nixd', with_defaults(require("plugins.spec.server_configurations.nix")['nixd']))
vim.lsp.config('rust_analyzer', with_defaults(require("plugins.spec.server_configurations.rust")))
vim.lsp.config('lua_ls', with_defaults(require("plugins.spec.server_configurations.lua")))
vim.lsp.config('gdscript', with_defaults(require("plugins.spec.server_configurations.gdscript")))
vim.lsp.config('ts_ls', with_defaults(require("plugins.spec.server_configurations.typescript").config()))
vim.lsp.config('jsonls', with_defaults(require("plugins.spec.server_configurations.json")))
vim.lsp.config('yamlls', with_defaults(require("plugins.spec.server_configurations.yaml")))
vim.lsp.config('denols', with_defaults(require("plugins.spec.server_configurations.deno").config()))
vim.lsp.config('r_language_server', with_defaults({
cmd = { "R", "--no-echo", "-e", "languageserver::run()" }
}))
vim.lsp.config('jdtls', with_defaults(require("plugins.spec.server_configurations.java")))
vim.lsp.config('tailwindcss', with_defaults(require("plugins.spec.server_configurations.tailwindcss")))
vim.lsp.config('html', with_defaults(require("plugins.spec.server_configurations.html")))
vim.lsp.config('taplo', with_defaults(require("plugins.spec.server_configurations.taplo")))
vim.lsp.config('protols', with_defaults(require("plugins.spec.server_configurations.proto")))
vim.lsp.config('clangd', with_defaults(require("plugins.spec.server_configurations.clang")))
vim.lsp.config('vtsls', with_defaults(require("plugins.spec.server_configurations.vtsls").config()))
vim.lsp.config('eslint', with_defaults(require("plugins.spec.server_configurations.eslint")))
vim.lsp.config('tinymist', with_defaults({
cmd = { "tinymist" }
}))
vim.diagnostic.config({
virtual_text = {
prefix = '', -- or '■', '▎', 'x', '' whatever you want
spacing = 2,
},
underline = true,
update_in_insert = false, -- set to true if you want real-time errors while typing
severity_sort = true,
signs = {
text = {
[vim.diagnostic.severity.ERROR] = "",
[vim.diagnostic.severity.WARN] = "",
[vim.diagnostic.severity.INFO] = "",
[vim.diagnostic.severity.HINT] = "",
}
}
})
end
return {
'neovim/nvim-lspconfig',
event = { "BufReadPost", "BufNewFile" },
config = function()
lsp_setup()
end,
dependencies = {
{ 'williamboman/mason.nvim' },
{ 'williamboman/mason-lspconfig.nvim' },
'artemave/workspace-diagnostics.nvim',
}
}

View File

@@ -0,0 +1,11 @@
return {
'nvim-lualine/lualine.nvim',
event = "VeryLazy",
lazy = false,
config = function()
require('plugins.config.lualine')
end,
dependencies = {
require("plugins.spec.theme")
}
}

View File

@@ -0,0 +1,20 @@
function preview()
if vim.bo.filetype ~= "markdown" then
return nil
end
vim.cmd("MarkdownPreview")
end
return {
"iamcco/markdown-preview.nvim",
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
build = "cd app && yarn install",
keys = {
{ "<leader>p", preview, desc = "Markdown Preview" },
},
init = function()
vim.g.mkdp_filetypes = { "markdown" }
end,
ft = { "markdown" },
}

View File

@@ -0,0 +1,4 @@
return {
"echasnovski/mini.bracketed",
opts = {},
}

View File

@@ -0,0 +1,39 @@
return {
'folke/noice.nvim',
event = "UIEnter",
enabled = true,
opts = {
messages = {
enabled = false,
view = "mini",
view_warn = "mini",
view_error = "mini"
},
lsp = {
-- override makdown rendering so that **cmp** and other plugins use **Treesitter**
override = {
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
["vim.lsp.util.stylize_markdown"] = true,
["cmp.entry.get_documentation"] = true,
},
hover = {
enabled = false,
},
signature = {
enabled = false
}
},
-- you can enable a preset for easier configuration
presets = {
bottom_search = true, -- use a classic bottom cmdline for search
command_palette = true, -- position the cmdline and popupmenu together
long_message_to_split = true, -- long messages will be sent to a split
inc_rename = false, -- enables an input dialog for inc-rename.nvim
lsp_doc_border = false, -- add a border to hover docs and signature help
},
},
dependencies = {
'MunifTanjim/nui.nvim',
require("plugins.spec.notify")
}
}

View File

@@ -0,0 +1,12 @@
return {
'rcarriga/nvim-notify',
event = "UIEnter",
lazy = false,
config = function()
require('notify').setup {
background_colour = "#000000",
}
vim.notify = require('notify')
end
}

View File

@@ -0,0 +1,20 @@
return {
'mfussenegger/nvim-dap',
dependencies = {
{'jay-babu/mason-nvim-dap.nvim', opts = {
handlers = {
function (config)
require('mason-nvim-dap').default_setup(config)
end,
cppdbg = function (config)
config.adapters.lldb = {
type = 'executable',
command = 'lldb-vscode',
name = 'lldb'
}
require('mason-nvim-dap').default_setup(config)
end
}
}}
}
}

View File

@@ -0,0 +1,20 @@
local function oil()
require("oil").open()
end
return {
'stevearc/oil.nvim',
opts = {
view_options = {
show_hidden = true
}
},
lazy = false,
cmd = 'Oil',
keys = {
{"<leader>ft", oil, ""}
},
dependencies = {
'kyazdani42/nvim-web-devicons',
}
}

View File

@@ -0,0 +1,6 @@
return {
'windwp/nvim-projectconfig',
enabled = true,
opts = {},
lazy = false
}

View File

@@ -0,0 +1,4 @@
return {
cmd = { "clangd" },
filetypes = { "c", "cpp", "objc", "objcpp" },
}

View File

@@ -0,0 +1,6 @@
return {
config = function()
return {}
end
}

View File

@@ -0,0 +1,3 @@
return {
cmd = { "vscode-eslint-language-server", "--stdio" }
}

View File

@@ -0,0 +1,3 @@
return {
}

View File

@@ -0,0 +1,3 @@
return {
cmd = { "vscode-html-language-server", "--stdio" },
}

View File

@@ -0,0 +1,18 @@
return {
cmd = { "jdtls", "-configuration", "/home/quirinecker/.cache/jdtls/config", "-data", "/home/quirinecker/.cache/jdtls/workspace" },
java = {
contentProvider = { preferred = 'fernflower' },
configuration = {
updateBuildConfiguration = 'interactive',
},
},
{
jvm_args = {},
workspace = "/home/quirinecker/.cache/jdtls/workspace"
},
init_options = {
jvm_args = {
"--enable-preview"
}
}
}

View File

@@ -0,0 +1,17 @@
return {
cmd = { "vscode-json-language-server", "--stdio" },
settings = {
json = {
schemas = {
{
fileMatch = { 'package.json' },
url = 'https://json.schemastore.org/package.json',
},
{
fileMatch = { 'tsconfig.json', 'tsconfig.*.json' },
url = 'https://json.schemastore.org/tsconfig.json'
}
},
},
}
}

View File

@@ -0,0 +1,46 @@
function should_load_nvim_workspace()
return true
end
return {
on_init = function(client)
if not should_load_nvim_workspace() then
return
end
client.config.settings.Lua = vim.tbl_deep_extend('force', client.config.settings.Lua, {
runtime = {
-- Tell the language server which version of Lua you're using (most
-- likely LuaJIT in the case of Neovim)
version = 'LuaJIT',
-- Tell the language server how to find Lua modules same way as Neovim
-- (see `:h lua-module-load`)
path = {
'lua/?.lua',
'lua/?/init.lua',
},
},
-- Make the server aware of Neovim runtime files
workspace = {
checkThirdParty = false,
library = {
vim.env.VIMRUNTIME
-- Depending on the usage, you might want to add additional paths
-- here.
-- '${3rd}/luv/library'
-- '${3rd}/busted/library'
}
-- Or pull in all of 'runtimepath'.
-- NOTE: this is a lot slower and will cause issues when working on
-- your own configuration.
-- See https://github.com/neovim/nvim-lspconfig/issues/3189
-- library = {
-- vim.api.nvim_get_runtime_file('', true),
-- }
}
})
end,
settings = {
Lua = {}
}
}

View File

@@ -0,0 +1,16 @@
return {
['nil'] = {
cmd = { "nil" },
settings = {
["nil"] = {
formatting = {
command = { "nixfmt" },
},
},
},
},
['nixd'] = {
cmd = { "nixd" },
}
}

View File

@@ -0,0 +1,3 @@
return {
cmd = {"protols"}
}

View File

@@ -0,0 +1,3 @@
return {
cmd = { "pyright" },
}

View File

@@ -0,0 +1,10 @@
return {
cmd = { "rust-analyzer" },
settings = {
["rust-analyzer"] = {
rustfmt = {
overrideCommand = { "rustfmt" },
}
}
}
}

View File

@@ -0,0 +1,4 @@
return {
cmd = { "tailwindcss-language-server", "--stdio" },
root_markers = { "package.json" },
}

View File

@@ -0,0 +1,3 @@
return {
cmd = { "taplo", "lsp", "stdio" }
}

View File

@@ -0,0 +1,27 @@
return {
config = function()
local vuePluginPath = vim.fn.expand(
"~/.config/dotfiles/homes/quirinecker/.npm_global/node_modules/@vue/typescript-plugin/")
return {
cmd = { "typescript-language-server", "--stdio" },
single_file_support = true,
init_options = {
plugins = {
{
name = "@vue/typescript-plugin",
location = vuePluginPath,
languages = { "javascript", "typescript", "vue" },
},
},
},
filetypes = {
"javascript",
"typescript",
-- currently disabled because no attribute completions
-- "vue",
}
}
end
}

View File

@@ -0,0 +1,25 @@
return {
config = function()
local vuePluginPath = vim.fn.expand(
"~/.config/dotfiles/homes/quirinecker/.npm_global/node_modules/@vue/typescript-plugin/")
local vue_plugin = {
name = '@vue/typescript-plugin',
location = vuePluginPath,
languages = { 'vue' },
configNamespace = 'typescript',
}
return {
settings = {
vtsls = {
tsserver = {
globalPlugins = {
vue_plugin,
},
},
},
},
filetypes = { 'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue' },
}
end
}

View File

@@ -0,0 +1,3 @@
return {
cmd = { "vue-language-server", "--stdio" },
}

View File

@@ -0,0 +1,14 @@
return {
cmd = { "yaml-language-server", "--stdio" },
settings = {
yaml = {
schemas = {
["https://raw.githubusercontent.com/compose-spec/compose-spec/master/schema/compose-spec.json"] =
"compose.yaml",
["https://raw.githubusercontent.com/SchemaStore/schemastore/refs/heads/master/src/schemas/json/github-workflow.json"] = "**/.github/workflows/*"
}
}
}
}

View File

@@ -0,0 +1,9 @@
return {
"L3MON4D3/LuaSnip",
version = "v2.*",
run = "make install_jsregexp",
config = function()
require("luasnip.loaders.from_vscode").lazy_load()
end,
dependencies = { 'rafamadriz/friendly-snippets' }
}

View File

@@ -0,0 +1,6 @@
return {
enabled = true,
"supermaven-inc/supermaven-nvim",
-- lazy = false,
opts = {}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,24 @@
local M = {}
M.find_directories = function()
local pickers = require("telescope.pickers")
local finders = require("telescope.finders")
local conf = require("telescope.config").values
pickers.new({}, {
prompt_title = "Finde Directories",
__locations_input = true,
finder = finders.new_oneshot_job({ "find", "-type", "d" }, {
entry_maker = function(entry)
return {
value = entry,
display = '' .. entry,
ordinal = entry,
}
end
}),
sorter = conf.file_sorter()
}):find()
end
return M

View File

@@ -0,0 +1,101 @@
local pickers = require("telescope.pickers")
local finders = require("telescope.finders")
local conf = require("telescope.config").values
local actions = require("telescope.actions")
local action_state = require("telescope.actions.state")
local M = {}
local function trim(s)
return (string.gsub(s, "^%s*(.-)%s*$", "%1"))
end
local function parse_emoji_line(line)
if not line or vim.startswith(line, "#") then
return nil
end
local id_element_split = vim.split(line, ";")
local element = id_element_split[2]
if not element then
return nil
end
local state_emoji_split = vim.split(element, "#")
local qualified = state_emoji_split[1]
local emoji = state_emoji_split[2]
if not qualified or trim(qualified) ~= "fully-qualified" then
return nil
end
if not emoji then
return nil
end
local icon_description_split = vim.split(emoji, " ")
local icon = icon_description_split[2]
local description = icon_description_split[4]
if not description then
return nil
end
return {
display = trim(icon) .. " " .. trim(description),
value = trim(icon)
}
end
function M.find_emojis()
local path = vim.fn.stdpath("config") .. "/lua/plugins/spec/telescope-picker/emojis.txt"
print(path)
local file = io.open(path, "r")
if not file then
print("Emoji File not found")
return nil
end
local t = {}
for line in file:lines() do
local parsed_line = parse_emoji_line(line)
if parsed_line then
table.insert(t, parsed_line)
end
end
file:close()
local finder = finders.new_table({
results = t,
entry_maker = function(entry)
return {
value = entry.value,
display = entry.display,
ordinal = entry.display,
}
end
})
pickers.new(conf, {
prompt_title = "Find Emojis",
finder = finder,
sorter = conf.generic_sorter(t),
attach_mappings = function(prompt_bufnr, _)
actions.select_default:replace(function()
actions.close(prompt_bufnr)
local selection = action_state.get_selected_entry()
local buf = vim.api.nvim_get_current_buf()
local cursor = vim.api.nvim_win_get_cursor(0)
vim.api.nvim_buf_set_text(buf, cursor[1] - 1, cursor[2], cursor[1] - 1, cursor[2], { selection.value })
vim.api.nvim_win_set_cursor(0, { cursor[1], cursor[2] + 1 })
end)
return true
end,
}):find()
end
return M

View File

@@ -0,0 +1,50 @@
local M = {}
M.multi_grep = function(opts)
local pickers = require("telescope.pickers")
local finders = require("telescope.finders")
local conf = require("telescope.config").values
local make_entry = require "telescope.make_entry"
opts = opts or {}
opts.cwd = opts.cwd or vim.fn.getcwd()
local finder = finders.new_async_job {
command_generator = function(prompt)
if not prompt or prompt == "" then
return nil
end
local segments = vim.split(prompt, " ")
local args = { "rg" }
if segments[1] then
table.insert(args, "-e")
table.insert(args, segments[1])
end
if segments[2] then
table.insert(args, "-g")
table.insert(args, segments[2])
end
return vim.tbl_flatten {
args,
{ "--color=never", "--no-heading", "--with-filename", "--line-number", "--column", "--smart-case" },
}
end,
entry_maker = make_entry.gen_from_vimgrep(opts),
cwd = opts.cwd,
}
pickers.new({}, {
debounce = 100,
prompt_title = "Multi Grep",
finder = finder,
previewer = conf.grep_previewer(opts),
sorter = require("telescope.sorters").empty(),
}):find()
end
M.multi_grep()
return M

View File

@@ -0,0 +1,86 @@
local dropdown_configs = {
layout_strategy = 'horizontal',
layout_config = {
prompt_position = 'bottom',
horizontal = {
width = 0.8,
height = 100,
},
},
}
local function find_files()
require("telescope.builtin").find_files()
end
local function find_references()
require('telescope.builtin').lsp_references()
end
local function find_buffers()
require('telescope.builtin').buffers()
end
local function find_helptags()
require('telescope.builtin').help_tags()
end
local function find_text()
require('telescope.builtin').live_grep()
end
local function find_directories()
require('plugins.spec.telescope-picker.find_directories').find_directories()
end
local function find_grep()
require('plugins.spec.telescope-picker.multi_grep').multi_grep()
end
local function find_emojis()
require('plugins.spec.telescope-picker.find_emojis').find_emojis()
end
return {
'nvim-telescope/telescope.nvim',
config = function()
require('telescope').setup({
extensions = {
['ui-select'] = {
require('telescope.themes').get_dropdown(dropdown_configs),
},
},
pickers = {
find_files = {
hidden = true,
find_command = { 'rg', '--files', '--hidden', '--glob', '!**/.git/*' },
}
},
})
require('telescope').load_extension('ui-select')
vim.api.nvim_create_user_command("FindPluginFiles", function()
require('telescope.builtin').find_files({
cwd = vim.fs.joinpath(vim.fn.stdpath('data'), 'lazy'),
})
end, {})
vim.api.nvim_create_user_command("FindEmojis", function()
find_emojis()
end, {})
end,
keys = {
{ '<leader>ff', find_files, desc = "(f)ind (f)iles" },
{ '<leader>gr', find_references, desc = "(g)o to (r)eferences" },
{ '<leader>fg', find_grep, desc = "(f)ind (g)rep" },
{ '<leader>fb', find_buffers, desc = "(f)ind (b)uffers" },
{ '<leader>fht', find_helptags, desc = "(f)ind (b)elp tags" },
{ '<leader>fd', find_directories, desc = "(f)ind (d)irectories" },
},
cmd = { "Telescope", "FindPluginFiles", "FindEmojis" },
dependencies = {
'nvim-telescope/telescope-ui-select.nvim',
'nvim-lua/plenary.nvim',
'kyazdani42/nvim-web-devicons',
}
}

View File

@@ -0,0 +1,43 @@
return {
{
'catppuccin/nvim',
as = 'catppuccin',
config = function()
require("catppuccin").setup {
flavour = "mocha",
transparent_background = true
}
-- vim.cmd [[ colorscheme catppuccin ]]
end
},
{
'EdenEast/nightfox.nvim',
config = function()
require('nightfox').setup {
options = { transparent = true }
}
-- vim.cmd [[ colorscheme nightfox ]]
end,
},
{
'navarasu/onedark.nvim',
config = function()
require('onedark').setup {
transparent = true,
lualine = {
transparent = true
}
}
-- vim.cmd [[ colorscheme onedark ]]
end
},
{
'shaunsingh/nord.nvim',
config = function()
vim.g.nord_disable_background = true
vim.cmd [[colorscheme nord]]
end
}
}

View File

@@ -0,0 +1,78 @@
return {
{
'nvim-treesitter/nvim-treesitter',
build = ':TSUpdate',
event = { "BufReadPost", "BufNewFile" },
config = function()
require("nvim-treesitter.configs").setup {
ensure_installed = {
"lua",
"typescript",
"javascript",
"css",
"html",
"json",
"markdown",
"markdown_inline",
"yaml",
"rust",
"python",
"gdscript",
"vue",
"toml",
},
highlight = {
enable = true
},
indent = {
enable = true
}
}
end,
dependencies = {
{
"nvim-treesitter/nvim-treesitter-textobjects",
config = function()
require("nvim-treesitter.configs").setup {
textobjects = {
select = {
enable = true,
lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim
keymaps = {
-- You can use the capture groups defined in textobjects.scm
["afn"] = "@function.outer",
["ifn"] = "@function.inner",
["acl"] = "@class.outer",
["icl"] = "@class.inner",
["icm"] = "@comment.inner",
["acm"] = "@comment.outer",
["ib"] = "@block.inner",
["ab"] = "@block.outer",
["la"] = "@assignment.lhs",
["ra"] = "@assignment.lhs"
},
}
}
}
end
},
}
},
{
'nvim-treesitter/nvim-treesitter-context',
event = { "BufReadPost", "BufNewFile" },
opts = {
enable = true, -- Enable this plugin (Can be enabled/disabled later via commands)
max_lines = 0, -- How many lines the window should span. Values <= 0 mean no limit.
min_window_height = 0, -- Minimum editor window height to enable context. Values <= 0 mean no limit.
line_numbers = true,
multiline_threshold = 20, -- Maximum number of lines to collapse for a single context line
trim_scope = 'outer', -- Which context lines to discard if `max_lines` is exceeded. Choices: 'inner', 'outer'
mode = 'cursor', -- Line used to calculate context. Choices: 'cursor', 'topline'
-- Separator between context and content. Should be a single character string, like '-'.
-- When separator is set, the context will only show up when there are at least 2 lines above cursorline.
separator = nil,
zindex = 20, -- The Z-index of the context window
}
},
}

View File

@@ -0,0 +1,25 @@
return {
"folke/trouble.nvim",
dependencies = "nvim-tree/nvim-web-devicons",
config = function()
require("trouble").setup {}
end,
init = function()
vim.api.nvim_create_autocmd("BufRead", {
callback = function(ev)
if vim.bo[ev.buf].buftype == "quickfix" then
vim.schedule(function()
vim.cmd([[cclose]])
vim.cmd([[Trouble qflist open]])
end)
end
end,
})
end,
cmd = { "Trouble" },
keys = {
{ "<leader>dl", vim.diagnostic.setqflist, "(d)iagnostic (l)ist" },
{ "<leader>qn", vim.cmd.cnext, "(q)uickfix (n)ext" },
{ "<leader>qp", vim.cmd.cprev, "(q)uickfix (p)revious" },
}
}

View File

@@ -0,0 +1,21 @@
function preview()
if vim.bo.filetype ~= "tex" then
return
end
print("Previewing " .. vim.fn.expand("%:p"))
vim.cmd("VimtexCompile")
end
return {
'lervag/vimtex',
-- event = "InsertEnter",
config = function()
vim.g.vimtex_view_method = "zathura"
vim.keymap.set("n", "<leader>p", preview)
end,
lazy = false,
enabled = true,
dependencies = {}
}

View File

@@ -0,0 +1,14 @@
local dap = require("dap")
dap.configurations.rust = {
{
name = 'somethign',
type = 'lldb',
request = 'launch',
program = function()
return vim.fn.getcwd() .. '/target/debug/docki'
end,
cwd = "${workspaceFolder}",
stopOnEntry = false
}
}