arch-surface added waybar config

This commit is contained in:
zaske
2025-07-13 21:02:23 +02:00
parent 79ca5d4a64
commit 9abffecf31
35 changed files with 2711 additions and 2 deletions
+24
View File
@@ -0,0 +1,24 @@
local function blend_colors(fg, bg, alpha)
-- fg, bg are hex colors as strings (e.g., "#a1112a")
-- alpha is a value between 0 (fully transparent) and 1 (fully opaque)
local function hex_to_rgb(hex)
return tonumber(hex:sub(2, 3), 16), tonumber(hex:sub(4, 5), 16), tonumber(hex:sub(6, 7), 16)
end
local function rgb_to_hex(r, g, b)
return string.format("#%02x%02x%02x", r, g, b)
end
local r1, g1, b1 = hex_to_rgb(fg)
local r2, g2, b2 = hex_to_rgb(bg)
local r = math.floor(r1 * alpha + r2 * (1 - alpha))
local g = math.floor(g1 * alpha + g2 * (1 - alpha))
local b = math.floor(b1 * alpha + b2 * (1 - alpha))
return rgb_to_hex(r, g, b)
end
return {
blend_colors = blend_colors,
}
+120
View File
@@ -0,0 +1,120 @@
-- Keymaps for better default experience
-- Set leader key
vim.g.mapleader = ' '
vim.g.maplocalleader = ' '
-- For conciseness
local opts = { noremap = true, silent = true }
-- Disable the spacebar key's default behavior in Normal and Visual modes
vim.keymap.set({ 'n', 'v' }, '<Space>', '<Nop>', { silent = true })
-- Allow moving the cursor through wrapped lines with j, k
vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
-- clear highlights
vim.keymap.set('n', '<Esc>', ':noh<CR>', opts)
-- save file
vim.keymap.set('n', '<C-s>', '<cmd> w <CR>', opts)
-- save file without auto-formatting
vim.keymap.set('n', '<leader>sn', '<cmd>noautocmd w <CR>', opts)
-- quit file
vim.keymap.set('n', '<C-q>', '<cmd> q <CR>', opts)
-- delete single character without copying into register
vim.keymap.set('n', 'x', '"_x', opts)
-- Vertical scroll and center
vim.keymap.set('n', '<C-d>', '<C-d>zz', opts)
vim.keymap.set('n', '<C-u>', '<C-u>zz', opts)
-- Find and center
vim.keymap.set('n', 'n', 'nzzzv')
vim.keymap.set('n', 'N', 'Nzzzv')
-- Resize with arrows
vim.keymap.set('n', '<Up>', ':resize -2<CR>', opts)
vim.keymap.set('n', '<Down>', ':resize +2<CR>', opts)
vim.keymap.set('n', '<Left>', ':vertical resize -2<CR>', opts)
vim.keymap.set('n', '<Right>', ':vertical resize +2<CR>', opts)
-- Buffers
vim.keymap.set('n', '<Tab>', ':bnext<CR>', opts)
vim.keymap.set('n', '<S-Tab>', ':bprevious<CR>', opts)
vim.keymap.set('n', '<leader>x', ':Bdelete!<CR>', opts) -- close buffer
vim.keymap.set('n', '<leader>b', '<cmd> enew <CR>', opts) -- new buffer
-- Increment/decrement numbers
vim.keymap.set('n', '<leader>+', '<C-a>', opts) -- increment
vim.keymap.set('n', '<leader>-', '<C-x>', opts) -- decrement
-- Window management
vim.keymap.set('n', '<leader>v', '<C-w>v', opts) -- split window vertically
vim.keymap.set('n', '<leader>h', '<C-w>s', opts) -- split window horizontally
vim.keymap.set('n', '<leader>se', '<C-w>=', opts) -- make split windows equal width & height
vim.keymap.set('n', '<leader>xs', ':close<CR>', opts) -- close current split window
-- Navigate between splits
vim.keymap.set('n', '<C-k>', ':wincmd k<CR>', opts)
vim.keymap.set('n', '<C-j>', ':wincmd j<CR>', opts)
vim.keymap.set('n', '<C-h>', ':wincmd h<CR>', opts)
vim.keymap.set('n', '<C-l>', ':wincmd l<CR>', opts)
-- Tabs
vim.keymap.set('n', '<leader>to', ':tabnew<CR>', opts) -- open new tab
vim.keymap.set('n', '<leader>tx', ':tabclose<CR>', opts) -- close current tab
vim.keymap.set('n', '<leader>tn', ':tabn<CR>', opts) -- go to next tab
vim.keymap.set('n', '<leader>tp', ':tabp<CR>', opts) -- go to previous tab
-- Toggle line wrapping
vim.keymap.set('n', '<leader>lw', '<cmd>set wrap!<CR>', opts)
-- Press jk fast to exit insert mode
vim.keymap.set('i', 'jk', '<ESC>', opts)
vim.keymap.set('i', 'kj', '<ESC>', opts)
-- Stay in indent mode
vim.keymap.set('v', '<', '<gv', opts)
vim.keymap.set('v', '>', '>gv', opts)
-- Move text up and down
vim.keymap.set('v', '<A-j>', ':m .+1<CR>==', opts)
vim.keymap.set('v', '<A-k>', ':m .-2<CR>==', opts)
-- Keep last yanked when pasting
vim.keymap.set('v', 'p', '"_dP', opts)
-- Replace word under cursor
vim.keymap.set('n', '<leader>j', '*``cgn', opts)
-- Explicitly yank to system clipboard (highlighted and entire row)
vim.keymap.set({ 'n', 'v' }, '<leader>y', [["+y]])
vim.keymap.set('n', '<leader>Y', [["+Y]])
-- Toggle diagnostics
local diagnostics_active = true
vim.keymap.set('n', '<leader>do', function()
diagnostics_active = not diagnostics_active
if diagnostics_active then
vim.diagnostic.enable(0)
else
vim.diagnostic.disable(0)
end
end)
-- Diagnostic keymaps
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous diagnostic message' })
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next diagnostic message' })
vim.keymap.set('n', '<leader>d', vim.diagnostic.open_float, { desc = 'Open floating diagnostic message' })
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' })
-- Save and load session
vim.keymap.set('n', '<leader>ss', ':mksession! .session.vim<CR>', { noremap = true, silent = false })
vim.keymap.set('n', '<leader>sl', ':source .session.vim<CR>', { noremap = true, silent = false })
+46
View File
@@ -0,0 +1,46 @@
vim.o.shell = "/bin/bash" -- Set default shell to bash
vim.o.hlsearch = false -- Set highlight on search
vim.wo.number = true -- Make line numbers default
vim.o.mouse = "a" -- Enable mouse mode
vim.o.clipboard = "unnamedplus" -- Sync clipboard between OS and Neovim.
vim.o.breakindent = true -- Enable break indent
vim.o.undofile = true -- Save undo history
vim.o.ignorecase = true -- Case-insensitive searching UNLESS \C or capital in search
vim.o.smartcase = true -- smart case
vim.wo.signcolumn = "yes" -- Keep signcolumn on by default
vim.o.updatetime = 250 -- Decrease update time
vim.o.timeoutlen = 300 -- time to wait for a mapped sequence to complete (in milliseconds)
vim.o.backup = false -- creates a backup file
vim.o.writebackup = false -- if a file is being edited by another program (or was written to file while editing with another program), it is not allowed to be edited
vim.o.completeopt = "menuone,noselect" -- Set completeopt to have a better completion experience
vim.opt.termguicolors = true
vim.o.termguicolors = true -- set termguicolors to enable highlight groups
vim.o.whichwrap = "bs<>[]hl" -- which "horizontal" keys are allowed to travel to prev/next line
vim.o.wrap = false -- display lines as one long line
vim.o.linebreak = true -- companion to wrap don't split words
vim.o.scrolloff = 4 -- minimal number of screen lines to keep above and below the cursor
vim.o.sidescrolloff = 8 -- minimal number of screen columns either side of cursor if wrap is `false`
vim.o.relativenumber = true -- set relative numbered lines
vim.o.numberwidth = 2 -- set number column width to 2 {default 4}
vim.o.shiftwidth = 2 -- the number of spaces inserted for each indentation
vim.o.tabstop = 2 -- insert n spaces for a tab
vim.o.softtabstop = 2 -- Number of spaces that a tab counts for while performing editing operations
vim.o.expandtab = true -- convert tabs to spaces
vim.o.cursorline = false -- highlight the current line
vim.o.splitbelow = true -- force all horizontal splits to go below current window
vim.o.splitright = true -- force all vertical splits to go to the right of current window
vim.o.swapfile = false -- creates a swapfile
vim.o.smartindent = true -- make indenting smarter again
vim.o.showmode = false -- we don't need to see things like -- INSERT -- anymore
vim.o.showtabline = 2 -- always show tabs
vim.o.backspace = "indent,eol,start" -- allow backspace on
vim.o.pumheight = 10 -- pop up menu height
vim.o.conceallevel = 0 -- so that `` is visible in markdown files
vim.o.fileencoding = "utf-8" -- the encoding written to a file
vim.o.cmdheight = 1 -- more space in the neovim command line for displaying messages
vim.o.autoindent = true -- copy indent from current line when starting new one
vim.opt.shortmess:append("c") -- don't give |ins-completion-menu| messages
vim.opt.iskeyword:append("-") -- hyphenated words recognized by searches
vim.opt.formatoptions:remove({ "c", "r", "o" }) -- don't insert the current comment leader automatically for auto-wrapping comments using 'textwidth', hitting <Enter> in insert mode, or hitting 'o' or 'O' in normal mode.
vim.opt.runtimepath:remove("/usr/share/vim/vimfiles") -- separate vim plugins from neovim in case vim still in use
vim.opt.termguicolors = true -- True color support
+24
View File
@@ -0,0 +1,24 @@
return {
"goolord/alpha-nvim",
dependencies = {
"nvim-tree/nvim-web-devicons",
},
config = function()
local alpha = require("alpha")
local dashboard = require("alpha.themes.startify")
dashboard.section.header.val = {
[[ ]],
[[ ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ ]],
[[ ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ ]],
[[ ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ ]],
[[ ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ ]],
[[ ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ ]],
[[ ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ ]],
[[ ]],
}
alpha.setup(dashboard.opts)
end,
}
+143
View File
@@ -0,0 +1,143 @@
return { -- Autocompletion
"hrsh7th/nvim-cmp",
-- event = 'InsertEnter',
dependencies = {
-- Snippet Engine & its associated nvim-cmp source
{
"L3MON4D3/LuaSnip",
build = (function()
-- Build Step is needed for regex support in snippets
-- This step is not supported in many windows environments
-- Remove the below condition to re-enable on windows
if vim.fn.has("win32") == 1 or vim.fn.executable("make") == 0 then
return
end
return "make install_jsregexp"
end)(),
},
"saadparwaiz1/cmp_luasnip",
-- Adds other completion capabilities.
-- nvim-cmp does not ship with all sources by default. They are split
-- into multiple repos for maintenance purposes.
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
-- Adds a number of user-friendly snippets
"rafamadriz/friendly-snippets",
},
config = function()
local cmp = require("cmp")
require("luasnip.loaders.from_vscode").lazy_load()
local luasnip = require("luasnip")
luasnip.config.setup({})
local kind_icons = {
Text = "󰉿",
Method = "m",
Function = "󰊕",
Constructor = "",
Field = "",
Variable = "󰆧",
Class = "󰌗",
Interface = "",
Module = "",
Property = "",
Unit = "",
Value = "󰎠",
Enum = "",
Keyword = "󰌋",
Snippet = "",
Color = "󰏘",
File = "󰈙",
Reference = "",
Folder = "󰉋",
EnumMember = "",
Constant = "󰇽",
Struct = "",
Event = "",
Operator = "󰆕",
TypeParameter = "󰊄",
}
cmp.setup({
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
completion = { completeopt = "menu,menuone,noinsert" },
-- window = {
-- completion = cmp.config.window.bordered(),
-- documentation = cmp.config.window.bordered(),
-- },
mapping = cmp.mapping.preset.insert({
["<C-j>"] = cmp.mapping.select_next_item(), -- Select the [n]ext item
["<C-k>"] = cmp.mapping.select_prev_item(), -- Select the [p]revious item
["<CR>"] = cmp.mapping.confirm({ select = true }), -- Accept the completion with Enter.
["<C-c>"] = cmp.mapping.complete({}), -- Manually trigger a completion from nvim-cmp.
-- Think of <c-l> as moving to the right of your snippet expansion.
-- So if you have a snippet that's like:
-- function $name($args)
-- $body
-- end
--
-- <c-l> will move you to the right of each of the expansion locations.
-- <c-h> is similar, except moving you backwards.
["<C-l>"] = cmp.mapping(function()
if luasnip.expand_or_locally_jumpable() then
luasnip.expand_or_jump()
end
end, { "i", "s" }),
["<C-h>"] = cmp.mapping(function()
if luasnip.locally_jumpable(-1) then
luasnip.jump(-1)
end
end, { "i", "s" }),
-- Select next/previous item with Control + Tab / Shift + Tab
["<C-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif luasnip.expand_or_locally_jumpable() then
luasnip.expand_or_jump()
else
fallback()
end
end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.locally_jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { "i", "s" }),
}),
sources = {
{ name = "nvim_lsp" },
{ name = "luasnip" },
{ name = "buffer" },
{ name = "path" },
},
formatting = {
fields = { "kind", "abbr", "menu" },
format = function(entry, vim_item)
-- Kind icons
vim_item.kind = string.format("%s", kind_icons[vim_item.kind])
-- vim_item.kind = string.format('%s %s', kind_icons[vim_item.kind], vim_item.kind) -- This concatonates the icons with the name of the item kind
vim_item.menu = ({
nvim_lsp = "[LSP]",
luasnip = "[Snippet]",
buffer = "[Buffer]",
path = "[Path]",
})[entry.source.name]
return vim_item
end,
},
})
end,
}
+56
View File
@@ -0,0 +1,56 @@
-- Format on save and linters
return {
'nvimtools/none-ls.nvim',
dependencies = {
'nvimtools/none-ls-extras.nvim',
'jayp0521/mason-null-ls.nvim', -- ensure dependencies are installed
},
config = function()
local null_ls = require 'null-ls'
local formatting = null_ls.builtins.formatting -- to setup formatters
local diagnostics = null_ls.builtins.diagnostics -- to setup linters
-- list of formatters & linters for mason to install
require('mason-null-ls').setup {
ensure_installed = {
'checkmake',
'prettier', -- ts/js formatter
'stylua', -- lua formatter
'eslint_d', -- ts/js linter
'shfmt',
'ruff',
},
-- auto-install configured formatters & linters (with null-ls)
automatic_installation = true,
}
local sources = {
diagnostics.checkmake,
formatting.prettier.with { filetypes = { 'html', 'json', 'yaml', 'markdown' } },
formatting.stylua,
formatting.shfmt.with { args = { '-i', '4' } },
formatting.terraform_fmt,
require('none-ls.formatting.ruff').with { extra_args = { '--extend-select', 'I' } },
require 'none-ls.formatting.ruff_format',
}
local augroup = vim.api.nvim_create_augroup('LspFormatting', {})
null_ls.setup {
-- debug = true, -- Enable debug mode. Inspect logs with :NullLsLog.
sources = sources,
-- you can reuse a shared lspconfig on_attach callback here
on_attach = function(client, bufnr)
if client.supports_method 'textDocument/formatting' then
vim.api.nvim_clear_autocmds { group = augroup, buffer = bufnr }
vim.api.nvim_create_autocmd('BufWritePre', {
group = augroup,
buffer = bufnr,
callback = function()
vim.lsp.buf.format { async = false }
end,
})
end
end,
}
end,
}
+81
View File
@@ -0,0 +1,81 @@
return {
'akinsho/bufferline.nvim',
dependencies = {
'moll/vim-bbye',
'nvim-tree/nvim-web-devicons',
},
config = function()
-- vim.opt.linespace = 8
require('bufferline').setup {
options = {
mode = 'buffers', -- set to "tabs" to only show tabpages instead
themable = true, -- allows highlight groups to be overriden i.e. sets highlights as default
numbers = 'none', -- | "ordinal" | "buffer_id" | "both" | function({ ordinal, id, lower, raise }): string,
close_command = 'Bdelete! %d', -- can be a string | function, see "Mouse actions"
right_mouse_command = 'Bdelete! %d', -- can be a string | function, see "Mouse actions"
left_mouse_command = 'buffer %d', -- can be a string | function, see "Mouse actions"
middle_mouse_command = nil, -- can be a string | function, see "Mouse actions"
-- buffer_close_icon = '󰅖',
buffer_close_icon = '',
-- buffer_close_icon = '✕',
close_icon = '',
path_components = 1, -- Show only the file name without the directory
modified_icon = '',
left_trunc_marker = '',
right_trunc_marker = '',
max_name_length = 30,
max_prefix_length = 30, -- prefix used when a buffer is de-duplicated
tab_size = 21,
diagnostics = false,
diagnostics_update_in_insert = false,
color_icons = true,
show_buffer_icons = true,
show_buffer_close_icons = true,
show_close_icon = true,
persist_buffer_sort = true, -- whether or not custom sorted buffers should persist
separator_style = { "|", "|" }, -- Left slope and right slope
enforce_regular_tabs = true,
always_show_bufferline = true,
show_tab_indicators = false,
indicator = {
-- icon = '▎', -- this should be omitted if indicator style is not 'icon'
style = 'none', -- Options: 'icon', 'underline', 'none'
},
icon_pinned = '󰐃',
minimum_padding = 1,
maximum_padding = 5,
maximum_length = 15,
sort_by = 'insert_at_end',
},
highlights = {
separator = {
fg = '#434C5E',
},
buffer_selected = {
bold = true,
italic = false,
},
-- separator_selected = {},
-- tab_selected = {},
-- background = {},
-- indicator_selected = {},
-- fill = {},
},
}
-- Keymaps
local opts = { noremap = true, silent = true, desc = 'Go to Buffer' }
-- vim.keymap.set("n", "<Tab>", "<Cmd>BufferLineCycleNext<CR>", {})
-- vim.keymap.set("n", "<S-Tab>", "<Cmd>BufferLineCyclePrev<CR>", {})
-- vim.keymap.set('n', '<leader>1', "<cmd>lua require('bufferline').go_to_buffer(1)<CR>", opts)
-- vim.keymap.set('n', '<leader>2', "<cmd>lua require('bufferline').go_to_buffer(2)<CR>", opts)
-- vim.keymap.set('n', '<leader>3', "<cmd>lua require('bufferline').go_to_buffer(3)<CR>", opts)
-- vim.keymap.set('n', '<leader>4', "<cmd>lua require('bufferline').go_to_buffer(4)<CR>", opts)
-- vim.keymap.set('n', '<leader>5', "<cmd>lua require('bufferline').go_to_buffer(5)<CR>", opts)
-- vim.keymap.set('n', '<leader>6', "<cmd>lua require('bufferline').go_to_buffer(6)<CR>", opts)
-- vim.keymap.set('n', '<leader>7', "<cmd>lua require('bufferline').go_to_buffer(7)<CR>", opts)
-- vim.keymap.set('n', '<leader>8', "<cmd>lua require('bufferline').go_to_buffer(8)<CR>", opts)
-- vim.keymap.set('n', '<leader>9', "<cmd>lua require('bufferline').go_to_buffer(9)<CR>", opts)
end,
}
+159
View File
@@ -0,0 +1,159 @@
return {
"jackMort/ChatGPT.nvim",
event = "VeryLazy",
config = function()
vim.api.nvim_set_hl(0, "ChatGPTNormalFloat", { bg = "NONE", fg = "NONE" })
vim.api.nvim_set_hl(0, "ChatGPTFloatBorder", { bg = "NONE", fg = "NONE" })
require("chatgpt").setup({
api_key_cmd = "gpg --decrypt " .. vim.fn.expand("$HOME") .. "/Dokumente/secret.txt.gpg",
yank_register = "+",
edit_with_instructions = {
diff = false,
keymaps = {
close = "<C-c>",
accept = "<C-y>",
toggle_diff = "<C-d>",
toggle_settings = "<C-o>",
cycle_windows = "<Tab>",
use_output_as_input = "<C-i>",
},
},
chat = {
loading_text = "Loading, please wait ...",
question_sign = "", -- 🙂
-- answer_sign = '', -- 🤖
answer_sign = "🤖",
max_line_length = 120,
sessions_window = {
border = {
style = "rounded",
text = {
top = " Sessions ",
},
},
win_options = {
winhighlight = "Normal:ChatGPTNormalFloat,FloatBorder:ChatGPTFloatBorder",
},
},
},
keymaps = {
close = { "<C-c>" },
yank_last = "<C-y>",
yank_last_code = "<C-k>",
scroll_up = "<C-u>",
scroll_down = "<C-d>",
new_session = "<C-n>",
cycle_windows = "<Tab>",
cycle_modes = "<C-f>",
next_message = "<C-j>",
prev_message = "<C-k>",
select_session = "<Space>",
rename_session = "r",
delete_session = "d",
draft_message = "<C-d>",
edit_message = "e",
delete_message = "d",
toggle_settings = "<C-o>",
toggle_message_role = "<C-r>",
toggle_system_role_open = "<C-s>",
stop_generating = "<C-x>",
},
popup_layout = {
default = "center",
center = {
width = "60%",
height = "80%",
},
right = {
width = "30%",
width_settings_open = "50%",
},
},
popup_window = {
border = {
highlight = "Normal:ChatGPTNormalFloat,FloatBorder:ChatGPTFloatBorder",
style = "rounded",
text = {
top = " ChatGPT ",
},
},
win_options = {
wrap = true,
linebreak = true,
foldcolumn = "1",
winhighlight = "Normal:ChatGPTNormalFloat,FloatBorder:ChatGPTFloatBorder",
},
buf_options = {
filetype = "markdown",
},
},
system_window = {
border = {
highlight = "Normal:ChatGPTNormalFloat,FloatBorder:ChatGPTFloatBorder",
style = "rounded",
text = {
top = " SYSTEM ",
},
},
win_options = {
wrap = true,
linebreak = true,
foldcolumn = "2",
winhighlight = "Normal:ChatGPTNormalFloat,FloatBorder:ChatGPTFloatBorder",
},
},
popup_input = {
prompt = "",
border = {
highlight = "Normal:ChatGPTNormalFloat,FloatBorder:ChatGPTFloatBorder",
style = "rounded",
text = {
top_align = "center",
top = " Prompt ",
},
},
win_options = {
winhighlight = "Normal:ChatGPTNormalFloat,FloatBorder:ChatGPTFloatBorder",
},
submit = "<C-Enter>",
submit_n = "<Enter>",
max_visible_lines = 20,
},
settings_window = {
border = {
style = "rounded",
text = {
top = " Settings ",
},
},
win_options = {
winhighlight = "Normal:ChatGPTNormalFloat,FloatBorder:ChatGPTFloatBorder",
},
},
-- this config assumes you have OPENAI_API_KEY environment variable set
openai_params = {
model = "gpt-4o-mini",
frequency_penalty = 0,
presence_penalty = 0,
max_tokens = 4095,
temperature = 0.2,
top_p = 0.1,
n = 1,
},
openai_edit_params = {
model = "gpt-3.5-turbo",
frequency_penalty = 0,
presence_penalty = 0,
temperature = 0,
top_p = 1,
n = 1,
},
})
end,
dependencies = {
"MunifTanjim/nui.nvim",
"nvim-lua/plenary.nvim",
"nvim-telescope/telescope.nvim",
},
}
@@ -0,0 +1,33 @@
return {
'catppuccin/nvim',
lazy = false,
priority = 1000,
config = function()
-- Setup Catppuccin with desired options
require('catppuccin').setup({
flavour = 'mocha', -- Options: 'latte', 'frappe', 'macchiato', 'mocha'
transparent_background = true, -- Enable transparency
term_colors = true, -- Use terminal colors
})
-- Load the colorscheme
vim.cmd('colorscheme catppuccin')
-- Toggle background transparency
local bg_transparency = true
local toggle_transparency = function()
bg_transparency = not bg_transparency
-- Manually set transparency
if bg_transparency then
require('catppuccin').setup({ transparent_background = true })
else
require('catppuccin').setup({ transparent_background = false })
end
vim.cmd('colorscheme catppuccin')
end
vim.keymap.set('n', '<leader>bg', toggle_transparency, { noremap = true, silent = true })
end
}
@@ -0,0 +1,26 @@
return {
'sainnhe/everforest',
lazy = false,
priority = 1000,
config = function()
-- Example config for Everforest
vim.g.everforest_background = 'soft' -- Options: 'hard', 'medium', 'soft'
vim.g.everforest_transparent_background = true -- Enable transparency
vim.g.everforest_better_performance = 1 -- Better performance settings
-- Load the colorscheme
vim.cmd('colorscheme everforest')
-- Toggle background transparency
local bg_transparency = true
local toggle_transparency = function()
bg_transparency = not bg_transparency
vim.g.everforest_transparent_background = bg_transparency
vim.cmd('colorscheme everforest')
end
vim.keymap.set('n', '<leader>bg', toggle_transparency, { noremap = true, silent = true })
end
}
@@ -0,0 +1,25 @@
return {
'morhetz/gruvbox',
lazy = false,
priority = 1000,
config = function()
-- Example config for Gruvbox
vim.g.gruvbox_contrast_dark = 'medium' -- Options: 'soft', 'medium', 'hard'
vim.g.gruvbox_transparent_bg = true -- Enable transparency
-- Load the colorscheme
vim.cmd('colorscheme gruvbox')
-- Toggle background transparency
local bg_transparency = true
local toggle_transparency = function()
bg_transparency = not bg_transparency
vim.g.gruvbox_transparent_bg = bg_transparency
vim.cmd('colorscheme gruvbox')
end
vim.keymap.set('n', '<leader>bg', toggle_transparency, { noremap = true, silent = true })
end
}
@@ -0,0 +1,28 @@
return {
'shaunsingh/nord.nvim',
lazy = false,
priority = 1000,
config = function()
-- Example config in lua
vim.g.nord_contrast = true
vim.g.nord_borders = false
vim.g.nord_disable_background = true
vim.g.nord_italic = false
vim.g.nord_uniform_diff_background = true
vim.g.nord_bold = false
-- Load the colorscheme
require('nord').set()
-- Toggle background transparency
local bg_transparency = true
local toggle_transparency = function()
bg_transparency = not bg_transparency
vim.g.nord_disable_background = bg_transparency
vim.cmd('colorscheme nord')
end
vim.keymap.set('n', '<leader>bg', toggle_transparency, { noremap = true, silent = true })
end
}
@@ -0,0 +1,25 @@
return {
'folke/tokyonight.nvim',
lazy = false,
priority = 1000,
config = function()
-- Example config for Tokyo Night
vim.g.tokyonight_style = 'night' -- Options: 'night', 'day'
vim.g.tokyonight_transparent = true -- Enable transparency
-- Load the colorscheme
vim.cmd('colorscheme tokyonight')
-- Toggle background transparency
local bg_transparency = true
local toggle_transparency = function()
bg_transparency = not bg_transparency
vim.g.tokyonight_transparent = bg_transparency
vim.cmd('colorscheme tokyonight')
end
vim.keymap.set('n', '<leader>bg', toggle_transparency, { noremap = true, silent = true })
end
}
+29
View File
@@ -0,0 +1,29 @@
-- Easily comment visual regions/lines
return {
"numToStr/Comment.nvim",
opts = {},
config = function()
local opts = { noremap = true, silent = true }
vim.keymap.set("n", "<C-_>", require("Comment.api").toggle.linewise.current, opts)
vim.keymap.set("n", "<C-c>", require("Comment.api").toggle.linewise.current, opts)
vim.keymap.set("n", "<C-/>", require("Comment.api").toggle.linewise.current, opts)
vim.keymap.set(
"v",
"<C-_>",
"<ESC><cmd>lua require('Comment.api').toggle.linewise(vim.fn.visualmode())<cr>",
opts
)
vim.keymap.set(
"v",
"<C-c>",
"<ESC><cmd>lua require('Comment.api').toggle.linewise(vim.fn.visualmode())<cr>",
opts
)
vim.keymap.set(
"v",
"<C-/>",
"<ESC><cmd>lua require('Comment.api').toggle.linewise(vim.fn.visualmode())<cr>",
opts
)
end,
}
+130
View File
@@ -0,0 +1,130 @@
return {
{
"CopilotC-Nvim/CopilotChat.nvim",
branch = "canary",
dependencies = {
{ "github/copilot.vim" },
{ "nvim-lua/plenary.nvim" },
},
build = "make tiktoken",
opts = function()
local copilot_select = require("CopilotChat.select") -- Importiere hier
return {
debug = true,
system_prompt = "You are an AI coding assistant called Copilot.",
model = "gpt-4o",
temperature = 0.1,
question_header = "## User ",
answer_header = "## Copilot ",
error_header = "## Error ",
separator = "───",
show_folds = true,
show_help = true,
auto_follow_cursor = true,
auto_insert_mode = false,
insert_at_end = false,
clear_chat_on_new_prompt = false,
highlight_selection = true,
context = nil,
history_path = vim.fn.stdpath("data") .. "/copilotchat_history",
callback = nil,
-- Default selection (visual or line)
selection = function(source)
return copilot_select.visual(source) or copilot_select.line(source)
end,
-- Default prompts
prompts = {
Explain = {
prompt = "/COPILOT_EXPLAIN Write an explanation for the active selection as paragraphs of text.",
},
Review = {
prompt = "/COPILOT_REVIEW Review the selected code.",
callback = function(response, source)
-- siehe config.lua für die Implementierung
end,
},
Fix = {
prompt = "/COPILOT_GENERATE There is a problem in this code. Rewrite the code to show it with the bug fixed.",
},
Optimize = {
prompt = "/COPILOT_GENERATE Optimize the selected code to improve performance and readability.",
},
Docs = {
prompt = "/COPILOT_GENERATE Please add documentation comment for the selection.",
},
Tests = {
prompt = "/COPILOT_GENERATE Please generate tests for my code.",
},
FixDiagnostic = {
prompt = "Please assist with the following diagnostic issue in file:",
selection = copilot_select.diagnostics,
},
Commit = {
prompt = "Write commit message for the change with commitizen convention. Make sure the title has maximum 50 characters and message is wrapped at 72 characters. Wrap the whole message in code block with language gitcommit.",
selection = copilot_select.gitdiff,
},
CommitStaged = {
prompt = "Write commit message for the change with commitizen convention. Make sure the title has maximum 50 characters and message is wrapped at 72 characters. Wrap the whole message in code block with language gitcommit.",
selection = function(source)
return copilot_select.gitdiff(source, true)
end,
},
},
-- Default window options
window = {
layout = "vertical",
width = 0.5,
height = 0.5,
relative = "editor",
border = "single",
title = "Copilot Chat",
zindex = 1,
},
-- Default mappings
mappings = {
complete = {
detail = "Use @<Tab> or /<Tab> for options.",
insert = "<Tab>",
},
close = {
normal = "q",
insert = "<C-c>",
},
reset = {
normal = "<C-l>",
insert = "<C-l>",
},
submit_prompt = {
normal = "<CR>",
insert = "<C-s>",
},
accept_diff = {
normal = "<C-y>",
insert = "<C-y>",
},
yank_diff = {
normal = "gy",
register = '"',
},
show_diff = {
normal = "gd",
},
show_system_prompt = {
normal = "gp",
},
show_user_selection = {
normal = "gs",
},
},
}
end,
},
}
+141
View File
@@ -0,0 +1,141 @@
return {
"rcarriga/nvim-dap-ui",
dependencies = { "mfussenegger/nvim-dap", "nvim-neotest/nvim-nio" },
config = function()
local dap, dapui = require("dap"), require("dapui")
local color_blend = require("color_blend")
dap.defaults.fallback.external_terminal = {
command = "/usr/bin/kitty",
args = { "-e" },
}
dap.defaults.fallback.force_external_terminal = true
dap.adapters.gdb = {
type = "executable",
command = "gdb",
args = {
"--interpreter=dap",
"--eval-command",
"set print pretty on",
},
}
-- Define the custom highlight group for the stopped line
vim.api.nvim_set_hl(0, "DapCustomHighlight", { bg = "#44475a", fg = "NONE" })
-- Define the custom highlight group for Breakpoint
vim.api.nvim_set_hl(0, "DapCustomBreakpoint", { bg = "NONE", fg = "#ff5555" })
-- Define the custom highlight group for Breakpoint line
vim.api.nvim_set_hl(
0,
"DapCustomBreakpointLine",
{ bg = color_blend.blend_colors("#a1112a", "#000000", 0.5), fg = "NONE" }
)
vim.fn.sign_define("DapBreakpoint", {
text = "", -- nerdfonts icon here
texthl = "DapCustomBreakpoint",
linehl = "DapCustomBreakpointLine",
numhl = "DapBreakpoint",
})
vim.fn.sign_define("DapStopped", {
text = "->", -- nerdfonts icon here TODO:: add a different icon depending on my nerd font
texthl = "",
linehl = "DapCustomHighlight",
numhl = "DapBreakpoint",
})
dap.configurations.c = {
{
name = "Launch",
type = "gdb",
request = "launch",
program = function()
return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file")
end,
cwd = "${workspaceFolder}",
stopAtBeginningOfMainSubprogram = false,
console = "externalTerminal",
},
{
name = "Select and attach to process",
type = "gdb",
request = "attach",
program = function()
return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file")
end,
pid = function()
local name = vim.fn.input("Executable name (filter): ")
return require("dap.utils").pick_process({ filter = name })
end,
cwd = "${workspaceFolder}",
},
{
name = "Attach to gdbserver :1234",
type = "gdb",
request = "attach",
target = "localhost:1234",
program = function()
return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file")
end,
cwd = "${workspaceFolder}",
},
}
dap.configurations.cpp = dap.configurations.c
vim.keymap.set("n", "<Leader>b", function()
require("dap").toggle_breakpoint()
end, { desc = "DAP-UI: toggle [B]reakpoint" })
vim.keymap.set("n", "<Leader>ev", function()
require("dapui").eval(nil, { enter = true })
end, { desc = "DAP-UI: [E][v]aluate line" })
-- vim.keymap.set("n", "<Leader>df", function()
-- local widgets = require("dap.ui.widgets")
-- widgets.centered_float(widgets.frames)
-- end)
-- vim.keymap.set("n", "<Leader>dr", function()
-- require("dap").repl.open()
-- -- Set up autocmd for terminal mode to handle color properly
-- vim.cmd([[
-- autocmd TermOpen * setlocal nonumber norelativenumber | startinsert
-- ]])
-- end)
vim.keymap.set("n", "<F5>", function()
require("dap").continue()
end, { desc = "DAP-UI: [F5] continue" })
vim.keymap.set("n", "<F10>", function()
require("dap").step_over()
end, { desc = "DAP-UI: [F10] step over" })
vim.keymap.set("n", "<F11>", function()
require("dap").step_into()
end, { desc = "DAP-UI: [F11] step into" })
vim.keymap.set("n", "<F12>", function()
require("dap").step_out()
end, { desc = "DAP-UI: [F12] step out" })
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
vim.keymap.set("n", "<Leader>df", function()
require("dapui").toggle()
end, { desc = "DAP-UI: Toggle Debug Window" })
end,
}
+82
View File
@@ -0,0 +1,82 @@
return {
"mfussenegger/nvim-dap",
dependencies = {
-- Creates a beautiful debugger UI
"rcarriga/nvim-dap-ui",
"nvim-neotest/nvim-nio",
-- Installs the debug adapters for you
"williamboman/mason.nvim",
"jay-babu/mason-nvim-dap.nvim",
-- Add your own debuggers here
"leoluz/nvim-dap-go",
"mfussenegger/nvim-dap-python",
},
config = function()
local dap = require("dap")
local dapui = require("dapui")
require("mason-nvim-dap").setup({
-- Makes a best effort to setup the various debuggers with
-- reasonable debug configurations
automatic_setup = true,
automatic_installation = true,
-- You can provide additional configuration to the handlers,
-- see mason-nvim-dap README for more information
handlers = {},
-- You'll need to check that you have the required things installed
-- online, please don't ask me how to install them :)
ensure_installed = {
-- Update this to ensure that you have the debuggers for the langs you want
-- 'delve',
"debugpy",
},
})
-- Basic debugging keymaps, feel free to change to your liking!
vim.keymap.set("n", "<F5>", dap.continue, { desc = "Debug: Start/Continue" })
vim.keymap.set("n", "<F1>", dap.step_into, { desc = "Debug: Step Into" })
vim.keymap.set("n", "<F2>", dap.step_over, { desc = "Debug: Step Over" })
vim.keymap.set("n", "<F3>", dap.step_out, { desc = "Debug: Step Out" })
vim.keymap.set("n", "<leader>b", dap.toggle_breakpoint, { desc = "Debug: Toggle Breakpoint" })
vim.keymap.set("n", "<leader>B", function()
dap.set_breakpoint(vim.fn.input("Breakpoint condition: "))
end, { desc = "Debug: Set Breakpoint" })
-- Dap UI setup
-- For more information, see |:help nvim-dap-ui|
dapui.setup({
-- Set icons to characters that are more likely to work in every terminal.
-- Feel free to remove or use ones that you like more! :)
-- Don't feel like these are good choices.
icons = { expanded = "", collapsed = "", current_frame = "*" },
controls = {
icons = {
pause = "",
play = "",
step_into = "",
step_over = "",
step_out = "",
step_back = "b",
run_last = "▶▶",
terminate = "",
disconnect = "",
},
},
})
-- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception.
vim.keymap.set("n", "<F7>", dapui.toggle, { desc = "Debug: See last session result." })
dap.listeners.after.event_initialized["dapui_config"] = dapui.open
dap.listeners.before.event_terminated["dapui_config"] = dapui.close
dap.listeners.before.event_exited["dapui_config"] = dapui.close
-- Install golang specific config
-- require('dap-go').setup()
require("dap-python").setup()
end,
}
+20
View File
@@ -0,0 +1,20 @@
return -- lazydocker.nvim
{
"mgierada/lazydocker.nvim",
dependencies = { "akinsho/toggleterm.nvim" },
config = function()
require("lazydocker").setup({
border = "curved", -- valid options are "single" | "double" | "shadow" | "curved"
})
end,
event = "BufRead",
keys = {
{
"<leader>ld",
function()
require("lazydocker").open()
end,
desc = "Open Lazydocker floating window",
},
},
}
@@ -0,0 +1,7 @@
return {
"dart-lang/dart-vim-plugin",
config = function()
vim.g.dart_html_in_string = true
vim.g.dart_format_on_save = true
end,
}
@@ -0,0 +1,51 @@
return {
"nvim-flutter/flutter-tools.nvim",
lazy = false,
dependencies = {
"nvim-lua/plenary.nvim",
-- "stevearc/dressing.nvim", -- optional for vim.ui.select
},
config = function()
require("flutter-tools").setup({
-- (uncomment below line for windows only)
-- flutter_path = "home/flutter/bin/flutter.bat",
flutter_path = "/home/llinde/development/flutter/bin/flutter", -- <-- this takes priority over the lookup
-- flutter_lookup_cmd = "dirname $(which flutter)", -- example "dirname $(which flutter)" or "asdf where flutter"
-- lsp = {
-- cmd = { "/usr/lib/flutter/bin/cache/dart-sdk/bin/dart", "language-server", "--protocol=lsp" },
-- },
debugger = {
-- make these two params true to enable debug mode
enabled = true,
run_via_dap = true,
register_configurations = function(_)
require("dap").adapters.dart = {
type = "executable",
command = vim.fn.stdpath("data") .. "/mason/bin/dart-debug-adapter",
args = { "flutter" },
}
require("dap").configurations.dart = {
{
type = "dart",
request = "launch",
name = "Launch flutter",
dartSdkPath = "home/flutter/bin/cache/dart-sdk/",
flutterSdkPath = "home/flutter",
program = "${workspaceFolder}/lib/main.dart",
cwd = "${workspaceFolder}",
},
}
-- uncomment below line if you've launch.json file already in your vscode setup
-- require("dap.ext.vscode").load_launchjs()
end,
},
dev_log = {
-- toggle it when you run without DAP
enabled = false,
open_cmd = "tabedit",
},
})
end,
}
+21
View File
@@ -0,0 +1,21 @@
-- Adds git related signs to the gutter, as well as utilities for managing changes
return {
"lewis6991/gitsigns.nvim",
opts = {
-- See `:help gitsigns.txt`
signs = {
add = { text = "+" },
change = { text = "~" },
delete = { text = "_" },
topdelete = { text = "" },
changedelete = { text = "~" },
},
signs_staged = {
add = { text = "+" },
change = { text = "~" },
delete = { text = "_" },
topdelete = { text = "" },
changedelete = { text = "~" },
},
},
}
+67
View File
@@ -0,0 +1,67 @@
return {
"ThePrimeagen/harpoon",
branch = "harpoon2",
dependencies = { "nvim-lua/plenary.nvim" },
config = function()
local harpoon = require("harpoon")
harpoon:setup({})
-- -- Use Telescope as a UI
-- local conf = require('telescope.config').values
-- local function toggle_telescope(harpoon_files)
-- local file_paths = {}
-- for _, item in ipairs(harpoon_files.items) do
-- table.insert(file_paths, item.value)
-- end
--
-- require('telescope.pickers')
-- .new({}, {
-- prompt_title = 'Harpoon',
-- finder = require('telescope.finders').new_table {
-- results = file_paths,
-- },
-- previewer = conf.file_previewer {},
-- sorter = conf.generic_sorter {},
-- })
-- :find()
-- end
--
-- vim.keymap.set('n', '<leader>M', function()
-- toggle_telescope(harpoon:list())
-- end, { desc = 'Open harpoon window' })
-- Default UI
vim.keymap.set("n", "<leader>M", function()
harpoon.ui:toggle_quick_menu(harpoon:list())
end)
vim.keymap.set("n", "<leader>m", function()
harpoon:list():add()
end)
vim.keymap.set("n", "<leader>1", function()
harpoon:list():select(1)
end)
vim.keymap.set("n", "<leader>2", function()
harpoon:list():select(2)
end)
vim.keymap.set("n", "<leader>3", function()
harpoon:list():select(3)
end)
vim.keymap.set("n", "<leader>4", function()
harpoon:list():select(4)
end)
-- Toggle previous & next buffers stored within Harpoon list
vim.keymap.set("n", "<leader>p", function()
harpoon:list():prev()
end)
vim.keymap.set("n", "<leader>n", function()
harpoon:list():next()
end)
end,
}
+25
View File
@@ -0,0 +1,25 @@
return {
"lukas-reineke/indent-blankline.nvim",
main = "ibl",
opts = {
indent = {
char = "",
},
scope = {
show_start = false,
show_end = false,
show_exact_scope = false,
},
exclude = {
filetypes = {
"help",
"startify",
"dashboard",
"packer",
"neogitstatus",
"NvimTree",
"Trouble",
},
},
},
}
+10
View File
@@ -0,0 +1,10 @@
return {
"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_compiler_method = 'latexmk'
vim.g.vimtex_view_method = "zathura"
end
}
+33
View File
@@ -0,0 +1,33 @@
return {
"kdheepak/lazygit.nvim",
cmd = {
"LazyGit",
"LazyGitConfig",
"LazyGitCurrentFile",
"LazyGitFilter",
"LazyGitFilterCurrentFile",
},
-- optional for floating window border decoration
dependencies = {
"nvim-lua/plenary.nvim",
},
-- setting the keybinding for LazyGit with 'keys' is recommended in
-- order to load the plugin when the command is run for the first time
keys = {
-- Run LazyGit command and set background to transparent
{
"<leader>lg",
"<cmd>LazyGit<cr><cmd>hi LazyGitFloat guibg=NONE guifg=NONE<cr><cmd>setlocal winhl=NormalFloat:LazyGitFloat<cr>",
desc = "LazyGit",
},
},
config = function()
vim.g.lazygit_floating_window_winblend = 0 -- transparency of floating window (0-100)
vim.g.lazygit_floating_window_scaling_factor = 0.9 -- scaling factor for floating window
vim.g.lazygit_floating_window_border_chars = { "", "", "", "", "", "", "", "" } -- customize lazygit popup window border characters
vim.g.lazygit_floating_window_use_plenary = 0 -- use plenary.nvim to manage floating window if available
vim.g.lazygit_use_neovim_remote = 1 -- fallback to 0 if neovim-remote is not installed
vim.g.lazygit_use_custom_config_file_path = 0 -- config file path is evaluated if this value is 1
vim.g.lazygit_config_file_path = {} -- table of custom config file paths
end,
}
+292
View File
@@ -0,0 +1,292 @@
return { -- LSP Configuration & Plugins
"neovim/nvim-lspconfig",
dependencies = {
-- Automatically install LSPs and related tools to stdpath for neovim
"williamboman/mason.nvim",
"williamboman/mason-lspconfig.nvim",
"WhoIsSethDaniel/mason-tool-installer.nvim",
"hrsh7th/nvim-cmp", -- Completion plugin
"hrsh7th/cmp-nvim-lsp", -- LSP source for nvim-cmp
"simrat39/rust-tools.nvim",
-- Useful status updates for LSP.
-- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})`
{
"j-hui/fidget.nvim",
tag = "v1.4.0",
opts = {
progress = {
display = {
done_icon = "", -- Icon shown when all LSP progress tasks are complete
},
},
notification = {
window = {
winblend = 0, -- Background color opacity in the notification window
},
},
},
},
},
config = function()
vim.api.nvim_create_autocmd("LspAttach", {
group = vim.api.nvim_create_augroup("lsp-attach", { clear = true }),
-- Create a function that lets us more easily define mappings specific LSP related items.
-- It sets the mode, buffer and description for us each time.
callback = function(event)
local map = function(keys, func, desc)
vim.keymap.set("n", keys, func, { buffer = event.buf, desc = "LSP: " .. desc })
end
-- check if gl and ge work
-- Show diagnostics for the line under the cursor
map("gl", function()
vim.diagnostic.open_float(nil, { scope = "line" })
end, "[G]oto [L]ine Diagnostics")
-- Show diagnostics for the current buffer
map("ge", require("telescope.builtin").diagnostics, "[G]oto [E]rrors")
-- Jump to the definition of the word under your cursor.
-- This is where a variable was first declared, or where a function is defined, etc.
-- To jump back, press <C-T>.
map("gd", require("telescope.builtin").lsp_definitions, "[G]oto [D]efinition")
-- Find references for the word under your cursor.
map("gr", require("telescope.builtin").lsp_references, "[G]oto [R]eferences")
-- Jump to the implementation of the word under your cursor.
-- Useful when your language has ways of declaring types without an actual implementation.
map("gI", require("telescope.builtin").lsp_implementations, "[G]oto [I]mplementation")
-- Jump to the type of the word under your cursor.
-- Useful when you're not sure what type a variable is and you want to see
-- the definition of its *type*, not where it was *defined*.
map("<leader>D", require("telescope.builtin").lsp_type_definitions, "Type [D]efinition")
-- Fuzzy find all the symbols in your current document.
-- Symbols are things like variables, functions, types, etc.
map("<leader>ds", require("telescope.builtin").lsp_document_symbols, "[D]ocument [S]ymbols")
-- Fuzzy find all the symbols in your current workspace
-- Similar to document symbols, except searches over your whole project.
map("<leader>ws", require("telescope.builtin").lsp_dynamic_workspace_symbols, "[W]orkspace [S]ymbols")
-- Rename the variable under your cursor
-- Most Language Servers support renaming across files, etc.
map("<leader>rn", vim.lsp.buf.rename, "[R]e[n]ame")
-- Execute a code action, usually your cursor needs to be on top of an error
-- or a suggestion from your LSP for this to activate.
map("<leader>ca", vim.lsp.buf.code_action, "[C]ode [A]ction")
-- Opens a popup that displays documentation about the word under your cursor
-- See `:help K` for why this keymap
map("K", vim.lsp.buf.hover, "Hover Documentation")
-- WARN: This is not Goto Definition, this is Goto Declaration.
-- For example, in C this would take you to the header
map("gD", vim.lsp.buf.declaration, "[G]oto [D]eclaration")
map("<leader>wa", vim.lsp.buf.add_workspace_folder, "[W]orkspace [A]dd Folder")
map("<leader>wr", vim.lsp.buf.remove_workspace_folder, "[W]orkspace [R]emove Folder")
map("<leader>wl", function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end, "[W]orkspace [L]ist Folders")
-- The following two autocommands are used to highlight references of the
-- word under your cursor when your cursor rests there for a little while.
-- See `:help CursorHold` for information about when this is executed
--
-- When you move your cursor, the highlights will be cleared (the second autocommand).
local client = vim.lsp.get_client_by_id(event.data.client_id)
if client and client.server_capabilities.documentHighlightProvider then
vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, {
buffer = event.buf,
callback = vim.lsp.buf.document_highlight,
})
vim.api.nvim_create_autocmd({ "CursorMoved", "CursorMovedI" }, {
buffer = event.buf,
callback = vim.lsp.buf.clear_references,
})
end
end,
})
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = vim.tbl_deep_extend("force", capabilities, require("cmp_nvim_lsp").default_capabilities())
local lspconfig = require("lspconfig")
-- Enable the following language servers
local servers = {
html = { filetypes = { "html", "twig", "hbs" } },
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
ts_ls = {},
lua_ls = {
-- cmd = {...},
-- filetypes { ...},
-- capabilities = {},
settings = {
Lua = {
runtime = { version = "LuaJIT" },
workspace = {
checkThirdParty = false,
-- Tells lua_ls where to find all the Lua files that you have loaded
-- for your neovim configuration.
library = {
"${3rd}/luv/library",
unpack(vim.api.nvim_get_runtime_file("", true)),
},
-- If lua_ls is really slow on your computer, you can try this instead:
-- library = { vim.env.VIMRUNTIME },
},
completion = {
callSnippet = "Replace",
},
telemetry = { enable = false },
diagnostics = { disable = { "missing-fields" } },
},
},
},
-- dcm = {},
dockerls = {},
docker_compose_language_service = {},
pylsp = {
settings = {
pylsp = {
plugins = {
pyflakes = { enabled = false },
pycodestyle = { enabled = false },
autopep8 = { enabled = false },
yapf = { enabled = false },
mccabe = { enabled = false },
pylsp_mypy = { enabled = false },
pylsp_black = { enabled = false },
pylsp_isort = { enabled = false },
},
},
},
},
-- basedpyright = {
-- -- Config options: https://github.com/DetachHead/basedpyright/blob/main/docs/settings.md
-- settings = {
-- basedpyright = {
-- disableOrganizeImports = true, -- Using Ruff's import organizer
-- disableLanguageServices = false,
-- analysis = {
-- ignore = { '*' }, -- Ignore all files for analysis to exclusively use Ruff for linting
-- typeCheckingMode = 'off',
-- diagnosticMode = 'openFilesOnly', -- Only analyze open files
-- useLibraryCodeForTypes = true,
-- autoImportCompletions = true, -- whether pyright offers auto-import completions
-- },
-- },
-- },
-- },
clangd = {
cmd = {
"clangd",
"--background-index",
"--clang-tidy",
"--header-insertion=iwyu",
"--completion-style=detailed",
"--function-arg-placeholders",
"--fallback-style=llvm",
},
filetypes = { "c", "cpp", "objc", "objcpp", "hpp" },
},
ruff = {
-- Notes on code actions: https://github.com/astral-sh/ruff-lsp/issues/119#issuecomment-1595628355
-- Get isort like behavior: https://github.com/astral-sh/ruff/issues/8926#issuecomment-1834048218
commands = {
RuffAutofix = {
function()
vim.lsp.buf.execute_command({
command = "ruff.applyAutofix",
arguments = {
{ uri = vim.uri_from_bufnr(0) },
},
})
end,
description = "Ruff: Fix all auto-fixable problems",
},
RuffOrganizeImports = {
function()
vim.lsp.buf.execute_command({
command = "ruff.applyOrganizeImports",
arguments = {
{ uri = vim.uri_from_bufnr(0) },
},
})
end,
description = "Ruff: Format imports",
},
},
},
rust_analyzer = {
["rust-analyzer"] = {
cargo = {
features = "all",
},
checkOnSave = true,
check = {
command = "clippy",
},
},
},
tailwindcss = {},
jsonls = {},
sqlls = {},
terraformls = {},
yamlls = {},
bashls = {},
graphql = {},
cssls = {},
ltex = {
language = "de-DE",
},
texlab = {},
-- Java Language Server configuration
jdtls = {},
}
-- Ensure the servers and tools above are installed
require("mason").setup()
-- You can add other tools here that you want Mason to install
-- for you, so that they are available from within Neovim.
local ensure_installed = vim.tbl_keys(servers or {})
vim.list_extend(ensure_installed, {
"stylua", -- Used to format lua code
})
require("mason-tool-installer").setup({ ensure_installed = ensure_installed })
require("mason-lspconfig").setup({
handlers = {
function(server_name)
local server = servers[server_name] or {}
-- This handles overriding only values explicitly passed
-- by the server configuration above. Useful when disabling
-- certain features of an LSP (for example, turning off formatting for tsserver)
server.capabilities = vim.tbl_deep_extend("force", {}, capabilities, server.capabilities or {})
require("lspconfig")[server_name].setup(server)
end,
},
})
local rt = require("rust-tools")
rt.setup({
server = {
on_attach = function(_, bufnr)
-- Hover actions
vim.keymap.set("n", "<C-space>", rt.hover_actions.hover_actions, { buffer = bufnr })
-- Code action groups
vim.keymap.set("n", "<Leader>a", rt.code_action_group.code_action_group, { buffer = bufnr })
end,
},
})
end,
}
+116
View File
@@ -0,0 +1,116 @@
-- Set lualine as statusline
return {
'nvim-lualine/lualine.nvim',
config = function()
-- Adapted from: https://github.com/nvim-lualine/lualine.nvim/blob/master/lua/lualine/themes/onedark.lua
local colors = {
blue = '#61afef',
green = '#98c379',
purple = '#c678dd',
cyan = '#56b6c2',
red1 = '#e06c75',
red2 = '#be5046',
yellow = '#e5c07b',
fg = '#abb2bf',
bg = '#282c34',
gray1 = '#828997',
gray2 = '#2c323c',
gray3 = '#3e4452',
}
local onedark_theme = {
normal = {
a = { fg = colors.bg, bg = colors.green, gui = 'bold' },
b = { fg = colors.fg, bg = colors.gray3 },
c = { fg = colors.fg, bg = colors.gray2 },
},
command = { a = { fg = colors.bg, bg = colors.yellow, gui = 'bold' } },
insert = { a = { fg = colors.bg, bg = colors.blue, gui = 'bold' } },
visual = { a = { fg = colors.bg, bg = colors.purple, gui = 'bold' } },
terminal = { a = { fg = colors.bg, bg = colors.cyan, gui = 'bold' } },
replace = { a = { fg = colors.bg, bg = colors.red1, gui = 'bold' } },
inactive = {
a = { fg = colors.gray1, bg = colors.bg, gui = 'bold' },
b = { fg = colors.gray1, bg = colors.bg },
c = { fg = colors.gray1, bg = colors.gray2 },
},
}
-- Import color theme based on environment variable NVIM_THEME
local env_var_nvim_theme = os.getenv 'NVIM_THEME' or 'nord'
-- Define a table of themes
local themes = {
onedark = onedark_theme,
nord = 'nord',
}
local mode = {
'mode',
fmt = function(str)
-- return ' ' .. str:sub(1, 1) -- displays only the first character of the mode
return '' .. str
end,
}
local filename = {
'filename',
file_status = true, -- displays file status (readonly status, modified status)
path = 0, -- 0 = just filename, 1 = relative path, 2 = absolute path
}
local hide_in_width = function()
return vim.fn.winwidth(0) > 100
end
local diagnostics = {
'diagnostics',
sources = { 'nvim_diagnostic' },
sections = { 'error', 'warn' },
symbols = { error = '', warn = '', info = '', hint = '' },
colored = false,
update_in_insert = false,
always_visible = false,
cond = hide_in_width,
}
local diff = {
'diff',
colored = false,
symbols = { added = '', modified = '', removed = '' }, -- changes diff symbols
cond = hide_in_width,
}
require('lualine').setup {
options = {
icons_enabled = true,
theme = themes[env_var_nvim_theme], -- Set theme based on environment variable
-- Some useful glyphs:
-- https://www.nerdfonts.com/cheat-sheet
--        
section_separators = { left = '', right = '' },
component_separators = { left = '', right = '' },
disabled_filetypes = { 'alpha', 'neo-tree', 'Avante' },
always_divide_middle = true,
},
sections = {
lualine_a = { mode },
lualine_b = { 'branch' },
lualine_c = { filename },
lualine_x = { diagnostics, diff, { 'encoding', cond = hide_in_width }, { 'filetype', cond = hide_in_width } },
lualine_y = { 'location' },
lualine_z = { 'progress' },
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = { { 'filename', path = 1 } },
lualine_x = { { 'location', padding = 0 } },
lualine_y = {},
lualine_z = {},
},
tabline = {},
extensions = { 'fugitive' },
}
end,
}
+62
View File
@@ -0,0 +1,62 @@
-- Standalone plugins with less than 10 lines of config go here
return {
{
-- tmux & split window navigation
"christoomey/vim-tmux-navigator",
},
{
-- autoclose tags
"windwp/nvim-ts-autotag",
},
{
-- detect tabstop and shiftwidth automatically
"tpope/vim-sleuth",
},
{
-- Powerful Git integration for Vim
"tpope/vim-fugitive",
},
{
-- GitHub integration for vim-fugitive
"tpope/vim-rhubarb",
},
{
-- Hints keybinds
"folke/which-key.nvim",
opts = {
-- win = {
-- border = {
-- { '┌', 'FloatBorder' },
-- { '─', 'FloatBorder' },
-- { '┐', 'FloatBorder' },
-- { '│', 'FloatBorder' },
-- { '┘', 'FloatBorder' },
-- { '─', 'FloatBorder' },
-- { '└', 'FloatBorder' },
-- { '│', 'FloatBorder' },
-- },
-- },
},
},
{
-- Autoclose parentheses, brackets, quotes, etc.
"windwp/nvim-autopairs",
event = "InsertEnter",
config = true,
opts = {},
},
{
-- Highlight todo, notes, etc in comments
"folke/todo-comments.nvim",
event = "VimEnter",
dependencies = { "nvim-lua/plenary.nvim" },
opts = { signs = false },
},
{
-- high-performance color highlighter
"norcalli/nvim-colorizer.lua",
config = function()
require("colorizer").setup()
end,
},
}
+327
View File
@@ -0,0 +1,327 @@
return {
"nvim-neo-tree/neo-tree.nvim",
branch = "v3.x",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
"MunifTanjim/nui.nvim",
-- "3rd/image.nvim", -- Optional image support in preview window: See `# Preview Mode` for more information
{
's1n7ax/nvim-window-picker',
version = '2.*',
config = function()
require 'window-picker'.setup({
filter_rules = {
include_current_win = false,
autoselect_one = true,
-- filter using buffer options
bo = {
-- if the file type is one of following, the window will be ignored
filetype = { 'neo-tree', "neo-tree-popup", "notify" },
-- if the buffer type is one of following, the window will be ignored
buftype = { 'terminal', "quickfix" },
},
},
})
end,
},
},
config = function ()
-- If you want icons for diagnostic errors, you'll need to define them somewhere:
vim.fn.sign_define("DiagnosticSignError",
{text = "", texthl = "DiagnosticSignError"})
vim.fn.sign_define("DiagnosticSignWarn",
{text = "", texthl = "DiagnosticSignWarn"})
vim.fn.sign_define("DiagnosticSignInfo",
{text = "", texthl = "DiagnosticSignInfo"})
vim.fn.sign_define("DiagnosticSignHint",
{text = "󰌵", texthl = "DiagnosticSignHint"})
require("neo-tree").setup({
close_if_last_window = false, -- Close Neo-tree if it is the last window left in the tab
popup_border_style = "rounded",
enable_git_status = true,
enable_diagnostics = true,
open_files_do_not_replace_types = { "terminal", "trouble", "qf" }, -- when opening files, do not use windows containing these filetypes or buftypes
sort_case_insensitive = false, -- used when sorting files and directories in the tree
sort_function = nil , -- use a custom function for sorting files and directories in the tree
-- sort_function = function (a,b)
-- if a.type == b.type then
-- return a.path > b.path
-- else
-- return a.type > b.type
-- end
-- end , -- this sorts files and directories descendantly
default_component_configs = {
container = {
enable_character_fade = true
},
indent = {
indent_size = 2,
padding = 1, -- extra padding on left hand side
-- indent guides
with_markers = true,
indent_marker = "",
last_indent_marker = "",
highlight = "NeoTreeIndentMarker",
-- expander config, needed for nesting files
with_expanders = nil, -- if nil and file nesting is enabled, will enable expanders
expander_collapsed = "",
expander_expanded = "",
expander_highlight = "NeoTreeExpander",
},
icon = {
folder_closed = "",
folder_open = "",
folder_empty = "󰜌",
provider = function(icon, node, state) -- default icon provider utilizes nvim-web-devicons if available
if node.type == "file" or node.type == "terminal" then
local success, web_devicons = pcall(require, "nvim-web-devicons")
local name = node.type == "terminal" and "terminal" or node.name
if success then
local devicon, hl = web_devicons.get_icon(name)
icon.text = devicon or icon.text
icon.highlight = hl or icon.highlight
end
end
end,
-- The next two settings are only a fallback, if you use nvim-web-devicons and configure default icons there
-- then these will never be used.
default = "*",
highlight = "NeoTreeFileIcon"
},
modified = {
symbol = "[+]",
highlight = "NeoTreeModified",
},
name = {
trailing_slash = false,
use_git_status_colors = true,
highlight = "NeoTreeFileName",
},
git_status = {
symbols = {
-- Change type
added = "", -- or "✚", but this is redundant info if you use git_status_colors on the name
modified = "", -- or "", but this is redundant info if you use git_status_colors on the name
deleted = "",-- this can only be used in the git_status source
renamed = "󰁕",-- this can only be used in the git_status source
-- Status type
untracked = "",
ignored = "",
unstaged = "󰄱",
staged = "",
conflict = "",
}
},
-- If you don't want to use these columns, you can set `enabled = false` for each of them individually
file_size = {
enabled = true,
required_width = 64, -- min width of window required to show this column
},
type = {
enabled = true,
required_width = 122, -- min width of window required to show this column
},
last_modified = {
enabled = true,
required_width = 88, -- min width of window required to show this column
},
created = {
enabled = true,
required_width = 110, -- min width of window required to show this column
},
symlink_target = {
enabled = false,
},
},
-- A list of functions, each representing a global custom command
-- that will be available in all sources (if not overridden in `opts[source_name].commands`)
-- see `:h neo-tree-custom-commands-global`
commands = {},
window = {
position = "left",
width = 40,
mapping_options = {
noremap = true,
nowait = true,
},
mappings = {
["<space>"] = {
"toggle_node",
nowait = false, -- disable `nowait` if you have existing combos starting with this char that you want to use
},
["<2-LeftMouse>"] = "open",
["<cr>"] = "open",
["<esc>"] = "cancel", -- close preview or floating neo-tree window
["P"] = { "toggle_preview", config = { use_float = true, use_image_nvim = true } },
-- Read `# Preview Mode` for more information
["l"] = "focus_preview",
["S"] = "open_split",
["s"] = "open_vsplit",
-- ["S"] = "split_with_window_picker",
-- ["s"] = "vsplit_with_window_picker",
["t"] = "open_tabnew",
-- ["<cr>"] = "open_drop",
-- ["t"] = "open_tab_drop",
["w"] = "open_with_window_picker",
--["P"] = "toggle_preview", -- enter preview mode, which shows the current node without focusing
["C"] = "close_node",
-- ['C'] = 'close_all_subnodes',
["z"] = "close_all_nodes",
--["Z"] = "expand_all_nodes",
["a"] = {
"add",
-- this command supports BASH style brace expansion ("x{a,b,c}" -> xa,xb,xc). see `:h neo-tree-file-actions` for details
-- some commands may take optional config options, see `:h neo-tree-mappings` for details
config = {
show_path = "none" -- "none", "relative", "absolute"
}
},
["A"] = "add_directory", -- also accepts the optional config.show_path option like "add". this also supports BASH style brace expansion.
["d"] = "delete",
["r"] = "rename",
["y"] = "copy_to_clipboard",
["x"] = "cut_to_clipboard",
["p"] = "paste_from_clipboard",
["c"] = "copy", -- takes text input for destination, also accepts the optional config.show_path option like "add":
-- ["c"] = {
-- "copy",
-- config = {
-- show_path = "none" -- "none", "relative", "absolute"
-- }
--}
["m"] = "move", -- takes text input for destination, also accepts the optional config.show_path option like "add".
["q"] = "close_window",
["R"] = "refresh",
["?"] = "show_help",
["<"] = "prev_source",
[">"] = "next_source",
["i"] = "show_file_details",
}
},
nesting_rules = {},
filesystem = {
filtered_items = {
visible = false, -- when true, they will just be displayed differently than normal items
hide_dotfiles = true,
hide_gitignored = true,
hide_hidden = true, -- only works on Windows for hidden files/directories
hide_by_name = {
--"node_modules"
},
hide_by_pattern = { -- uses glob style patterns
--"*.meta",
--"*/src/*/tsconfig.json",
},
always_show = { -- remains visible even if other settings would normally hide it
--".gitignored",
},
always_show_by_pattern = { -- uses glob style patterns
--".env*",
},
never_show = { -- remains hidden even if visible is toggled to true, this overrides always_show
--".DS_Store",
--"thumbs.db"
},
never_show_by_pattern = { -- uses glob style patterns
--".null-ls_*",
},
},
follow_current_file = {
enabled = false, -- This will find and focus the file in the active buffer every time
-- -- the current file is changed while the tree is open.
leave_dirs_open = false, -- `false` closes auto expanded dirs, such as with `:Neotree reveal`
},
group_empty_dirs = false, -- when true, empty folders will be grouped together
hijack_netrw_behavior = "open_default", -- netrw disabled, opening a directory opens neo-tree
-- in whatever position is specified in window.position
-- "open_current", -- netrw disabled, opening a directory opens within the
-- window like netrw would, regardless of window.position
-- "disabled", -- netrw left alone, neo-tree does not handle opening dirs
use_libuv_file_watcher = false, -- This will use the OS level file watchers to detect changes
-- instead of relying on nvim autocmd events.
window = {
mappings = {
["<bs>"] = "navigate_up",
["."] = "set_root",
["H"] = "toggle_hidden",
["/"] = "fuzzy_finder",
["D"] = "fuzzy_finder_directory",
["#"] = "fuzzy_sorter", -- fuzzy sorting using the fzy algorithm
-- ["D"] = "fuzzy_sorter_directory",
["f"] = "filter_on_submit",
["<c-x>"] = "clear_filter",
["[g"] = "prev_git_modified",
["]g"] = "next_git_modified",
["o"] = { "show_help", nowait=false, config = { title = "Order by", prefix_key = "o" }},
["oc"] = { "order_by_created", nowait = false },
["od"] = { "order_by_diagnostics", nowait = false },
["og"] = { "order_by_git_status", nowait = false },
["om"] = { "order_by_modified", nowait = false },
["on"] = { "order_by_name", nowait = false },
["os"] = { "order_by_size", nowait = false },
["ot"] = { "order_by_type", nowait = false },
-- ['<key>'] = function(state) ... end,
},
fuzzy_finder_mappings = { -- define keymaps for filter popup window in fuzzy_finder_mode
["<down>"] = "move_cursor_down",
["<C-n>"] = "move_cursor_down",
["<up>"] = "move_cursor_up",
["<C-p>"] = "move_cursor_up",
-- ['<key>'] = function(state, scroll_padding) ... end,
},
},
commands = {} -- Add a custom command or override a global one using the same function name
},
buffers = {
follow_current_file = {
enabled = true, -- This will find and focus the file in the active buffer every time
-- -- the current file is changed while the tree is open.
leave_dirs_open = false, -- `false` closes auto expanded dirs, such as with `:Neotree reveal`
},
group_empty_dirs = true, -- when true, empty folders will be grouped together
show_unloaded = true,
window = {
mappings = {
["bd"] = "buffer_delete",
["<bs>"] = "navigate_up",
["."] = "set_root",
["o"] = { "show_help", nowait=false, config = { title = "Order by", prefix_key = "o" }},
["oc"] = { "order_by_created", nowait = false },
["od"] = { "order_by_diagnostics", nowait = false },
["om"] = { "order_by_modified", nowait = false },
["on"] = { "order_by_name", nowait = false },
["os"] = { "order_by_size", nowait = false },
["ot"] = { "order_by_type", nowait = false },
}
},
},
git_status = {
window = {
position = "float",
mappings = {
["A"] = "git_add_all",
["gu"] = "git_unstage_file",
["ga"] = "git_add_file",
["gr"] = "git_revert_file",
["gc"] = "git_commit",
["gp"] = "git_push",
["gg"] = "git_commit_and_push",
["o"] = { "show_help", nowait=false, config = { title = "Order by", prefix_key = "o" }},
["oc"] = { "order_by_created", nowait = false },
["od"] = { "order_by_diagnostics", nowait = false },
["om"] = { "order_by_modified", nowait = false },
["on"] = { "order_by_name", nowait = false },
["os"] = { "order_by_size", nowait = false },
["ot"] = { "order_by_type", nowait = false },
}
}
}
})
vim.cmd([[nnoremap \ :Neotree reveal<cr>]])
vim.keymap.set('n', '<leader>e', ':Neotree toggle position=left<CR>', { noremap = true, silent = true })
end
}
+56
View File
@@ -0,0 +1,56 @@
-- Format on save and linters
return {
"nvimtools/none-ls.nvim",
dependencies = {
"nvimtools/none-ls-extras.nvim",
"jayp0521/mason-null-ls.nvim", -- ensure dependencies are installed
},
config = function()
local null_ls = require("null-ls")
local formatting = null_ls.builtins.formatting -- to setup formatters
local diagnostics = null_ls.builtins.diagnostics -- to setup linters
-- list of formatters & linters for mason to install
require("mason-null-ls").setup({
ensure_installed = {
"checkmake",
"prettier", -- ts/js formatter
"stylua", -- lua formatter
"eslint_d", -- ts/js linter
"shfmt",
"ruff",
},
-- auto-install configured formatters & linters (with null-ls)
automatic_installation = true,
})
local sources = {
diagnostics.checkmake,
formatting.prettier.with({ filetypes = { "html", "json", "yaml", "markdown" } }),
formatting.stylua,
formatting.shfmt.with({ args = { "-i", "4" } }),
formatting.terraform_fmt,
require("none-ls.formatting.ruff").with({ extra_args = { "--extend-select", "I" } }),
require("none-ls.formatting.ruff_format"),
}
local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
null_ls.setup({
-- debug = true, -- Enable debug mode. Inspect logs with :NullLsLog.
sources = sources,
-- you can reuse a shared lspconfig on_attach callback here
on_attach = function(client, bufnr)
if client.supports_method("textDocument/formatting") then
vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
vim.api.nvim_create_autocmd("BufWritePre", {
group = augroup,
buffer = bufnr,
callback = function()
vim.lsp.buf.format({ async = false })
end,
})
end
end,
})
end,
}
+10
View File
@@ -0,0 +1,10 @@
return {
"mfussenegger/nvim-jdtls",
ft = "java",
config = function()
require("jdtls").start_or_attach({
cmd = { "/home/llinde/.local/share/nvim/mason/packages/jdtls/bin/jdtls" },
root_dir = require("jdtls.setup").find_root({ "gradlew", ".git", "mvnw" }),
})
end,
}
+118
View File
@@ -0,0 +1,118 @@
-- Fuzzy Finder (files, lsp, etc)
return {
"nvim-telescope/telescope.nvim",
branch = "0.1.x",
dependencies = {
"nvim-lua/plenary.nvim",
-- Fuzzy Finder Algorithm which requires local dependencies to be built.
-- Only load if `make` is available. Make sure you have the system
-- requirements installed.
{
"nvim-telescope/telescope-fzf-native.nvim",
build = "make",
cond = function()
return vim.fn.executable("make") == 1
end,
},
"nvim-telescope/telescope-ui-select.nvim",
-- Useful for getting pretty icons, but requires a Nerd Font.
"nvim-tree/nvim-web-devicons",
},
config = function()
local telescope = require("telescope")
local actions = require("telescope.actions")
local builtin = require("telescope.builtin")
require("telescope").setup({
defaults = {
mappings = {
i = {
["<C-k>"] = actions.move_selection_previous, -- move to prev result
["<C-j>"] = actions.move_selection_next, -- move to next result
["<C-l>"] = actions.select_default, -- open file
},
n = {
["q"] = actions.close,
},
},
},
pickers = {
find_files = {
file_ignore_patterns = { "node_modules", ".git", ".venv" },
hidden = true,
},
buffers = {
initial_mode = "normal",
sort_lastused = true,
-- sort_mru = true,
mappings = {
n = {
["d"] = actions.delete_buffer,
["l"] = actions.select_default,
},
},
},
},
live_grep = {
file_ignore_patterns = { "node_modules", ".git", ".venv" },
additional_args = function(_)
return { "--hidden" }
end,
},
path_display = {
filename_first = {
reverse_directories = true,
},
},
extensions = {
["ui-select"] = {
require("telescope.themes").get_dropdown(),
},
},
git_files = {
previewer = false,
},
})
-- Enable telescope fzf native, if installed
pcall(require("telescope").load_extension, "fzf")
pcall(require("telescope").load_extension, "ui-select")
require("telescope").load_extension("flutter")
vim.keymap.set("n", "<leader>tf", ":Telescope flutter commands<CR>", { desc = "[T]elescope [F]lutter" })
vim.keymap.set("n", "<leader>?", builtin.oldfiles, { desc = "[?] Find recently opened files" })
vim.keymap.set("n", "<leader>sb", builtin.buffers, { desc = "[S]earch existing [B]uffers" })
vim.keymap.set("n", "<leader>sm", builtin.marks, { desc = "[S]earch [M]arks" })
vim.keymap.set("n", "<leader>gf", builtin.git_files, { desc = "Search [G]it [F]iles" })
vim.keymap.set("n", "<leader>gc", builtin.git_commits, { desc = "Search [G]it [C]ommits" })
vim.keymap.set("n", "<leader>gcf", builtin.git_bcommits, { desc = "Search [G]it [C]ommits for current [F]ile" })
vim.keymap.set("n", "<leader>gb", builtin.git_branches, { desc = "Search [G]it [B]ranches" })
vim.keymap.set("n", "<leader>gs", builtin.git_status, { desc = "Search [G]it [S]tatus (diff view)" })
vim.keymap.set("n", "<leader>sf", builtin.find_files, { desc = "[S]earch [F]iles" })
vim.keymap.set("n", "<leader>sh", builtin.help_tags, { desc = "[S]earch [H]elp" })
vim.keymap.set("n", "<leader>sw", builtin.grep_string, { desc = "[S]earch current [W]ord" })
vim.keymap.set("n", "<leader>sg", builtin.live_grep, { desc = "[S]earch by [G]rep" })
vim.keymap.set("n", "<leader>sd", builtin.diagnostics, { desc = "[S]earch [D]iagnostics" })
vim.keymap.set("n", "<leader>sr", builtin.resume, { desc = "[S]earch [R]resume" })
vim.keymap.set("n", "<leader>s.", builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' })
vim.keymap.set("n", "<leader>sds", function()
builtin.lsp_document_symbols({
symbols = { "Class", "Function", "Method", "Constructor", "Interface", "Module", "Property" },
})
end, { desc = "[S]each LSP document [S]ymbols" })
vim.keymap.set("n", "<leader><leader>", builtin.buffers, { desc = "[ ] Find existing buffers" })
vim.keymap.set("n", "<leader>s/", function()
builtin.live_grep({
grep_open_files = true,
prompt_title = "Live Grep in Open Files",
})
end, { desc = "[S]earch [/] in Open Files" })
vim.keymap.set("n", "<leader>/", function()
-- You can pass additional configuration to telescope to change theme, layout, etc.
builtin.current_buffer_fuzzy_find(require("telescope.themes").get_dropdown({
previewer = false,
}))
end, { desc = "[/] Fuzzily search in current buffer" })
end,
}
+104
View File
@@ -0,0 +1,104 @@
-- Highlight, edit, and navigate code
return {
'nvim-treesitter/nvim-treesitter',
build = ':TSUpdate',
dependencies = {
'nvim-treesitter/nvim-treesitter-textobjects',
},
config = function()
require('nvim-treesitter.configs').setup {
-- Add languages to be installed here that you want installed for treesitter
ensure_installed = {
'lua',
'python',
'javascript',
'typescript',
'vimdoc',
'vim',
'regex',
'sql',
'dockerfile',
'json',
'java',
'go',
'gitignore',
'graphql',
'yaml',
'make',
'cmake',
'markdown',
'markdown_inline',
'bash',
'tsx',
'css',
'html',
'latex',
},
-- Autoinstall languages that are not installed
auto_install = true,
highlight = { enable = true },
indent = { enable = true },
incremental_selection = {
enable = true,
keymaps = {
init_selection = '<c-space>',
node_incremental = '<c-space>',
scope_incremental = '<c-s>',
node_decremental = '<M-space>',
},
},
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
['aa'] = '@parameter.outer',
['ia'] = '@parameter.inner',
['af'] = '@function.outer',
['if'] = '@function.inner',
['ac'] = '@class.outer',
['ic'] = '@class.inner',
},
},
move = {
enable = true,
set_jumps = true, -- whether to set jumps in the jumplist
goto_next_start = {
[']m'] = '@function.outer',
[']]'] = '@class.outer',
},
goto_next_end = {
[']M'] = '@function.outer',
[']['] = '@class.outer',
},
goto_previous_start = {
['[m'] = '@function.outer',
['[['] = '@class.outer',
},
goto_previous_end = {
['[M'] = '@function.outer',
['[]'] = '@class.outer',
},
},
swap = {
enable = true,
swap_next = {
['<leader>a'] = '@parameter.inner',
},
swap_previous = {
['<leader>A'] = '@parameter.inner',
},
},
},
}
-- Register additional file extensions
vim.filetype.add { extension = { tf = 'terraform' } }
vim.filetype.add { extension = { tfvars = 'terraform' } }
vim.filetype.add { extension = { pipeline = 'groovy' } }
vim.filetype.add { extension = { multibranch = 'groovy' } }
end,
}
+217
View File
@@ -0,0 +1,217 @@
// -*- mode: jsonc -*-
{
// "layer": "top", // Waybar at top layer
// "position": "bottom", // Waybar position (top|bottom|left|right)
"height": 30, // Waybar height (to be removed for auto height)
// "width": 1280, // Waybar width
"spacing": 4, // Gaps between modules (4px)
// Choose the order of the modules
"modules-left": [
"hyprland/workspaces",
"custom/media"
],
"modules-center": [
"hyprland/window"
],
"modules-right": [
"mpd",
"pulseaudio",
"network",
"custom/tailscale",
"cpu",
"memory",
"temperature",
"backlight",
"battery",
"clock",
"tray",
"custom/power"
],
// Modules configuration
// "sway/workspaces": {
// "disable-scroll": true,
// "all-outputs": true,
// "warp-on-scroll": false,
// "format": "{name}: {icon}",
// "format-icons": {
// "1": "",
// "2": "",
// "3": "",
// "4": "",
// "5": "",
// "urgent": "",
// "focused": "",
// "default": ""
// }
// },
"keyboard-state": {
"numlock": true,
"capslock": true,
"format": "{name} {icon}",
"format-icons": {
"locked": "",
"unlocked": ""
}
},
"sway/mode": {
"format": "<span style=\"italic\">{}</span>"
},
"sway/scratchpad": {
"format": "{icon} {count}",
"show-empty": false,
"format-icons": ["", ""],
"tooltip": true,
"tooltip-format": "{app}: {title}"
},
"mpd": {
"format": "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) ⸨{songPosition}|{queueLength}⸩ {volume}% ",
"format-disconnected": "Disconnected ",
"format-stopped": "{consumeIcon}{randomIcon}{repeatIcon}{singleIcon}Stopped ",
"unknown-tag": "N/A",
"interval": 5,
"consume-icons": {
"on": " "
},
"random-icons": {
"off": "<span color=\"#f53c3c\"></span> ",
"on": " "
},
"repeat-icons": {
"on": " "
},
"single-icons": {
"on": "1 "
},
"state-icons": {
"paused": "",
"playing": ""
},
"tooltip-format": "MPD (connected)",
"tooltip-format-disconnected": "MPD (disconnected)"
},
"idle_inhibitor": {
"format": "{icon}",
"format-icons": {
"activated": "",
"deactivated": ""
}
},
"tray": {
// "icon-size": 21,
"spacing": 10
},
"clock": {
// "timezone": "America/New_York",
"tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
"format-alt": "{:%Y-%m-%d}"
},
"cpu": {
"format": "{usage}% ",
"tooltip": false
},
"memory": {
"format": "{}% "
},
"temperature": {
// "thermal-zone": 2,
// "hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input",
"critical-threshold": 80,
// "format-critical": "{temperatureC}°C {icon}",
"format": "{temperatureC}°C {icon}",
"format-icons": [""]
},
"backlight": {
// "device": "acpi_video1",
"format": "{percent}% {icon}",
"format-icons": ["", "", "", "", "", "", "", "", ""]
},
"battery": {
"states": {
// "good": 95,
"warning": 30,
"critical": 15
},
"format": "{capacity}% {icon}",
"format-full": "{capacity}% {icon}",
"format-charging": "{capacity}% ",
"format-plugged": "{capacity}% ",
"format-alt": "{time} {icon}",
// "format-good": "", // An empty format will hide the module
// "format-full": "",
"format-icons": ["", "", "", "", ""]
},
"battery#bat2": {
"bat": "BAT2"
},
"power-profiles-daemon": {
"format": "{icon}",
"tooltip-format": "Power profile: {profile}\nDriver: {driver}",
"tooltip": true,
"format-icons": {
"default": "",
"performance": "",
"balanced": "",
"power-saver": ""
}
},
"network": {
// "interface": "wlp2*", // (Optional) To force the use of this interface
"format-wifi": "({signalStrength}%) ",
"format-ethernet": "{ipaddr}/{cidr} 🌐",
"tooltip-format": "{essid} via {gwaddr} 🌐",
"format-linked": "{essid} (No IP) ⛔",
"format-disconnected": "Disconnected ⚠",
"format-alt": "{essid}: {ipaddr}/{cidr}"
},
"pulseaudio": {
// "scroll-step": 1, // %, can be a float
"format": "{volume}% {icon} {format_source}",
"format-bluetooth": "{volume}% {icon} {format_source}",
"format-bluetooth-muted": "🔇 {icon} {format_source}",
"format-muted": "🔇 {format_source}",
"format-source": "{volume}% ",
"format-source-muted": "",
"format-icons": {
"headphone": "",
"hands-free": "",
"headset": "",
"phone": "",
"portable": "",
"car": "",
"default": ["", "", ""]
},
"on-click": "pavucontrol"
},
"custom/media": {
"format": "{icon} {text}",
"return-type": "json",
"max-length": 40,
"format-icons": {
"spotify": "",
"default": "🎜"
},
"escape": true,
"exec": "$HOME/.config/waybar/mediaplayer.py 2> /dev/null" // Script in resources folder
// "exec": "$HOME/.config/waybar/mediaplayer.py --player spotify 2> /dev/null" // Filter player based on name
},
"custom/power": {
"format" : "⏻ ",
"tooltip": false,
"menu": "on-click",
"menu-file": "$HOME/.config/waybar/power_menu.xml", // Menu file in resources folder
"menu-actions": {
"shutdown": "shutdown",
"reboot": "reboot",
"suspend": "systemctl suspend",
"hibernate": "systemctl hibernate"
}
},
"custom/tailscale": {
"format": "{} 󰒍 ",
"exec": "~/.config/waybar/scripts/tailscale_status.sh",
"interval": 30,
"tooltip": true,
"on-click": "/usr/bin/kitty -e bash -c '/usr/bin/tailscale status; echo; echo \"[ENTER] drücken um zu schließen\"; read'"
}
}
+3 -2
View File
@@ -7,7 +7,7 @@ copy() {
dst="$2"
dstfile="$(basename "$src").$DEVICE"
mkdir -p "$dst"
cp "$src" "$dst/$dstfile"
rsync "$src" "$dst/$dstfile"
echo "$src$dst/$dstfile"
}
@@ -16,11 +16,12 @@ copy ~/.config/hypr/hyprland.conf ./Hyprland
#waybar
copy ~/.config/waybar/style.css ./Waybar
copy ~/.config/waybar/config.jsonc ./Waybar
#nvim
copy ~/.config/nvim/init.lua ./Nvim
copy ~/.config/nvim/lazy-lock.json ./Nvim
#cp -rv ~/.config/nvim/lua ./Nvim/lua/
cp -rv ~/.config/nvim/lua ./Nvim/lua
#tmux
#copy ~/.tmux.conf ./Tmux