feat: Sync complete config - Fish, Ghostty, Neovim Scratch
- Add missing Fish configs (direnv, ssh function) - Add Tokyo Night theme for Ghostty - Complete Neovim scratch config sync - Rewrite install.sh for new structure - Add comprehensive README.md
This commit is contained in:
50
.config/nvim/lua/core/keymaps.lua
Normal file
50
.config/nvim/lua/core/keymaps.lua
Normal file
@@ -0,0 +1,50 @@
|
||||
-- ============================================================================
|
||||
-- Keymaps - Tastenkombinationen
|
||||
-- ============================================================================
|
||||
|
||||
local keymap = vim.keymap.set
|
||||
|
||||
-- ESC clear search highlighting
|
||||
keymap('n', '<Esc>', '<cmd>nohlsearch<CR>', { desc = 'Clear search highlighting' })
|
||||
|
||||
-- Better window navigation
|
||||
keymap('n', '<C-h>', '<C-w>h', { desc = 'Navigate to left window' })
|
||||
keymap('n', '<C-j>', '<C-w>j', { desc = 'Navigate to bottom window' })
|
||||
keymap('n', '<C-k>', '<C-w>k', { desc = 'Navigate to top window' })
|
||||
keymap('n', '<C-l>', '<C-w>l', { desc = 'Navigate to right window' })
|
||||
|
||||
-- Resize windows
|
||||
keymap('n', '<C-Up>', ':resize +2<CR>', { desc = 'Increase window height' })
|
||||
keymap('n', '<C-Down>', ':resize -2<CR>', { desc = 'Decrease window height' })
|
||||
keymap('n', '<C-Left>', ':vertical resize -2<CR>', { desc = 'Decrease window width' })
|
||||
keymap('n', '<C-Right>', ':vertical resize +2<CR>', { desc = 'Increase window width' })
|
||||
|
||||
-- Buffer navigation
|
||||
keymap('n', '<S-h>', '<cmd>bprevious<CR>', { desc = 'Previous buffer' })
|
||||
keymap('n', '<S-l>', '<cmd>bnext<CR>', { desc = 'Next buffer' })
|
||||
keymap('n', '<leader>bd', '<cmd>bdelete<CR>', { desc = 'Delete buffer' })
|
||||
|
||||
-- Better indenting (bleibt in visual mode)
|
||||
keymap('v', '<', '<gv', { desc = 'Indent left' })
|
||||
keymap('v', '>', '>gv', { desc = 'Indent right' })
|
||||
|
||||
-- Move lines up/down
|
||||
keymap('n', '<A-j>', ':m .+1<CR>==', { desc = 'Move line down' })
|
||||
keymap('n', '<A-k>', ':m .-2<CR>==', { desc = 'Move line up' })
|
||||
keymap('v', '<A-j>', ":m '>+1<CR>gv=gv", { desc = 'Move selection down' })
|
||||
keymap('v', '<A-k>', ":m '<-2<CR>gv=gv", { desc = 'Move selection up' })
|
||||
|
||||
-- Go error handling (dein Shortcut!)
|
||||
keymap('n', '<leader>ee', 'oif err != nil {<CR>}<Esc>Oreturn err<Esc>', { desc = 'Go error handling' })
|
||||
|
||||
-- Quick save
|
||||
keymap('n', '<leader>w', '<cmd>w<CR>', { desc = 'Save file' })
|
||||
|
||||
-- Diagnostic keymaps (LSP errors)
|
||||
keymap('n', '[d', vim.diagnostic.goto_prev, { desc = 'Previous diagnostic' })
|
||||
keymap('n', ']d', vim.diagnostic.goto_next, { desc = 'Next diagnostic' })
|
||||
keymap('n', '<leader>cd', vim.diagnostic.open_float, { desc = 'Show diagnostic' })
|
||||
keymap('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Diagnostic list' })
|
||||
|
||||
-- Terminal
|
||||
keymap('t', '<Esc><Esc>', '<C-\\><C-n>', { desc = 'Exit terminal mode' })
|
||||
45
.config/nvim/lua/core/lazy.lua
Normal file
45
.config/nvim/lua/core/lazy.lua
Normal file
@@ -0,0 +1,45 @@
|
||||
-- ============================================================================
|
||||
-- Lazy.nvim - Plugin Manager Setup
|
||||
-- ============================================================================
|
||||
|
||||
-- lazy.nvim automatisch installieren wenn nicht vorhanden
|
||||
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',
|
||||
lazypath,
|
||||
})
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
-- Plugins laden
|
||||
require('lazy').setup({
|
||||
-- Import alle Plugin-Specs aus lua/plugins/
|
||||
{ import = 'plugins' },
|
||||
}, {
|
||||
-- Lazy.nvim UI Konfiguration
|
||||
ui = {
|
||||
border = 'rounded',
|
||||
},
|
||||
-- Performance
|
||||
performance = {
|
||||
rtp = {
|
||||
disabled_plugins = {
|
||||
'gzip',
|
||||
'tarPlugin',
|
||||
'tohtml',
|
||||
'tutor',
|
||||
'zipPlugin',
|
||||
},
|
||||
},
|
||||
},
|
||||
-- Check for updates aber nicht nerven
|
||||
checker = {
|
||||
enabled = true,
|
||||
notify = false,
|
||||
},
|
||||
})
|
||||
61
.config/nvim/lua/core/options.lua
Normal file
61
.config/nvim/lua/core/options.lua
Normal file
@@ -0,0 +1,61 @@
|
||||
-- ============================================================================
|
||||
-- Neovim Options - Grundlegende Einstellungen
|
||||
-- ============================================================================
|
||||
|
||||
local opt = vim.opt
|
||||
|
||||
-- Zeilennummern
|
||||
opt.number = true
|
||||
opt.relativenumber = false -- Absolute Nummern für QA-Arbeit
|
||||
|
||||
-- Maus
|
||||
opt.mouse = 'a'
|
||||
|
||||
-- Clipboard (System Clipboard nutzen)
|
||||
opt.clipboard = 'unnamedplus'
|
||||
|
||||
-- Tabs & Indentation
|
||||
opt.tabstop = 2
|
||||
opt.shiftwidth = 2
|
||||
opt.expandtab = true
|
||||
opt.autoindent = true
|
||||
opt.breakindent = true
|
||||
|
||||
-- Suche
|
||||
opt.ignorecase = true
|
||||
opt.smartcase = true
|
||||
opt.hlsearch = true
|
||||
opt.incsearch = true
|
||||
|
||||
-- Aussehen
|
||||
opt.termguicolors = true
|
||||
opt.signcolumn = 'yes'
|
||||
opt.cursorline = true
|
||||
opt.scrolloff = 10
|
||||
opt.sidescrolloff = 8
|
||||
|
||||
-- Split windows
|
||||
opt.splitright = true
|
||||
opt.splitbelow = true
|
||||
|
||||
-- Undo & Backup
|
||||
opt.undofile = true
|
||||
opt.backup = false
|
||||
opt.swapfile = false
|
||||
|
||||
-- Performance
|
||||
opt.updatetime = 250
|
||||
opt.timeoutlen = 300
|
||||
|
||||
-- Whitespace characters
|
||||
opt.list = true
|
||||
opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' }
|
||||
|
||||
-- Command line
|
||||
opt.showmode = false -- Statusline zeigt mode schon
|
||||
|
||||
-- Completion
|
||||
opt.completeopt = 'menu,menuone,noselect'
|
||||
|
||||
-- Fold (erstmal aus)
|
||||
opt.foldenable = false
|
||||
@@ -1,94 +0,0 @@
|
||||
-- Explorer-Konfiguration (Neo-tree)
|
||||
require('neo-tree').setup({
|
||||
close_if_last_window = false,
|
||||
popup_border_style = "rounded",
|
||||
enable_git_status = true,
|
||||
enable_diagnostics = true,
|
||||
sources = {
|
||||
"filesystem",
|
||||
"buffers",
|
||||
"git_status",
|
||||
},
|
||||
source_selector = {
|
||||
winbar = true,
|
||||
content_layout = "center",
|
||||
tabs_layout = "equal",
|
||||
},
|
||||
filesystem = {
|
||||
filtered_items = {
|
||||
visible = true,
|
||||
hide_dotfiles = false,
|
||||
hide_gitignored = false,
|
||||
},
|
||||
follow_current_file = {
|
||||
enabled = true,
|
||||
},
|
||||
use_libuv_file_watcher = true,
|
||||
},
|
||||
window = {
|
||||
position = "right",
|
||||
width = 35,
|
||||
mapping_options = {
|
||||
noremap = true,
|
||||
nowait = true,
|
||||
},
|
||||
},
|
||||
git_status = {
|
||||
symbols = {
|
||||
added = "✚",
|
||||
modified = "",
|
||||
deleted = "✖",
|
||||
renamed = "➜",
|
||||
untracked = "★",
|
||||
ignored = "◌",
|
||||
unstaged = "✗",
|
||||
staged = "✓",
|
||||
conflict = "",
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- Harpoon (Schnellwechsel zwischen Dateien)
|
||||
local mark = require("harpoon.mark")
|
||||
local ui = require("harpoon.ui")
|
||||
|
||||
vim.keymap.set("n", "<leader>a", mark.add_file, { desc = "Datei zu Harpoon hinzufügen" })
|
||||
vim.keymap.set("n", "<leader>h", ui.toggle_quick_menu, { desc = "Harpoon-Menü anzeigen" })
|
||||
|
||||
-- Schnellzugriff auf die ersten 4 Dateien
|
||||
vim.keymap.set("n", "<leader>1", function() ui.nav_file(1) end, { desc = "Harpoon Datei 1" })
|
||||
vim.keymap.set("n", "<leader>2", function() ui.nav_file(2) end, { desc = "Harpoon Datei 2" })
|
||||
vim.keymap.set("n", "<leader>3", function() ui.nav_file(3) end, { desc = "Harpoon Datei 3" })
|
||||
vim.keymap.set("n", "<leader>4", function() ui.nav_file(4) end, { desc = "Harpoon Datei 4" })
|
||||
|
||||
-- Tastenkombinationen für Neo-tree
|
||||
vim.keymap.set("n", "<leader>e", ":Neotree toggle right<CR>", { silent = true, desc = "Explorer öffnen" })
|
||||
|
||||
-- Git Signs
|
||||
require('gitsigns').setup({
|
||||
signs = {
|
||||
add = { text = '+' },
|
||||
change = { text = '~' },
|
||||
delete = { text = '_' },
|
||||
topdelete = { text = '‾' },
|
||||
changedelete = { text = '~' },
|
||||
untracked = { text = '┆' },
|
||||
},
|
||||
signcolumn = true,
|
||||
on_attach = function(bufnr)
|
||||
local gs = package.loaded.gitsigns
|
||||
|
||||
-- Navigation zwischen Änderungen
|
||||
vim.keymap.set('n', ']c', function()
|
||||
if vim.wo.diff then return ']c' end
|
||||
vim.schedule(function() gs.next_hunk() end)
|
||||
return '<Ignore>'
|
||||
end, { expr = true, buffer = bufnr })
|
||||
|
||||
vim.keymap.set('n', '[c', function()
|
||||
if vim.wo.diff then return '[c' end
|
||||
vim.schedule(function() gs.prev_hunk() end)
|
||||
return '<Ignore>'
|
||||
end, { expr = true, buffer = bufnr })
|
||||
end
|
||||
})
|
||||
@@ -1,183 +0,0 @@
|
||||
-- ~/.config/nvim/lua/custom/hydra.lua
|
||||
local Hydra = require('hydra')
|
||||
|
||||
-- Fenster-Management Hydra
|
||||
Hydra({
|
||||
name = 'Fenster',
|
||||
mode = 'n',
|
||||
body = '<C-w>',
|
||||
heads = {
|
||||
-- Navigieren zwischen Fenstern
|
||||
{ 'h', '<C-w>h', { desc = 'links' } },
|
||||
{ 'j', '<C-w>j', { desc = 'unten' } },
|
||||
{ 'k', '<C-w>k', { desc = 'oben' } },
|
||||
{ 'l', '<C-w>l', { desc = 'rechts' } },
|
||||
|
||||
-- Fenster verschieben
|
||||
{ 'H', '<C-w>H', { desc = 'nach links verschieben' } },
|
||||
{ 'J', '<C-w>J', { desc = 'nach unten verschieben' } },
|
||||
{ 'K', '<C-w>K', { desc = 'nach oben verschieben' } },
|
||||
{ 'L', '<C-w>L', { desc = 'nach rechts verschieben' } },
|
||||
|
||||
-- Größe ändern
|
||||
{ '>', '<C-w>>', { desc = 'breiter' } },
|
||||
{ '<', '<C-w><', { desc = 'schmaler' } },
|
||||
{ '+', '<C-w>+', { desc = 'höher' } },
|
||||
{ '-', '<C-w>-', { desc = 'niedriger' } },
|
||||
{ '=', '<C-w>=', { desc = 'gleiche Größe' } },
|
||||
|
||||
-- Neue Fenster
|
||||
{ 's', '<C-w>s', { desc = 'horizontal teilen' } },
|
||||
{ 'v', '<C-w>v', { desc = 'vertikal teilen' } },
|
||||
{ 'n', '<cmd>new<CR>', { desc = 'neue horizontale Teilung' } },
|
||||
{ 'N', '<cmd>vnew<CR>', { desc = 'neue vertikale Teilung' } },
|
||||
|
||||
-- Fenster schließen
|
||||
{ 'c', '<C-w>c', { desc = 'schließen' } },
|
||||
{ 'o', '<C-w>o', { desc = 'andere schließen' } },
|
||||
|
||||
-- Beenden
|
||||
{ 'q', nil, { desc = 'beenden', exit = true } },
|
||||
{ '<Esc>', nil, { desc = 'beenden', exit = true } },
|
||||
}
|
||||
})
|
||||
|
||||
-- Harpoon Hydra
|
||||
Hydra({
|
||||
name = 'Harpoon',
|
||||
mode = 'n',
|
||||
body = '<leader>h',
|
||||
heads = {
|
||||
{ 'a', function() require("harpoon.mark").add_file() end, { desc = 'Datei hinzufügen' } },
|
||||
{ 'h', function() require("harpoon.ui").toggle_quick_menu() end, { desc = 'Menü anzeigen' } },
|
||||
{ 'n', function() require("harpoon.ui").nav_next() end, { desc = 'Nächste Datei' } },
|
||||
{ 'p', function() require("harpoon.ui").nav_prev() end, { desc = 'Vorherige Datei' } },
|
||||
{ '1', function() require("harpoon.ui").nav_file(1) end, { desc = 'Datei 1' } },
|
||||
{ '2', function() require("harpoon.ui").nav_file(2) end, { desc = 'Datei 2' } },
|
||||
{ '3', function() require("harpoon.ui").nav_file(3) end, { desc = 'Datei 3' } },
|
||||
{ '4', function() require("harpoon.ui").nav_file(4) end, { desc = 'Datei 4' } },
|
||||
{ '5', function() require("harpoon.ui").nav_file(5) end, { desc = 'Datei 5' } },
|
||||
{ 'q', nil, { desc = 'beenden', exit = true } },
|
||||
{ '<Esc>', nil, { desc = 'beenden', exit = true } },
|
||||
}
|
||||
})
|
||||
|
||||
-- Git-Operationen Hydra (funktioniert mit Gitsigns und Neogit)
|
||||
Hydra({
|
||||
name = 'Git',
|
||||
mode = 'n',
|
||||
body = '<leader>g',
|
||||
heads = {
|
||||
-- Gitsigns
|
||||
{ 'h', function() require("gitsigns").preview_hunk() end, { desc = 'Änderung anzeigen' } },
|
||||
{ 'n', function() require("gitsigns").next_hunk() end, { desc = 'Nächste Änderung' } },
|
||||
{ 'p', function() require("gitsigns").prev_hunk() end, { desc = 'Vorherige Änderung' } },
|
||||
{ 's', function() require("gitsigns").stage_hunk() end, { desc = 'Änderung stagen' } },
|
||||
{ 'u', function() require("gitsigns").undo_stage_hunk() end, { desc = 'Stagen rückgängig' } },
|
||||
{ 'r', function() require("gitsigns").reset_hunk() end, { desc = 'Änderung zurücksetzen' } },
|
||||
|
||||
-- Neogit
|
||||
{ 'g', function() require("neogit").open() end, { desc = 'Neogit öffnen', exit = true } },
|
||||
{ 'c', function() require("neogit").open({ "commit" }) end, { desc = 'Commit', exit = true } },
|
||||
{ 'P', function() require("neogit").open({ "push" }) end, { desc = 'Push', exit = true } },
|
||||
{ 'l', function() require("neogit").open({ "log" }) end, { desc = 'Log', exit = true } },
|
||||
|
||||
-- Diffview
|
||||
{ 'd', '<cmd>DiffviewOpen<CR>', { desc = 'Diff anzeigen', exit = true } },
|
||||
|
||||
-- Beenden
|
||||
{ 'q', nil, { desc = 'beenden', exit = true } },
|
||||
{ '<Esc>', nil, { desc = 'beenden', exit = true } },
|
||||
}
|
||||
})
|
||||
|
||||
-- Neo-tree Hydra
|
||||
Hydra({
|
||||
name = 'Explorer',
|
||||
mode = 'n',
|
||||
body = '<leader>E',
|
||||
heads = {
|
||||
{ 'e', '<cmd>Neotree toggle right<CR>', { desc = 'Explorer ein/aus', exit = true } },
|
||||
{ 'f', '<cmd>Neotree focus filesystem right<CR>', { desc = 'Dateisystem', exit = true } },
|
||||
{ 'b', '<cmd>Neotree focus buffers right<CR>', { desc = 'Buffer', exit = true } },
|
||||
{ 'g', '<cmd>Neotree focus git_status right<CR>', { desc = 'Git-Status', exit = true } },
|
||||
|
||||
-- Leap Integration
|
||||
{ 's', function()
|
||||
-- Öffne Neo-tree und springe mit Leap
|
||||
vim.cmd('Neotree focus filesystem right')
|
||||
-- Eine kleine Verzögerung, damit Neo-tree Zeit hat, zu öffnen
|
||||
vim.defer_fn(function()
|
||||
require('leap').leap { target_windows = { vim.api.nvim_get_current_win() } }
|
||||
end, 100)
|
||||
end,
|
||||
{ desc = 'Suchen mit Leap', exit = true }
|
||||
},
|
||||
|
||||
-- Beenden
|
||||
{ 'q', nil, { desc = 'beenden', exit = true } },
|
||||
{ '<Esc>', nil, { desc = 'beenden', exit = true } },
|
||||
}
|
||||
})
|
||||
|
||||
-- LSP und Coding-Hydra
|
||||
Hydra({
|
||||
name = 'Code',
|
||||
mode = 'n',
|
||||
body = '<leader>c',
|
||||
heads = {
|
||||
-- LSP Aktionen
|
||||
{ 'a', vim.lsp.buf.code_action, { desc = 'Code-Aktion' } },
|
||||
{ 'r', vim.lsp.buf.rename, { desc = 'Umbenennen' } },
|
||||
{ 'd', vim.lsp.buf.definition, { desc = 'Definition', exit = true } },
|
||||
{ 'D', vim.lsp.buf.declaration, { desc = 'Deklaration', exit = true } },
|
||||
{ 'i', vim.lsp.buf.implementation, { desc = 'Implementation', exit = true } },
|
||||
{ 'h', vim.lsp.buf.hover, { desc = 'Hover Info' } },
|
||||
{ 'f', function() require('conform').format() end, { desc = 'Formatieren' } },
|
||||
|
||||
-- Diagnostik
|
||||
{ 'n', vim.diagnostic.goto_next, { desc = 'Nächster Fehler' } },
|
||||
{ 'p', vim.diagnostic.goto_prev, { desc = 'Vorheriger Fehler' } },
|
||||
{ 'l', vim.diagnostic.open_float, { desc = 'Fehler anzeigen' } },
|
||||
|
||||
-- Beenden
|
||||
{ 'q', nil, { desc = 'beenden', exit = true } },
|
||||
{ '<Esc>', nil, { desc = 'beenden', exit = true } },
|
||||
}
|
||||
})
|
||||
|
||||
-- Erweiterte Navigation mit Leap und Harpoon
|
||||
Hydra({
|
||||
name = 'Navigation',
|
||||
mode = 'n',
|
||||
body = '<leader>n',
|
||||
heads = {
|
||||
-- Leap
|
||||
{ 'f', function() require('leap').leap { target_windows = { vim.api.nvim_get_current_win() } } end,
|
||||
{ desc = 'Leap vorwärts', exit = true } },
|
||||
{ 'F', function() require('leap').leap { backward = true, target_windows = { vim.api.nvim_get_current_win() } } end,
|
||||
{ desc = 'Leap rückwärts', exit = true } },
|
||||
{ 'w', function()
|
||||
require('leap').leap { target_windows = vim.tbl_filter(
|
||||
function(win) return vim.api.nvim_win_get_config(win).relative == '' end,
|
||||
vim.api.nvim_list_wins()
|
||||
) }
|
||||
end, { desc = 'Leap alle Fenster', exit = true } },
|
||||
|
||||
-- Harpoon
|
||||
{ 'h', function() require("harpoon.ui").toggle_quick_menu() end, { desc = 'Harpoon-Menü', exit = true } },
|
||||
{ '1', function() require("harpoon.ui").nav_file(1) end, { desc = 'Harpoon 1', exit = true } },
|
||||
{ '2', function() require("harpoon.ui").nav_file(2) end, { desc = 'Harpoon 2', exit = true } },
|
||||
{ '3', function() require("harpoon.ui").nav_file(3) end, { desc = 'Harpoon 3', exit = true } },
|
||||
{ '4', function() require("harpoon.ui").nav_file(4) end, { desc = 'Harpoon 4', exit = true } },
|
||||
|
||||
-- Dateiexploration
|
||||
{ 'e', '<cmd>Neotree toggle right<CR>', { desc = 'Explorer', exit = true } },
|
||||
{ 't', '<cmd>Telescope find_files<CR>', { desc = 'Dateien suchen', exit = true } },
|
||||
{ 'g', '<cmd>Telescope live_grep<CR>', { desc = 'Inhalte suchen', exit = true } },
|
||||
|
||||
-- Beenden
|
||||
{ 'q', nil, { desc = 'beenden', exit = true } },
|
||||
{ '<Esc>', nil, { desc = 'beenden', exit = true } },
|
||||
}
|
||||
})
|
||||
@@ -1,280 +0,0 @@
|
||||
-- LSP und Treesitter Konfiguration
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
|
||||
|
||||
-- Mason für einfache LSP-Installation
|
||||
require('mason').setup()
|
||||
require('mason-lspconfig').setup({
|
||||
ensure_installed = {
|
||||
-- Sprachen
|
||||
'lua_ls', -- Lua
|
||||
'pyright', -- Python
|
||||
'ruff', -- Python Linter
|
||||
'ts_ls', -- TypeScript/JavaScript
|
||||
-- 'vue-language-server', -- Vue
|
||||
'intelephense', -- PHP
|
||||
'html', -- HTML
|
||||
'cssls', -- CSS
|
||||
'yamlls', -- YAML
|
||||
'jsonls', -- JSON
|
||||
'docker_compose_language_service', -- Docker Compose
|
||||
'dockerls', -- Dockerfile
|
||||
'gopls',
|
||||
},
|
||||
})
|
||||
|
||||
-- LSP-Server konfigurieren
|
||||
local lspconfig = require('lspconfig')
|
||||
|
||||
-- Lua
|
||||
lspconfig.lua_ls.setup({
|
||||
capabilities = capabilities,
|
||||
})
|
||||
|
||||
-- TypeScript (inkl. React)
|
||||
lspconfig.ts_ls.setup({
|
||||
capabilities = capabilities,
|
||||
})
|
||||
|
||||
-- Typescript-Tools für bessere TS/JS Unterstützung
|
||||
require("typescript-tools").setup({
|
||||
settings = {
|
||||
-- Für NestJS, React und andere TS-Frameworks
|
||||
tsserver_file_preferences = {
|
||||
importModuleSpecifierPreference = "relative",
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- Python
|
||||
lspconfig.pyright.setup({
|
||||
capabilities = capabilities,
|
||||
})
|
||||
|
||||
-- PHP/Symfony
|
||||
lspconfig.intelephense.setup({
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
intelephense = {
|
||||
stubs = {
|
||||
"apache", "bcmath", "bz2", "calendar", "Core", "curl", "date", "dba",
|
||||
"dom", "fileinfo", "filter", "ftp", "gd", "gettext", "hash", "iconv",
|
||||
"imap", "intl", "json", "ldap", "libxml", "mbstring", "mysqli", "mysqlnd",
|
||||
"oci8", "openssl", "pcntl", "pcre", "PDO", "pdo_mysql", "pdo_pgsql",
|
||||
"pdo_sqlite", "pgsql", "Phar", "posix", "pspell", "readline", "Reflection",
|
||||
"session", "shmop", "SimpleXML", "snmp", "soap", "sockets", "sodium", "SPL",
|
||||
"sqlite3", "standard", "superglobals", "sysvmsg", "sysvsem", "sysvshm",
|
||||
"tidy", "tokenizer", "xml", "xmlreader", "xmlrpc", "xmlwriter", "xsl", "Zend OPcache",
|
||||
"zip", "zlib", "wordpress", "symfony"
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- Go
|
||||
lspconfig.gopls.setup({
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
gopls = {
|
||||
analyses = {
|
||||
unusedparams = true,
|
||||
},
|
||||
staticcheck = true,
|
||||
gofumpt = true, -- Strengere Formatierung als gofmt
|
||||
usePlaceholders = true,
|
||||
completeUnimported = true,
|
||||
experimentalPostfixCompletions = true,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- YAML mit Schema-Unterstützung
|
||||
lspconfig.yamlls.setup({
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
yaml = {
|
||||
schemas = require('schemastore').yaml.schemas(),
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- JSON mit Schema-Unterstützung
|
||||
lspconfig.jsonls.setup({
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
json = {
|
||||
schemas = require('schemastore').json.schemas(),
|
||||
validate = { enable = true },
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- Treesitter-Konfiguration für Syntax-Highlighting
|
||||
require('nvim-treesitter.configs').setup({
|
||||
ensure_installed = {
|
||||
"lua", "vim", "vimdoc", "json", "yaml", "html", "css",
|
||||
"javascript", "typescript", "tsx", "php", "python", "vue",
|
||||
"dockerfile", "markdown", "regex", "bash", "go",
|
||||
},
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
})
|
||||
|
||||
-- Autocomplete-Konfiguration
|
||||
local cmp = require('cmp')
|
||||
local luasnip = require('luasnip')
|
||||
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
window = {
|
||||
completion = cmp.config.window.bordered(),
|
||||
documentation = cmp.config.window.bordered(),
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
['<C-d>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
['<CR>'] = cmp.mapping.confirm({ select = true }),
|
||||
['<Tab>'] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif luasnip.expand_or_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.jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { 'i', 's' }),
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'luasnip' },
|
||||
{ name = 'buffer' },
|
||||
{ name = 'path' },
|
||||
}),
|
||||
})
|
||||
|
||||
-- Einfache benutzerdefinierte Snippets (optional)
|
||||
-- Hier ein Beispiel für ein paar einfache Snippets
|
||||
local snippets_path = vim.fn.stdpath("config") .. "/snippets"
|
||||
if vim.fn.isdirectory(snippets_path) == 0 then
|
||||
vim.fn.mkdir(snippets_path, "p")
|
||||
end
|
||||
|
||||
-- Füge einige nützliche Snippets hinzu
|
||||
luasnip.add_snippets("python", {
|
||||
luasnip.snippet("def", {
|
||||
luasnip.text_node("def "),
|
||||
luasnip.insert_node(1, "function_name"),
|
||||
luasnip.text_node("("),
|
||||
luasnip.insert_node(2, "args"),
|
||||
luasnip.text_node("):\n\t"),
|
||||
luasnip.insert_node(0),
|
||||
}),
|
||||
})
|
||||
|
||||
luasnip.add_snippets("typescript", {
|
||||
luasnip.snippet("fn", {
|
||||
luasnip.text_node("function "),
|
||||
luasnip.insert_node(1, "name"),
|
||||
luasnip.text_node("("),
|
||||
luasnip.insert_node(2, "params"),
|
||||
luasnip.text_node(") {\n\t"),
|
||||
luasnip.insert_node(0),
|
||||
luasnip.text_node("\n}"),
|
||||
}),
|
||||
})
|
||||
|
||||
luasnip.add_snippets("go", {
|
||||
luasnip.snippet("func", {
|
||||
luasnip.text_node("func "),
|
||||
luasnip.insert_node(1, "name"),
|
||||
luasnip.text_node("("),
|
||||
luasnip.insert_node(2, "params"),
|
||||
luasnip.text_node(") "),
|
||||
luasnip.insert_node(3, "returnType"),
|
||||
luasnip.text_node(" {\n\t"),
|
||||
luasnip.insert_node(0),
|
||||
luasnip.text_node("\n}"),
|
||||
}),
|
||||
luasnip.snippet("if", {
|
||||
luasnip.text_node("if "),
|
||||
luasnip.insert_node(1, "condition"),
|
||||
luasnip.text_node(" {\n\t"),
|
||||
luasnip.insert_node(0),
|
||||
luasnip.text_node("\n}"),
|
||||
}),
|
||||
})
|
||||
|
||||
-- Code-Formatierung
|
||||
require("conform").setup({
|
||||
formatters_by_ft = {
|
||||
javascript = { "prettier" },
|
||||
typescript = { "prettier" },
|
||||
javascriptreact = { "prettier" },
|
||||
typescriptreact = { "prettier" },
|
||||
vue = { "prettier" },
|
||||
json = { "prettier" },
|
||||
yaml = { "prettier" },
|
||||
html = { "prettier" },
|
||||
css = { "prettier" },
|
||||
php = { "php_cs_fixer" },
|
||||
python = { "black" },
|
||||
lua = { "stylua" },
|
||||
go = { "gofumpt" },
|
||||
},
|
||||
})
|
||||
|
||||
-- Formatierung beim Speichern
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
pattern = "*",
|
||||
callback = function()
|
||||
require("conform").format({ async = false, lsp_fallback = true })
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
-- Einstellungen für die Diagnostik (Fehleranzeige)
|
||||
vim.diagnostic.config({
|
||||
virtual_text = {
|
||||
format = function(diagnostic)
|
||||
local icon = "→ "
|
||||
if diagnostic.severity == vim.diagnostic.severity.ERROR then
|
||||
icon = "✗ "
|
||||
elseif diagnostic.severity == vim.diagnostic.severity.WARN then
|
||||
icon = "⚠ "
|
||||
elseif diagnostic.severity == vim.diagnostic.severity.INFO then
|
||||
icon = "ℹ "
|
||||
elseif diagnostic.severity == vim.diagnostic.severity.HINT then
|
||||
icon = "➤ "
|
||||
end
|
||||
return icon .. diagnostic.message
|
||||
end
|
||||
},
|
||||
signs = true, -- Symbole in der Randspalte anzeigen
|
||||
underline = true, -- Problematischen Code unterstreichen
|
||||
update_in_insert = false,
|
||||
severity_sort = true,
|
||||
float = {
|
||||
border = "rounded",
|
||||
source = "always",
|
||||
},
|
||||
})
|
||||
|
||||
-- Tastenkombinationen für Diagnostik
|
||||
vim.keymap.set('n', '<leader>cd', vim.diagnostic.open_float, { desc = 'Fehlerdetails anzeigen' })
|
||||
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Vorheriger Fehler' })
|
||||
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Nächster Fehler' })
|
||||
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Fehler in Liste anzeigen' })
|
||||
@@ -1,449 +0,0 @@
|
||||
return {
|
||||
-- Fuzzy Finder
|
||||
{
|
||||
'nvim-telescope/telescope.nvim',
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
'nvim-telescope/telescope-fzf-native.nvim',
|
||||
},
|
||||
},
|
||||
|
||||
-- LSP & Completion
|
||||
{
|
||||
'neovim/nvim-lspconfig',
|
||||
dependencies = {
|
||||
'williamboman/mason.nvim',
|
||||
'williamboman/mason-lspconfig.nvim',
|
||||
'hrsh7th/nvim-cmp',
|
||||
'hrsh7th/cmp-nvim-lsp',
|
||||
'hrsh7th/cmp-buffer',
|
||||
'hrsh7th/cmp-path',
|
||||
'L3MON4D3/LuaSnip',
|
||||
'saadparwaiz1/cmp_luasnip',
|
||||
'j-hui/fidget.nvim',
|
||||
},
|
||||
config = function()
|
||||
-- Nichts hier definieren - wir laden die Konfiguration aus der lsp.lua
|
||||
require("custom.lsp")
|
||||
end,
|
||||
},
|
||||
|
||||
-- Snipped
|
||||
{
|
||||
"rafamadriz/friendly-snippets",
|
||||
dependencies = {
|
||||
"L3MON4D3/LuaSnip",
|
||||
},
|
||||
config = function()
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
end,
|
||||
},
|
||||
|
||||
-- Syntax Highlighting
|
||||
{
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
build = ':TSUpdate',
|
||||
dependencies = {
|
||||
'nvim-treesitter/nvim-treesitter-textobjects',
|
||||
},
|
||||
},
|
||||
|
||||
-- Datei-Explorer
|
||||
{
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-tree/nvim-web-devicons", -- Für Datei-Icons
|
||||
"MunifTanjim/nui.nvim", -- UI-Komponenten-Bibliothek
|
||||
},
|
||||
config = function()
|
||||
-- Standardkonfiguration deaktivieren
|
||||
vim.g.neo_tree_remove_legacy_commands = 1
|
||||
|
||||
require("neo-tree").setup({
|
||||
close_if_last_window = false, -- Neovim schließen, wenn nur noch Neo-tree offen ist?
|
||||
popup_border_style = "rounded", -- Stil für Popup-Fenster
|
||||
enable_git_status = true, -- Git-Integration aktivieren
|
||||
enable_diagnostics = true, -- Zeige Diagnostik-Informationen (LSP)
|
||||
|
||||
default_component_configs = {
|
||||
container = {
|
||||
enable_character_fade = true, -- Schöne Übergänge bei Textlängen
|
||||
width = "100%",
|
||||
right_padding = 0,
|
||||
},
|
||||
indent = {
|
||||
indent_size = 2,
|
||||
padding = 1,
|
||||
with_markers = true,
|
||||
indent_marker = "│",
|
||||
last_indent_marker = "└",
|
||||
highlight = "NeoTreeIndentMarker",
|
||||
with_expanders = true, -- Klick-/Tastatur-expandierbare Ordner
|
||||
expander_collapsed = "",
|
||||
expander_expanded = "",
|
||||
expander_highlight = "NeoTreeExpander",
|
||||
},
|
||||
icon = {
|
||||
folder_closed = "",
|
||||
folder_open = "",
|
||||
folder_empty = "",
|
||||
default = "*",
|
||||
highlight = "NeoTreeFileIcon"
|
||||
},
|
||||
modified = {
|
||||
symbol = "[+]",
|
||||
highlight = "NeoTreeModified",
|
||||
},
|
||||
name = {
|
||||
trailing_slash = false,
|
||||
use_git_status_colors = true,
|
||||
highlight = "NeoTreeFileName",
|
||||
},
|
||||
git_status = {
|
||||
symbols = {
|
||||
-- Symbole für Git-Status
|
||||
added = "✚", -- oder "✚"
|
||||
modified = "", -- oder "✹"
|
||||
deleted = "✖", -- oder ""
|
||||
renamed = "➜", -- oder ""
|
||||
untracked = "★", -- oder "✭"
|
||||
ignored = "◌", -- oder "◌"
|
||||
unstaged = "✗", -- oder "✗"
|
||||
staged = "✓", -- oder "✓"
|
||||
conflict = "", -- oder "≠"
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
-- Welche Ansichten verfügbar sein sollen
|
||||
source_selector = {
|
||||
winbar = true, -- Zeige Auswahl in der Fensterleiste
|
||||
statusline = false, -- Nicht in der Statuszeile anzeigen
|
||||
content_layout = "center",
|
||||
sources = { -- Verfügbare Quellen
|
||||
{ source = "filesystem", display_name = " Dateien " },
|
||||
{ source = "buffers", display_name = " Buffer " },
|
||||
{ source = "git_status", display_name = " Git " },
|
||||
},
|
||||
tabs_layout = "equal", -- "equal", "focus"
|
||||
},
|
||||
|
||||
-- Dateisystemansicht
|
||||
filesystem = {
|
||||
filtered_items = {
|
||||
visible = true, -- Gefilterte Elemente mit anderen Stil anzeigen
|
||||
hide_dotfiles = false, -- Versteckte Dateien anzeigen
|
||||
hide_gitignored = false, -- Git-ignorierte Dateien anzeigen
|
||||
hide_hidden = false, -- Versteckte Dateien unter Windows anzeigen
|
||||
hide_by_name = {
|
||||
-- "node_modules", -- Auskommentieren, um zu verstecken
|
||||
},
|
||||
hide_by_pattern = {
|
||||
-- "*.meta", -- Auskommentieren, um zu verstecken
|
||||
},
|
||||
always_show = { -- Immer anzeigen, auch wenn sie sonst gefiltert würden
|
||||
".gitignored",
|
||||
".env",
|
||||
},
|
||||
never_show = { -- Dateien, die immer ausgeblendet werden
|
||||
".DS_Store",
|
||||
},
|
||||
never_show_by_pattern = { -- Regex-Muster für Dateien, die nie angezeigt werden
|
||||
-- ".*\\.meta$",
|
||||
},
|
||||
},
|
||||
follow_current_file = {
|
||||
enabled = true, -- Hervorheben der aktuellen Datei im Explorer
|
||||
leave_dirs_open = false, -- Ordner öffnen, wenn Datei darin
|
||||
},
|
||||
group_empty_dirs = false, -- Leere Unterordner unter Elternordner gruppieren
|
||||
hijack_netrw_behavior = "open_default", -- Netrw ersetzen
|
||||
use_libuv_file_watcher = true, -- Effiziente Dateiüberwachung (bemerkt Änderungen)
|
||||
|
||||
window = {
|
||||
mappings = {
|
||||
-- Tastenkombinationen im Dateisystem-Fenster
|
||||
["<space>"] = "none", -- Space für andere Funktionen freigeben
|
||||
["<2-LeftMouse>"] = "open",
|
||||
["<cr>"] = "open",
|
||||
["S"] = "open_split", -- In horizontales Split öffnen
|
||||
["s"] = "open_vsplit", -- In vertikales Split öffnen
|
||||
["t"] = "open_tabnew", -- In neuem Tab öffnen
|
||||
["C"] = "close_node", -- Knoten schließen
|
||||
["z"] = "close_all_nodes", -- Alle Knoten schließen
|
||||
["R"] = "refresh", -- Aktualisieren
|
||||
["a"] = {
|
||||
"add", -- Neue Datei/Ordner erstellen
|
||||
config = {
|
||||
show_path =
|
||||
"relative" -- Relativen Pfad beim Erstellen anzeigen
|
||||
}
|
||||
},
|
||||
["d"] = "delete", -- Löschen
|
||||
["r"] = "rename", -- Umbenennen
|
||||
["y"] = "copy_to_clipboard", -- In Zwischenablage kopieren
|
||||
["x"] = "cut_to_clipboard", -- Ausschneiden
|
||||
["p"] = "paste_from_clipboard", -- Einfügen
|
||||
["c"] = "copy", -- Kopieren (mit Ziel-Auswahl)
|
||||
["m"] = "move", -- Verschieben (mit Ziel-Auswahl)
|
||||
["/"] = "filter_on_submit", -- Filtern
|
||||
["<esc>"] = "clear_filter", -- Filter löschen
|
||||
["f"] = "filter_on_submit", -- Filtern (Alternative)
|
||||
["<c-x>"] = "clear_filter", -- Filter löschen (Alternative)
|
||||
["?"] = "show_help", -- Hilfe anzeigen
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
-- Buffer-Ansicht (Geöffnete Dateien)
|
||||
buffers = {
|
||||
follow_current_file = {
|
||||
enabled = true, -- Aktuelle Datei hervorheben
|
||||
},
|
||||
group_empty_dirs = true, -- Leere Ordner gruppieren
|
||||
show_unloaded = true, -- Auch nicht geladene Buffer anzeigen
|
||||
},
|
||||
|
||||
-- Git-Status-Ansicht
|
||||
git_status = {
|
||||
window = {
|
||||
mappings = {
|
||||
["A"] = "git_add_all", -- Alle Änderungen stagen
|
||||
["u"] = "git_unstage_file", -- Datei unstagen
|
||||
["a"] = "git_add_file", -- Datei stagen
|
||||
["r"] = "git_revert_file", -- Änderungen zurücksetzen
|
||||
["c"] = "git_commit", -- Commit erstellen
|
||||
["p"] = "git_push", -- Push
|
||||
["gg"] = "git_commit_and_push", -- Commit und Push
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
-- Hauptfenster-Konfiguration
|
||||
window = {
|
||||
position = "right", -- Explorer auf der rechten Seite
|
||||
width = 35, -- Breite des Explorers
|
||||
mapping_options = {
|
||||
noremap = true,
|
||||
nowait = true,
|
||||
},
|
||||
mappings = {
|
||||
["<space>"] = "none", -- Space für andere Funktionen freigeben
|
||||
["<2-LeftMouse>"] = "open",
|
||||
["<cr>"] = "open",
|
||||
["S"] = "open_split",
|
||||
["s"] = "open_vsplit",
|
||||
["t"] = "open_tabnew",
|
||||
["w"] = "open_with_window_picker", -- Mit Fensterauswahl öffnen
|
||||
["C"] = "close_node",
|
||||
["z"] = "close_all_nodes",
|
||||
["R"] = "refresh",
|
||||
["a"] = {
|
||||
"add",
|
||||
config = {
|
||||
show_path = "relative"
|
||||
}
|
||||
},
|
||||
["d"] = "delete",
|
||||
["r"] = "rename",
|
||||
["y"] = "copy_to_clipboard",
|
||||
["x"] = "cut_to_clipboard",
|
||||
["p"] = "paste_from_clipboard",
|
||||
["c"] = "copy",
|
||||
["m"] = "move",
|
||||
["q"] = "close_window", -- Fenster schließen
|
||||
["?"] = "show_help",
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
-- Tastenkombination zum Öffnen des Explorers
|
||||
vim.keymap.set("n", "<leader>e", ":Neotree toggle right<CR>",
|
||||
{ silent = true, desc = "Explorer ein/aus" })
|
||||
-- Tastenkombination für Dateiansicht
|
||||
vim.keymap.set("n", "<leader>ef", ":Neotree focus filesystem right<CR>",
|
||||
{ silent = true, desc = "Datei-Explorer" })
|
||||
-- Tastenkombination für Buffer-Liste
|
||||
vim.keymap.set("n", "<leader>eb", ":Neotree focus buffers right<CR>",
|
||||
{ silent = true, desc = "Buffer-Liste" })
|
||||
-- Tastenkombination für Git-Status
|
||||
vim.keymap.set("n", "<leader>eg", ":Neotree focus git_status right<CR>",
|
||||
{ silent = true, desc = "Git-Status" })
|
||||
end,
|
||||
},
|
||||
|
||||
-- Schnellwechsel zwischen Dateien (wie Harpoon)
|
||||
{
|
||||
'ThePrimeagen/harpoon',
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
},
|
||||
config = function()
|
||||
-- Basiseinstellungen für Harpoon
|
||||
require("harpoon").setup()
|
||||
|
||||
-- Einfache, direkte Keybindings
|
||||
vim.keymap.set("n", "<leader>a", require("harpoon.mark").add_file, { desc = "Datei markieren" })
|
||||
vim.keymap.set("n", "<leader>h", require("harpoon.ui").toggle_quick_menu,
|
||||
{ desc = "Harpoon-Menü" })
|
||||
vim.keymap.set("n", "<C-j>", function() require("harpoon.ui").nav_file(1) end)
|
||||
vim.keymap.set("n", "<C-k>", function() require("harpoon.ui").nav_file(2) end)
|
||||
vim.keymap.set("n", "<C-l>", function() require("harpoon.ui").nav_file(3) end)
|
||||
vim.keymap.set("n", "<C-;>", function() require("harpoon.ui").nav_file(4) end)
|
||||
end,
|
||||
},
|
||||
|
||||
-- Git-Integration
|
||||
{
|
||||
'lewis6991/gitsigns.nvim',
|
||||
config = true,
|
||||
},
|
||||
|
||||
-- Formatierung
|
||||
{
|
||||
'stevearc/conform.nvim',
|
||||
},
|
||||
|
||||
-- Framework-Unterstützung
|
||||
|
||||
-- PHP/Symfony
|
||||
{
|
||||
'phpactor/phpactor',
|
||||
ft = 'php',
|
||||
build = 'composer install --no-dev -o',
|
||||
},
|
||||
|
||||
-- TypeScript/JavaScript/React/Vue/NestJS
|
||||
{
|
||||
'pmizio/typescript-tools.nvim',
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
'neovim/nvim-lspconfig',
|
||||
},
|
||||
config = function()
|
||||
require("typescript-tools").setup({
|
||||
settings = {
|
||||
tsserver_file_preferences = {
|
||||
importModuleSpecifierPreference = "relative",
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- Vue.js
|
||||
-- {
|
||||
-- 'neovim/nvim-lspconfig',
|
||||
-- opts = function(_, opts)
|
||||
-- -- Füge Volar als Server hinzu
|
||||
-- opts.servers = opts.servers or {}
|
||||
-- opts.servers.volar = {
|
||||
-- filetypes = { 'vue', 'typescript', 'javascript' }
|
||||
-- }
|
||||
-- end,
|
||||
-- },
|
||||
|
||||
-- Playwright Testing
|
||||
{
|
||||
'mxsdev/nvim-dap',
|
||||
dependencies = {
|
||||
'rcarriga/nvim-dap-ui',
|
||||
'mfussenegger/nvim-dap-python',
|
||||
},
|
||||
},
|
||||
|
||||
-- YAML und JSON Unterstützung
|
||||
'b0o/schemastore.nvim',
|
||||
|
||||
-- Für Zen-Modus
|
||||
{
|
||||
"folke/zen-mode.nvim",
|
||||
cmd = "ZenMode",
|
||||
opts = {
|
||||
window = {
|
||||
width = 90,
|
||||
options = {
|
||||
number = false,
|
||||
relativenumber = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- Für Git-Integration
|
||||
{
|
||||
"sindrets/diffview.nvim",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
},
|
||||
|
||||
-- Für Neogit
|
||||
{
|
||||
"NeogitOrg/neogit",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"sindrets/diffview.nvim",
|
||||
},
|
||||
cmd = "Neogit",
|
||||
},
|
||||
|
||||
-- Für Farbvorschau in Code
|
||||
{
|
||||
"norcalli/nvim-colorizer.lua",
|
||||
cmd = "ColorizerToggle",
|
||||
config = true,
|
||||
},
|
||||
|
||||
-- Leap/Lightspeed
|
||||
{
|
||||
"ggandor/leap.nvim",
|
||||
config = function()
|
||||
require('leap').add_default_mappings()
|
||||
end,
|
||||
},
|
||||
|
||||
-- Hydra für kontextbezogene Tastaturmodi
|
||||
{
|
||||
"anuvyklack/hydra.nvim",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
-- Die Konfigurationen folgen im nächsten Schritt
|
||||
require("custom.hydra")
|
||||
end,
|
||||
},
|
||||
|
||||
-- Window-Picker
|
||||
{
|
||||
"s1n7ax/nvim-window-picker",
|
||||
version = "v2.*",
|
||||
config = function()
|
||||
require("window-picker").setup({
|
||||
filter_rules = {
|
||||
-- Filtere diese Fenstertypen aus
|
||||
bo = {
|
||||
filetype = { "neo-tree", "neo-tree-popup", "notify", "quickfix" },
|
||||
buftype = { "terminal" },
|
||||
},
|
||||
},
|
||||
highlights = {
|
||||
statusline = {
|
||||
focused = {
|
||||
fg = "#000000",
|
||||
bg = "#E35E4F",
|
||||
},
|
||||
unfocused = {
|
||||
fg = "#000000",
|
||||
bg = "#44CC41",
|
||||
},
|
||||
},
|
||||
},
|
||||
picker_config = {
|
||||
statusline_winbar_picker = {
|
||||
-- Verwende Buchstaben des Alphabets für die Fensterauswahl
|
||||
selection_chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
-- You can add your own plugins here or in other files in this directory!
|
||||
-- I promise not to create any merge conflicts in this directory :)
|
||||
--
|
||||
-- See the kickstart.nvim README for more information
|
||||
return {}
|
||||
@@ -1,52 +0,0 @@
|
||||
--[[
|
||||
--
|
||||
-- This file is not required for your own configuration,
|
||||
-- but helps people determine if their system is setup correctly.
|
||||
--
|
||||
--]]
|
||||
|
||||
local check_version = function()
|
||||
local verstr = tostring(vim.version())
|
||||
if not vim.version.ge then
|
||||
vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", verstr))
|
||||
return
|
||||
end
|
||||
|
||||
if vim.version.ge(vim.version(), '0.10-dev') then
|
||||
vim.health.ok(string.format("Neovim version is: '%s'", verstr))
|
||||
else
|
||||
vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", verstr))
|
||||
end
|
||||
end
|
||||
|
||||
local check_external_reqs = function()
|
||||
-- Basic utils: `git`, `make`, `unzip`
|
||||
for _, exe in ipairs { 'git', 'make', 'unzip', 'rg' } do
|
||||
local is_executable = vim.fn.executable(exe) == 1
|
||||
if is_executable then
|
||||
vim.health.ok(string.format("Found executable: '%s'", exe))
|
||||
else
|
||||
vim.health.warn(string.format("Could not find executable: '%s'", exe))
|
||||
end
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
return {
|
||||
check = function()
|
||||
vim.health.start 'kickstart.nvim'
|
||||
|
||||
vim.health.info [[NOTE: Not every warning is a 'must-fix' in `:checkhealth`
|
||||
|
||||
Fix only warnings for plugins and languages you intend to use.
|
||||
Mason will give warnings for languages that are not installed.
|
||||
You do not need to install, unless you want to use those languages!]]
|
||||
|
||||
local uv = vim.uv or vim.loop
|
||||
vim.health.info('System Information: ' .. vim.inspect(uv.os_uname()))
|
||||
|
||||
check_version()
|
||||
check_external_reqs()
|
||||
end,
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
-- autopairs
|
||||
-- https://github.com/windwp/nvim-autopairs
|
||||
|
||||
return {
|
||||
'windwp/nvim-autopairs',
|
||||
event = 'InsertEnter',
|
||||
-- Optional dependency
|
||||
dependencies = { 'hrsh7th/nvim-cmp' },
|
||||
config = function()
|
||||
require('nvim-autopairs').setup {}
|
||||
-- If you want to automatically add `(` after selecting a function or method
|
||||
local cmp_autopairs = require 'nvim-autopairs.completion.cmp'
|
||||
local cmp = require 'cmp'
|
||||
cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done())
|
||||
end,
|
||||
}
|
||||
@@ -1,148 +0,0 @@
|
||||
-- debug.lua
|
||||
--
|
||||
-- Shows how to use the DAP plugin to debug your code.
|
||||
--
|
||||
-- Primarily focused on configuring the debugger for Go, but can
|
||||
-- be extended to other languages as well. That's why it's called
|
||||
-- kickstart.nvim and not kitchen-sink.nvim ;)
|
||||
|
||||
return {
|
||||
-- NOTE: Yes, you can install new plugins here!
|
||||
'mfussenegger/nvim-dap',
|
||||
-- NOTE: And you can specify dependencies as well
|
||||
dependencies = {
|
||||
-- Creates a beautiful debugger UI
|
||||
'rcarriga/nvim-dap-ui',
|
||||
|
||||
-- Required dependency for 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',
|
||||
},
|
||||
keys = {
|
||||
-- Basic debugging keymaps, feel free to change to your liking!
|
||||
{
|
||||
'<F5>',
|
||||
function()
|
||||
require('dap').continue()
|
||||
end,
|
||||
desc = 'Debug: Start/Continue',
|
||||
},
|
||||
{
|
||||
'<F1>',
|
||||
function()
|
||||
require('dap').step_into()
|
||||
end,
|
||||
desc = 'Debug: Step Into',
|
||||
},
|
||||
{
|
||||
'<F2>',
|
||||
function()
|
||||
require('dap').step_over()
|
||||
end,
|
||||
desc = 'Debug: Step Over',
|
||||
},
|
||||
{
|
||||
'<F3>',
|
||||
function()
|
||||
require('dap').step_out()
|
||||
end,
|
||||
desc = 'Debug: Step Out',
|
||||
},
|
||||
{
|
||||
'<leader>b',
|
||||
function()
|
||||
require('dap').toggle_breakpoint()
|
||||
end,
|
||||
desc = 'Debug: Toggle Breakpoint',
|
||||
},
|
||||
{
|
||||
'<leader>B',
|
||||
function()
|
||||
require('dap').set_breakpoint(vim.fn.input 'Breakpoint condition: ')
|
||||
end,
|
||||
desc = 'Debug: Set Breakpoint',
|
||||
},
|
||||
-- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception.
|
||||
{
|
||||
'<F7>',
|
||||
function()
|
||||
require('dapui').toggle()
|
||||
end,
|
||||
desc = 'Debug: See last session result.',
|
||||
},
|
||||
},
|
||||
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_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',
|
||||
},
|
||||
}
|
||||
|
||||
-- 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 = '⏏',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
-- Change breakpoint icons
|
||||
-- vim.api.nvim_set_hl(0, 'DapBreak', { fg = '#e51400' })
|
||||
-- vim.api.nvim_set_hl(0, 'DapStop', { fg = '#ffcc00' })
|
||||
-- local breakpoint_icons = vim.g.have_nerd_font
|
||||
-- and { Breakpoint = '', BreakpointCondition = '', BreakpointRejected = '', LogPoint = '', Stopped = '' }
|
||||
-- or { Breakpoint = '●', BreakpointCondition = '⊜', BreakpointRejected = '⊘', LogPoint = '◆', Stopped = '⭔' }
|
||||
-- for type, icon in pairs(breakpoint_icons) do
|
||||
-- local tp = 'Dap' .. type
|
||||
-- local hl = (type == 'Stopped') and 'DapStop' or 'DapBreak'
|
||||
-- vim.fn.sign_define(tp, { text = icon, texthl = hl, numhl = hl })
|
||||
-- end
|
||||
|
||||
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 {
|
||||
delve = {
|
||||
-- On Windows delve must be run attached or it crashes.
|
||||
-- See https://github.com/leoluz/nvim-dap-go/blob/main/README.md#configuring
|
||||
detached = vim.fn.has 'win32' == 0,
|
||||
},
|
||||
}
|
||||
end,
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
-- Adds git related signs to the gutter, as well as utilities for managing changes
|
||||
-- NOTE: gitsigns is already included in init.lua but contains only the base
|
||||
-- config. This will add also the recommended keymaps.
|
||||
|
||||
return {
|
||||
{
|
||||
'lewis6991/gitsigns.nvim',
|
||||
opts = {
|
||||
on_attach = function(bufnr)
|
||||
local gitsigns = require 'gitsigns'
|
||||
|
||||
local function map(mode, l, r, opts)
|
||||
opts = opts or {}
|
||||
opts.buffer = bufnr
|
||||
vim.keymap.set(mode, l, r, opts)
|
||||
end
|
||||
|
||||
-- Navigation
|
||||
map('n', ']c', function()
|
||||
if vim.wo.diff then
|
||||
vim.cmd.normal { ']c', bang = true }
|
||||
else
|
||||
gitsigns.nav_hunk 'next'
|
||||
end
|
||||
end, { desc = 'Jump to next git [c]hange' })
|
||||
|
||||
map('n', '[c', function()
|
||||
if vim.wo.diff then
|
||||
vim.cmd.normal { '[c', bang = true }
|
||||
else
|
||||
gitsigns.nav_hunk 'prev'
|
||||
end
|
||||
end, { desc = 'Jump to previous git [c]hange' })
|
||||
|
||||
-- Actions
|
||||
-- visual mode
|
||||
map('v', '<leader>hs', function()
|
||||
gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' }
|
||||
end, { desc = 'git [s]tage hunk' })
|
||||
map('v', '<leader>hr', function()
|
||||
gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' }
|
||||
end, { desc = 'git [r]eset hunk' })
|
||||
-- normal mode
|
||||
map('n', '<leader>hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' })
|
||||
map('n', '<leader>hr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' })
|
||||
map('n', '<leader>hS', gitsigns.stage_buffer, { desc = 'git [S]tage buffer' })
|
||||
map('n', '<leader>hu', gitsigns.stage_hunk, { desc = 'git [u]ndo stage hunk' })
|
||||
map('n', '<leader>hR', gitsigns.reset_buffer, { desc = 'git [R]eset buffer' })
|
||||
map('n', '<leader>hp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' })
|
||||
map('n', '<leader>hb', gitsigns.blame_line, { desc = 'git [b]lame line' })
|
||||
map('n', '<leader>hd', gitsigns.diffthis, { desc = 'git [d]iff against index' })
|
||||
map('n', '<leader>hD', function()
|
||||
gitsigns.diffthis '@'
|
||||
end, { desc = 'git [D]iff against last commit' })
|
||||
-- Toggles
|
||||
map('n', '<leader>tb', gitsigns.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' })
|
||||
map('n', '<leader>tD', gitsigns.preview_hunk_inline, { desc = '[T]oggle git show [D]eleted' })
|
||||
end,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
return {
|
||||
{ -- Add indentation guides even on blank lines
|
||||
'lukas-reineke/indent-blankline.nvim',
|
||||
-- Enable `lukas-reineke/indent-blankline.nvim`
|
||||
-- See `:help ibl`
|
||||
main = 'ibl',
|
||||
opts = {},
|
||||
},
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
return {
|
||||
|
||||
{ -- Linting
|
||||
'mfussenegger/nvim-lint',
|
||||
event = { 'BufReadPre', 'BufNewFile' },
|
||||
config = function()
|
||||
local lint = require 'lint'
|
||||
lint.linters_by_ft = {
|
||||
markdown = { 'markdownlint' },
|
||||
}
|
||||
|
||||
-- To allow other plugins to add linters to require('lint').linters_by_ft,
|
||||
-- instead set linters_by_ft like this:
|
||||
-- lint.linters_by_ft = lint.linters_by_ft or {}
|
||||
-- lint.linters_by_ft['markdown'] = { 'markdownlint' }
|
||||
--
|
||||
-- However, note that this will enable a set of default linters,
|
||||
-- which will cause errors unless these tools are available:
|
||||
-- {
|
||||
-- clojure = { "clj-kondo" },
|
||||
-- dockerfile = { "hadolint" },
|
||||
-- inko = { "inko" },
|
||||
-- janet = { "janet" },
|
||||
-- json = { "jsonlint" },
|
||||
-- markdown = { "vale" },
|
||||
-- rst = { "vale" },
|
||||
-- ruby = { "ruby" },
|
||||
-- terraform = { "tflint" },
|
||||
-- text = { "vale" }
|
||||
-- }
|
||||
--
|
||||
-- You can disable the default linters by setting their filetypes to nil:
|
||||
-- lint.linters_by_ft['clojure'] = nil
|
||||
-- lint.linters_by_ft['dockerfile'] = nil
|
||||
-- lint.linters_by_ft['inko'] = nil
|
||||
-- lint.linters_by_ft['janet'] = nil
|
||||
-- lint.linters_by_ft['json'] = nil
|
||||
-- lint.linters_by_ft['markdown'] = nil
|
||||
-- lint.linters_by_ft['rst'] = nil
|
||||
-- lint.linters_by_ft['ruby'] = nil
|
||||
-- lint.linters_by_ft['terraform'] = nil
|
||||
-- lint.linters_by_ft['text'] = nil
|
||||
|
||||
-- Create autocommand which carries out the actual linting
|
||||
-- on the specified events.
|
||||
local lint_augroup = vim.api.nvim_create_augroup('lint', { clear = true })
|
||||
vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, {
|
||||
group = lint_augroup,
|
||||
callback = function()
|
||||
-- Only run the linter in buffers that you can modify in order to
|
||||
-- avoid superfluous noise, notably within the handy LSP pop-ups that
|
||||
-- describe the hovered symbol using Markdown.
|
||||
if vim.opt_local.modifiable:get() then
|
||||
lint.try_lint()
|
||||
end
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
-- Neo-tree is a Neovim plugin to browse the file system
|
||||
-- https://github.com/nvim-neo-tree/neo-tree.nvim
|
||||
|
||||
return {
|
||||
'nvim-neo-tree/neo-tree.nvim',
|
||||
version = '*',
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended
|
||||
'MunifTanjim/nui.nvim',
|
||||
},
|
||||
cmd = 'Neotree',
|
||||
keys = {
|
||||
{ '\\', ':Neotree reveal<CR>', desc = 'NeoTree reveal', silent = true },
|
||||
},
|
||||
opts = {
|
||||
filesystem = {
|
||||
window = {
|
||||
mappings = {
|
||||
['\\'] = 'close_window',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
147
.config/nvim/lua/plugins/completion.lua
Normal file
147
.config/nvim/lua/plugins/completion.lua
Normal file
@@ -0,0 +1,147 @@
|
||||
-- ============================================================================
|
||||
-- Completion - nvim-cmp Configuration
|
||||
-- ============================================================================
|
||||
|
||||
return {
|
||||
{
|
||||
'hrsh7th/nvim-cmp',
|
||||
event = 'InsertEnter',
|
||||
dependencies = {
|
||||
-- Snippet Engine
|
||||
{
|
||||
'L3MON4D3/LuaSnip',
|
||||
build = (function()
|
||||
return 'make install_jsregexp'
|
||||
end)(),
|
||||
dependencies = {
|
||||
'rafamadriz/friendly-snippets',
|
||||
},
|
||||
},
|
||||
'saadparwaiz1/cmp_luasnip',
|
||||
|
||||
-- Completion Sources
|
||||
'hrsh7th/cmp-nvim-lsp',
|
||||
'hrsh7th/cmp-buffer',
|
||||
'hrsh7th/cmp-path',
|
||||
},
|
||||
config = function()
|
||||
local cmp = require('cmp')
|
||||
local luasnip = require('luasnip')
|
||||
|
||||
-- Friendly snippets laden
|
||||
require('luasnip.loaders.from_vscode').lazy_load()
|
||||
|
||||
-- Custom Snippets für Go
|
||||
luasnip.add_snippets('go', {
|
||||
luasnip.snippet('iferr', {
|
||||
luasnip.text_node('if err != nil {'),
|
||||
luasnip.text_node({ '', '\treturn err' }),
|
||||
luasnip.text_node({ '', '}' }),
|
||||
}),
|
||||
})
|
||||
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
completion = { completeopt = 'menu,menuone,noinsert' },
|
||||
|
||||
-- Keymaps
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
-- Select next/prev item
|
||||
['<C-n>'] = cmp.mapping.select_next_item(),
|
||||
['<C-p>'] = cmp.mapping.select_prev_item(),
|
||||
|
||||
-- Scroll docs
|
||||
['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
|
||||
-- Confirm completion
|
||||
['<CR>'] = cmp.mapping.confirm({ select = true }),
|
||||
|
||||
-- Manual trigger
|
||||
['<C-Space>'] = cmp.mapping.complete({}),
|
||||
|
||||
-- Tab für Snippet forward/backward + completion
|
||||
['<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 (Priorität von oben nach unten)
|
||||
sources = {
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'luasnip' },
|
||||
{ name = 'buffer' },
|
||||
{ name = 'path' },
|
||||
},
|
||||
|
||||
-- Window styling
|
||||
window = {
|
||||
completion = cmp.config.window.bordered(),
|
||||
documentation = cmp.config.window.bordered(),
|
||||
},
|
||||
|
||||
-- Formatting
|
||||
formatting = {
|
||||
fields = { 'kind', 'abbr', 'menu' },
|
||||
format = function(entry, item)
|
||||
local icons = {
|
||||
Text = '',
|
||||
Method = '',
|
||||
Function = '',
|
||||
Constructor = '',
|
||||
Field = '',
|
||||
Variable = '',
|
||||
Class = '',
|
||||
Interface = '',
|
||||
Module = '',
|
||||
Property = '',
|
||||
Unit = '',
|
||||
Value = '',
|
||||
Enum = '',
|
||||
Keyword = '',
|
||||
Snippet = '',
|
||||
Color = '',
|
||||
File = '',
|
||||
Reference = '',
|
||||
Folder = '',
|
||||
EnumMember = '',
|
||||
Constant = '',
|
||||
Struct = '',
|
||||
Event = '',
|
||||
Operator = '',
|
||||
TypeParameter = '',
|
||||
}
|
||||
item.kind = string.format('%s %s', icons[item.kind] or '', item.kind)
|
||||
item.menu = ({
|
||||
nvim_lsp = '[LSP]',
|
||||
luasnip = '[Snippet]',
|
||||
buffer = '[Buffer]',
|
||||
path = '[Path]',
|
||||
})[entry.source.name]
|
||||
return item
|
||||
end,
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
67
.config/nvim/lua/plugins/editor.lua
Normal file
67
.config/nvim/lua/plugins/editor.lua
Normal file
@@ -0,0 +1,67 @@
|
||||
-- ============================================================================
|
||||
-- Editor - Quality of Life Plugins
|
||||
-- ============================================================================
|
||||
|
||||
return {
|
||||
-- Auto pairs
|
||||
{
|
||||
'windwp/nvim-autopairs',
|
||||
event = 'InsertEnter',
|
||||
config = true,
|
||||
},
|
||||
|
||||
-- Comment.nvim
|
||||
{
|
||||
'numToStr/Comment.nvim',
|
||||
event = { 'BufReadPost', 'BufNewFile' },
|
||||
dependencies = {
|
||||
'JoosepAlviste/nvim-ts-context-commentstring',
|
||||
},
|
||||
config = function()
|
||||
require('Comment').setup({
|
||||
pre_hook = require('ts_context_commentstring.integrations.comment_nvim').create_pre_hook(),
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- Surround
|
||||
{
|
||||
'kylechui/nvim-surround',
|
||||
version = '*',
|
||||
event = 'VeryLazy',
|
||||
config = true,
|
||||
},
|
||||
|
||||
-- Better escape
|
||||
{
|
||||
'max397574/better-escape.nvim',
|
||||
event = 'InsertEnter',
|
||||
config = function()
|
||||
require('better_escape').setup({
|
||||
mapping = { 'jk', 'jj' },
|
||||
timeout = 200,
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- Which-key (zeigt Keybindings)
|
||||
{
|
||||
'folke/which-key.nvim',
|
||||
event = 'VeryLazy',
|
||||
init = function()
|
||||
vim.o.timeout = true
|
||||
vim.o.timeoutlen = 300
|
||||
end,
|
||||
opts = {
|
||||
-- Deine Leader-Gruppen
|
||||
spec = {
|
||||
{ '<leader>f', group = 'Find' },
|
||||
{ '<leader>g', group = 'Git' },
|
||||
{ '<leader>h', group = 'Hunk' },
|
||||
{ '<leader>t', group = 'Toggle' },
|
||||
{ '<leader>c', group = 'Code' },
|
||||
{ '<leader>w', group = 'Workspace' },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
77
.config/nvim/lua/plugins/formatting.lua
Normal file
77
.config/nvim/lua/plugins/formatting.lua
Normal file
@@ -0,0 +1,77 @@
|
||||
-- ============================================================================
|
||||
-- Formatting - conform.nvim
|
||||
-- ============================================================================
|
||||
|
||||
return {
|
||||
{
|
||||
'stevearc/conform.nvim',
|
||||
event = { 'BufWritePre' },
|
||||
cmd = { 'ConformInfo' },
|
||||
keys = {
|
||||
{
|
||||
'<leader>cf',
|
||||
function()
|
||||
require('conform').format({ async = true, lsp_fallback = true })
|
||||
end,
|
||||
mode = '',
|
||||
desc = 'Format buffer',
|
||||
},
|
||||
},
|
||||
opts = {
|
||||
notify_on_error = false,
|
||||
format_on_save = function(bufnr)
|
||||
-- Disable with a global or buffer-local variable
|
||||
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
|
||||
return
|
||||
end
|
||||
return {
|
||||
timeout_ms = 500,
|
||||
lsp_fallback = true,
|
||||
}
|
||||
end,
|
||||
formatters_by_ft = {
|
||||
-- TypeScript/JavaScript
|
||||
javascript = { 'prettier' },
|
||||
typescript = { 'prettier' },
|
||||
javascriptreact = { 'prettier' },
|
||||
typescriptreact = { 'prettier' },
|
||||
|
||||
-- Go
|
||||
go = { 'gofumpt', 'goimports' },
|
||||
|
||||
-- Web
|
||||
html = { 'prettier' },
|
||||
css = { 'prettier' },
|
||||
json = { 'prettier' },
|
||||
yaml = { 'prettier' },
|
||||
markdown = { 'prettier' },
|
||||
|
||||
-- Lua
|
||||
lua = { 'stylua' },
|
||||
|
||||
-- Shell
|
||||
sh = { 'shfmt' },
|
||||
},
|
||||
},
|
||||
init = function()
|
||||
-- Autoformat toggle commands
|
||||
vim.api.nvim_create_user_command('FormatDisable', function(args)
|
||||
if args.bang then
|
||||
vim.b.disable_autoformat = true
|
||||
else
|
||||
vim.g.disable_autoformat = true
|
||||
end
|
||||
end, {
|
||||
desc = 'Disable autoformat-on-save',
|
||||
bang = true,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_user_command('FormatEnable', function()
|
||||
vim.b.disable_autoformat = false
|
||||
vim.g.disable_autoformat = false
|
||||
end, {
|
||||
desc = 'Re-enable autoformat-on-save',
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
72
.config/nvim/lua/plugins/git.lua
Normal file
72
.config/nvim/lua/plugins/git.lua
Normal file
@@ -0,0 +1,72 @@
|
||||
-- ============================================================================
|
||||
-- Git Integration
|
||||
-- ============================================================================
|
||||
|
||||
return {
|
||||
-- Gitsigns - Git gutter signs
|
||||
{
|
||||
'lewis6991/gitsigns.nvim',
|
||||
event = { 'BufReadPre', 'BufNewFile' },
|
||||
opts = {
|
||||
signs = {
|
||||
add = { text = '│' },
|
||||
change = { text = '│' },
|
||||
delete = { text = '_' },
|
||||
topdelete = { text = '‾' },
|
||||
changedelete = { text = '~' },
|
||||
untracked = { text = '┆' },
|
||||
},
|
||||
on_attach = function(bufnr)
|
||||
local gs = package.loaded.gitsigns
|
||||
|
||||
local function map(mode, l, r, opts)
|
||||
opts = opts or {}
|
||||
opts.buffer = bufnr
|
||||
vim.keymap.set(mode, l, r, opts)
|
||||
end
|
||||
|
||||
-- Navigation
|
||||
map('n', ']c', function()
|
||||
if vim.wo.diff then return ']c' end
|
||||
vim.schedule(function() gs.next_hunk() end)
|
||||
return '<Ignore>'
|
||||
end, { expr = true, desc = 'Next git hunk' })
|
||||
|
||||
map('n', '[c', function()
|
||||
if vim.wo.diff then return '[c' end
|
||||
vim.schedule(function() gs.prev_hunk() end)
|
||||
return '<Ignore>'
|
||||
end, { expr = true, desc = 'Previous git hunk' })
|
||||
|
||||
-- Actions
|
||||
map('n', '<leader>hs', gs.stage_hunk, { desc = 'Stage hunk' })
|
||||
map('n', '<leader>hr', gs.reset_hunk, { desc = 'Reset hunk' })
|
||||
map('v', '<leader>hs', function() gs.stage_hunk({ vim.fn.line('.'), vim.fn.line('v') }) end, { desc = 'Stage hunk' })
|
||||
map('v', '<leader>hr', function() gs.reset_hunk({ vim.fn.line('.'), vim.fn.line('v') }) end, { desc = 'Reset hunk' })
|
||||
map('n', '<leader>hS', gs.stage_buffer, { desc = 'Stage buffer' })
|
||||
map('n', '<leader>hu', gs.undo_stage_hunk, { desc = 'Undo stage hunk' })
|
||||
map('n', '<leader>hR', gs.reset_buffer, { desc = 'Reset buffer' })
|
||||
map('n', '<leader>hp', gs.preview_hunk, { desc = 'Preview hunk' })
|
||||
map('n', '<leader>hb', function() gs.blame_line({ full = true }) end, { desc = 'Blame line' })
|
||||
map('n', '<leader>tb', gs.toggle_current_line_blame, { desc = 'Toggle blame line' })
|
||||
map('n', '<leader>hd', gs.diffthis, { desc = 'Diff this' })
|
||||
map('n', '<leader>hD', function() gs.diffthis('~') end, { desc = 'Diff this ~' })
|
||||
map('n', '<leader>td', gs.toggle_deleted, { desc = 'Toggle deleted' })
|
||||
end,
|
||||
},
|
||||
},
|
||||
|
||||
-- Fugitive - Git commands
|
||||
{
|
||||
'tpope/vim-fugitive',
|
||||
cmd = { 'Git', 'G', 'Gdiffsplit', 'Gread', 'Gwrite', 'Ggrep', 'GMove', 'GDelete', 'GBrowse', 'GRemove', 'GRename', 'Glgrep', 'Gedit' },
|
||||
keys = {
|
||||
{ '<leader>gs', '<cmd>Git<cr>', desc = 'Git status' },
|
||||
{ '<leader>gc', '<cmd>Git commit<cr>', desc = 'Git commit' },
|
||||
{ '<leader>gp', '<cmd>Git push<cr>', desc = 'Git push' },
|
||||
{ '<leader>gl', '<cmd>Git log<cr>', desc = 'Git log' },
|
||||
{ '<leader>gb', '<cmd>Git blame<cr>', desc = 'Git blame' },
|
||||
{ '<leader>gd', '<cmd>Gdiffsplit<cr>', desc = 'Git diff' },
|
||||
},
|
||||
},
|
||||
}
|
||||
31
.config/nvim/lua/plugins/harpoon.lua
Normal file
31
.config/nvim/lua/plugins/harpoon.lua
Normal file
@@ -0,0 +1,31 @@
|
||||
-- ============================================================================
|
||||
-- Harpoon - Schneller File Wechsel
|
||||
-- ============================================================================
|
||||
|
||||
return {
|
||||
{
|
||||
'ThePrimeagen/harpoon',
|
||||
branch = 'harpoon2',
|
||||
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||
config = function()
|
||||
local harpoon = require('harpoon')
|
||||
|
||||
-- REQUIRED: Setup
|
||||
harpoon:setup()
|
||||
|
||||
-- Basic Keymaps
|
||||
vim.keymap.set('n', '<leader>a', function() harpoon:list():add() end, { desc = 'Harpoon: Add file' })
|
||||
vim.keymap.set('n', '<leader>h', function() harpoon.ui:toggle_quick_menu(harpoon:list()) end, { desc = 'Harpoon: Menu' })
|
||||
|
||||
-- Quick file navigation (1-4)
|
||||
vim.keymap.set('n', '<C-j>', function() harpoon:list():select(1) end, { desc = 'Harpoon: File 1' })
|
||||
vim.keymap.set('n', '<C-k>', function() harpoon:list():select(2) end, { desc = 'Harpoon: File 2' })
|
||||
vim.keymap.set('n', '<C-l>', function() harpoon:list():select(3) end, { desc = 'Harpoon: File 3' })
|
||||
vim.keymap.set('n', '<C-;>', function() harpoon:list():select(4) end, { desc = 'Harpoon: File 4' })
|
||||
|
||||
-- Toggle previous & next buffers stored within Harpoon list
|
||||
vim.keymap.set('n', '<C-S-P>', function() harpoon:list():prev() end, { desc = 'Harpoon: Previous' })
|
||||
vim.keymap.set('n', '<C-S-N>', function() harpoon:list():next() end, { desc = 'Harpoon: Next' })
|
||||
end,
|
||||
},
|
||||
}
|
||||
276
.config/nvim/lua/plugins/lsp.lua
Normal file
276
.config/nvim/lua/plugins/lsp.lua
Normal file
@@ -0,0 +1,276 @@
|
||||
-- ============================================================================
|
||||
-- LSP Configuration - TypeScript/Playwright & Go optimiert
|
||||
-- ============================================================================
|
||||
|
||||
return {
|
||||
{
|
||||
'neovim/nvim-lspconfig',
|
||||
event = { 'BufReadPre', 'BufNewFile' },
|
||||
dependencies = {
|
||||
-- Mason: LSP Server installer
|
||||
'williamboman/mason.nvim',
|
||||
'williamboman/mason-lspconfig.nvim',
|
||||
|
||||
-- Status updates für LSP
|
||||
{ 'j-hui/fidget.nvim', opts = {} },
|
||||
|
||||
-- Neodev für Neovim config entwicklung
|
||||
{ 'folke/neodev.nvim', opts = {} },
|
||||
},
|
||||
config = function()
|
||||
-- LSP Capabilities für completion
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
|
||||
|
||||
-- Mason Setup
|
||||
require('mason').setup({
|
||||
ui = {
|
||||
border = 'rounded',
|
||||
icons = {
|
||||
package_installed = '✓',
|
||||
package_pending = '➜',
|
||||
package_uninstalled = '✗'
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
-- Mason-LSPConfig: Automatische Server Installation
|
||||
require('mason-lspconfig').setup({
|
||||
ensure_installed = {
|
||||
-- Primary (TypeScript/Playwright)
|
||||
'ts_ls', -- TypeScript/JavaScript
|
||||
|
||||
-- Secondary (Go)
|
||||
'gopls', -- Go
|
||||
|
||||
-- Supporting
|
||||
'lua_ls', -- Lua (für Neovim config)
|
||||
'html', -- HTML
|
||||
'cssls', -- CSS
|
||||
'jsonls', -- JSON
|
||||
'yamlls', -- YAML
|
||||
'dockerls', -- Dockerfile
|
||||
'docker_compose_language_service', -- Docker Compose
|
||||
},
|
||||
})
|
||||
|
||||
-- LSP Keybindings (nur wenn LSP attached)
|
||||
vim.api.nvim_create_autocmd('LspAttach', {
|
||||
group = vim.api.nvim_create_augroup('lsp-attach', { clear = true }),
|
||||
callback = function(event)
|
||||
local map = function(keys, func, desc)
|
||||
vim.keymap.set('n', keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc })
|
||||
end
|
||||
|
||||
-- Navigation
|
||||
map('gd', require('telescope.builtin').lsp_definitions, 'Goto Definition')
|
||||
map('gr', require('telescope.builtin').lsp_references, 'Goto References')
|
||||
map('gI', require('telescope.builtin').lsp_implementations, 'Goto Implementation')
|
||||
map('gD', vim.lsp.buf.declaration, 'Goto Declaration')
|
||||
map('<leader>D', require('telescope.builtin').lsp_type_definitions, 'Type Definition')
|
||||
|
||||
-- Documentation
|
||||
map('K', vim.lsp.buf.hover, 'Hover Documentation')
|
||||
map('<C-k>', vim.lsp.buf.signature_help, 'Signature Help')
|
||||
|
||||
-- Actions
|
||||
map('<leader>ca', vim.lsp.buf.code_action, 'Code Action')
|
||||
map('<leader>rn', vim.lsp.buf.rename, 'Rename')
|
||||
|
||||
-- Workspace
|
||||
map('<leader>ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, 'Workspace Symbols')
|
||||
|
||||
-- Highlight references unter cursor
|
||||
local client = vim.lsp.get_client_by_id(event.data.client_id)
|
||||
if client and client.server_capabilities.documentHighlightProvider then
|
||||
local highlight_augroup = vim.api.nvim_create_augroup('lsp-highlight', { clear = false })
|
||||
vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, {
|
||||
buffer = event.buf,
|
||||
group = highlight_augroup,
|
||||
callback = vim.lsp.buf.document_highlight,
|
||||
})
|
||||
vim.api.nvim_create_autocmd({ 'CursorMoved', 'CursorMovedI' }, {
|
||||
buffer = event.buf,
|
||||
group = highlight_augroup,
|
||||
callback = vim.lsp.buf.clear_references,
|
||||
})
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
-- ========== Server Configurations ==========
|
||||
|
||||
-- TypeScript/JavaScript (ts_ls)
|
||||
vim.lsp.config('ts_ls', {
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
typescript = {
|
||||
inlayHints = {
|
||||
includeInlayParameterNameHints = 'all',
|
||||
includeInlayParameterNameHintsWhenArgumentMatchesName = false,
|
||||
includeInlayFunctionParameterTypeHints = true,
|
||||
includeInlayVariableTypeHints = true,
|
||||
includeInlayPropertyDeclarationTypeHints = true,
|
||||
includeInlayFunctionLikeReturnTypeHints = true,
|
||||
includeInlayEnumMemberValueHints = true,
|
||||
},
|
||||
},
|
||||
javascript = {
|
||||
inlayHints = {
|
||||
includeInlayParameterNameHints = 'all',
|
||||
includeInlayParameterNameHintsWhenArgumentMatchesName = false,
|
||||
includeInlayFunctionParameterTypeHints = true,
|
||||
includeInlayVariableTypeHints = true,
|
||||
includeInlayPropertyDeclarationTypeHints = true,
|
||||
includeInlayFunctionLikeReturnTypeHints = true,
|
||||
includeInlayEnumMemberValueHints = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- Go (gopls)
|
||||
vim.lsp.config('gopls', {
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
gopls = {
|
||||
gofumpt = true,
|
||||
codelenses = {
|
||||
gc_details = false,
|
||||
generate = true,
|
||||
regenerate_cgo = true,
|
||||
run_govulncheck = true,
|
||||
test = true,
|
||||
tidy = true,
|
||||
upgrade_dependency = true,
|
||||
vendor = true,
|
||||
},
|
||||
hints = {
|
||||
assignVariableTypes = true,
|
||||
compositeLiteralFields = true,
|
||||
compositeLiteralTypes = true,
|
||||
constantValues = true,
|
||||
functionTypeParameters = true,
|
||||
parameterNames = true,
|
||||
rangeVariableTypes = true,
|
||||
},
|
||||
analyses = {
|
||||
fieldalignment = true,
|
||||
nilness = true,
|
||||
unusedparams = true,
|
||||
unusedwrite = true,
|
||||
useany = true,
|
||||
},
|
||||
usePlaceholders = true,
|
||||
completeUnimported = true,
|
||||
staticcheck = true,
|
||||
directoryFilters = { '-.git', '-.vscode', '-.idea', '-.vscode-test', '-node_modules' },
|
||||
semanticTokens = true,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- Lua (lua_ls)
|
||||
vim.lsp.config('lua_ls', {
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
Lua = {
|
||||
completion = {
|
||||
callSnippet = 'Replace',
|
||||
},
|
||||
diagnostics = {
|
||||
globals = { 'vim' },
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- JSON mit Schema Support
|
||||
vim.lsp.config('jsonls', {
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
json = {
|
||||
schemas = require('schemastore').json.schemas(),
|
||||
validate = { enable = true },
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- YAML mit Schema Support
|
||||
vim.lsp.config('yamlls', {
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
yaml = {
|
||||
schemaStore = {
|
||||
enable = false,
|
||||
url = '',
|
||||
},
|
||||
schemas = require('schemastore').yaml.schemas(),
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- HTML
|
||||
vim.lsp.config('html', {
|
||||
capabilities = capabilities,
|
||||
})
|
||||
|
||||
-- CSS
|
||||
vim.lsp.config('cssls', {
|
||||
capabilities = capabilities,
|
||||
})
|
||||
|
||||
-- Docker
|
||||
vim.lsp.config('dockerls', {
|
||||
capabilities = capabilities,
|
||||
})
|
||||
|
||||
vim.lsp.config('docker_compose_language_service', {
|
||||
capabilities = capabilities,
|
||||
})
|
||||
|
||||
-- ========== Diagnostics Configuration ==========
|
||||
|
||||
vim.diagnostic.config({
|
||||
virtual_text = {
|
||||
prefix = '●',
|
||||
source = 'if_many',
|
||||
},
|
||||
signs = true,
|
||||
underline = true,
|
||||
update_in_insert = false,
|
||||
severity_sort = true,
|
||||
float = {
|
||||
border = 'rounded',
|
||||
source = 'always',
|
||||
header = '',
|
||||
prefix = '',
|
||||
},
|
||||
})
|
||||
|
||||
-- Diagnostic signs
|
||||
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 = '' })
|
||||
end
|
||||
|
||||
-- LSP Hover border
|
||||
vim.lsp.handlers['textDocument/hover'] = vim.lsp.with(
|
||||
vim.lsp.handlers.hover,
|
||||
{ border = 'rounded' }
|
||||
)
|
||||
|
||||
vim.lsp.handlers['textDocument/signatureHelp'] = vim.lsp.with(
|
||||
vim.lsp.handlers.signature_help,
|
||||
{ border = 'rounded' }
|
||||
)
|
||||
end,
|
||||
},
|
||||
|
||||
-- SchemaStore für JSON/YAML
|
||||
{
|
||||
'b0o/schemastore.nvim',
|
||||
lazy = true,
|
||||
},
|
||||
}
|
||||
113
.config/nvim/lua/plugins/neotree.lua
Normal file
113
.config/nvim/lua/plugins/neotree.lua
Normal file
@@ -0,0 +1,113 @@
|
||||
-- ============================================================================
|
||||
-- Neo-tree - File Explorer
|
||||
-- ============================================================================
|
||||
|
||||
return {
|
||||
{
|
||||
'nvim-neo-tree/neo-tree.nvim',
|
||||
version = '*',
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
'nvim-tree/nvim-web-devicons',
|
||||
'MunifTanjim/nui.nvim',
|
||||
},
|
||||
cmd = 'Neotree',
|
||||
keys = {
|
||||
{ '<leader>e', '<cmd>Neotree toggle right<CR>', desc = 'Explorer toggle' },
|
||||
{ '<leader>ef', '<cmd>Neotree focus filesystem right<CR>', desc = 'Explorer focus' },
|
||||
{ '<leader>eb', '<cmd>Neotree focus buffers right<CR>', desc = 'Explorer buffers' },
|
||||
{ '<leader>eg', '<cmd>Neotree focus git_status right<CR>', desc = 'Explorer git' },
|
||||
},
|
||||
config = function()
|
||||
require('neo-tree').setup({
|
||||
close_if_last_window = false,
|
||||
popup_border_style = 'rounded',
|
||||
enable_git_status = true,
|
||||
enable_diagnostics = true,
|
||||
|
||||
default_component_configs = {
|
||||
indent = {
|
||||
indent_size = 2,
|
||||
padding = 1,
|
||||
with_markers = true,
|
||||
indent_marker = '│',
|
||||
last_indent_marker = '└',
|
||||
with_expanders = true,
|
||||
expander_collapsed = '',
|
||||
expander_expanded = '',
|
||||
},
|
||||
icon = {
|
||||
folder_closed = '',
|
||||
folder_open = '',
|
||||
folder_empty = '',
|
||||
default = '*',
|
||||
},
|
||||
modified = {
|
||||
symbol = '[+]',
|
||||
},
|
||||
git_status = {
|
||||
symbols = {
|
||||
added = '',
|
||||
modified = '',
|
||||
deleted = '✖',
|
||||
renamed = '➜',
|
||||
untracked = '★',
|
||||
ignored = '◌',
|
||||
unstaged = '✗',
|
||||
staged = '✓',
|
||||
conflict = '',
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
window = {
|
||||
position = 'right',
|
||||
width = 35,
|
||||
mappings = {
|
||||
['<space>'] = 'none',
|
||||
['<2-LeftMouse>'] = 'open',
|
||||
['<cr>'] = 'open',
|
||||
['S'] = 'open_split',
|
||||
['s'] = 'open_vsplit',
|
||||
['t'] = 'open_tabnew',
|
||||
['C'] = 'close_node',
|
||||
['z'] = 'close_all_nodes',
|
||||
['R'] = 'refresh',
|
||||
['a'] = {
|
||||
'add',
|
||||
config = {
|
||||
show_path = 'relative'
|
||||
}
|
||||
},
|
||||
['d'] = 'delete',
|
||||
['r'] = 'rename',
|
||||
['y'] = 'copy_to_clipboard',
|
||||
['x'] = 'cut_to_clipboard',
|
||||
['p'] = 'paste_from_clipboard',
|
||||
['q'] = 'close_window',
|
||||
['?'] = 'show_help',
|
||||
}
|
||||
},
|
||||
|
||||
filesystem = {
|
||||
filtered_items = {
|
||||
visible = false,
|
||||
hide_dotfiles = false,
|
||||
hide_gitignored = false,
|
||||
hide_by_name = {
|
||||
'node_modules'
|
||||
},
|
||||
never_show = {
|
||||
'.DS_Store',
|
||||
},
|
||||
},
|
||||
follow_current_file = {
|
||||
enabled = true,
|
||||
leave_dirs_open = false,
|
||||
},
|
||||
use_libuv_file_watcher = true,
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
89
.config/nvim/lua/plugins/telescope.lua
Normal file
89
.config/nvim/lua/plugins/telescope.lua
Normal file
@@ -0,0 +1,89 @@
|
||||
-- ============================================================================
|
||||
-- Telescope - Fuzzy Finder
|
||||
-- ============================================================================
|
||||
|
||||
return {
|
||||
{
|
||||
'nvim-telescope/telescope.nvim',
|
||||
event = 'VimEnter',
|
||||
branch = '0.1.x',
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
{
|
||||
'nvim-telescope/telescope-fzf-native.nvim',
|
||||
build = 'make',
|
||||
cond = function()
|
||||
return vim.fn.executable('make') == 1
|
||||
end,
|
||||
},
|
||||
{ 'nvim-telescope/telescope-ui-select.nvim' },
|
||||
{ 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font },
|
||||
},
|
||||
config = function()
|
||||
local telescope = require('telescope')
|
||||
local actions = require('telescope.actions')
|
||||
|
||||
telescope.setup({
|
||||
defaults = {
|
||||
prompt_prefix = ' ',
|
||||
selection_caret = ' ',
|
||||
path_display = { 'truncate' },
|
||||
sorting_strategy = 'ascending',
|
||||
layout_config = {
|
||||
horizontal = {
|
||||
prompt_position = 'top',
|
||||
preview_width = 0.55,
|
||||
},
|
||||
vertical = {
|
||||
mirror = false,
|
||||
},
|
||||
width = 0.87,
|
||||
height = 0.80,
|
||||
preview_cutoff = 120,
|
||||
},
|
||||
mappings = {
|
||||
i = {
|
||||
['<C-n>'] = actions.cycle_history_next,
|
||||
['<C-p>'] = actions.cycle_history_prev,
|
||||
['<C-j>'] = actions.move_selection_next,
|
||||
['<C-k>'] = actions.move_selection_previous,
|
||||
},
|
||||
},
|
||||
},
|
||||
pickers = {
|
||||
find_files = {
|
||||
hidden = true,
|
||||
find_command = { 'rg', '--files', '--hidden', '--glob', '!**/.git/*' },
|
||||
},
|
||||
},
|
||||
extensions = {
|
||||
['ui-select'] = {
|
||||
require('telescope.themes').get_dropdown(),
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- Extensions laden
|
||||
pcall(telescope.load_extension, 'fzf')
|
||||
pcall(telescope.load_extension, 'ui-select')
|
||||
|
||||
-- Keymaps
|
||||
local builtin = require('telescope.builtin')
|
||||
vim.keymap.set('n', '<leader>ff', builtin.find_files, { desc = 'Find files' })
|
||||
vim.keymap.set('n', '<leader>fg', builtin.live_grep, { desc = 'Live grep' })
|
||||
vim.keymap.set('n', '<leader>fb', builtin.buffers, { desc = 'Buffers' })
|
||||
vim.keymap.set('n', '<leader>fh', builtin.help_tags, { desc = 'Help tags' })
|
||||
vim.keymap.set('n', '<leader>fo', builtin.oldfiles, { desc = 'Recent files' })
|
||||
vim.keymap.set('n', '<leader>fw', builtin.grep_string, { desc = 'Current word' })
|
||||
vim.keymap.set('n', '<leader>fd', builtin.diagnostics, { desc = 'Diagnostics' })
|
||||
vim.keymap.set('n', '<leader>fr', builtin.resume, { desc = 'Resume' })
|
||||
vim.keymap.set('n', '<leader>f.', builtin.oldfiles, { desc = 'Recent files' })
|
||||
vim.keymap.set('n', '<leader>/', builtin.current_buffer_fuzzy_find, { desc = 'Search in buffer' })
|
||||
|
||||
-- Git
|
||||
vim.keymap.set('n', '<leader>gc', builtin.git_commits, { desc = 'Git commits' })
|
||||
vim.keymap.set('n', '<leader>gf', builtin.git_files, { desc = 'Git files' })
|
||||
vim.keymap.set('n', '<leader>gs', builtin.git_status, { desc = 'Git status' })
|
||||
end,
|
||||
},
|
||||
}
|
||||
103
.config/nvim/lua/plugins/treesitter.lua
Normal file
103
.config/nvim/lua/plugins/treesitter.lua
Normal file
@@ -0,0 +1,103 @@
|
||||
-- ============================================================================
|
||||
-- Treesitter - Syntax Highlighting
|
||||
-- ============================================================================
|
||||
|
||||
return {
|
||||
{
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
build = ':TSUpdate',
|
||||
event = { 'BufReadPost', 'BufNewFile' },
|
||||
dependencies = {
|
||||
'nvim-treesitter/nvim-treesitter-textobjects',
|
||||
},
|
||||
config = function()
|
||||
require('nvim-treesitter.configs').setup({
|
||||
-- Parser die automatisch installiert werden
|
||||
ensure_installed = {
|
||||
-- Primary
|
||||
'typescript',
|
||||
'tsx',
|
||||
'javascript',
|
||||
'go',
|
||||
|
||||
-- Supporting
|
||||
'lua',
|
||||
'vim',
|
||||
'vimdoc',
|
||||
'html',
|
||||
'css',
|
||||
'json',
|
||||
'yaml',
|
||||
'toml',
|
||||
'markdown',
|
||||
'markdown_inline',
|
||||
'bash',
|
||||
'dockerfile',
|
||||
'git_config',
|
||||
'git_rebase',
|
||||
'gitcommit',
|
||||
'gitignore',
|
||||
},
|
||||
|
||||
-- Auto-install parser wenn fehlt
|
||||
auto_install = true,
|
||||
|
||||
-- Syntax highlighting
|
||||
highlight = {
|
||||
enable = true,
|
||||
additional_vim_regex_highlighting = false,
|
||||
},
|
||||
|
||||
-- Indentation
|
||||
indent = {
|
||||
enable = true,
|
||||
},
|
||||
|
||||
-- Incremental selection
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = '<C-space>',
|
||||
node_incremental = '<C-space>',
|
||||
scope_incremental = false,
|
||||
node_decremental = '<bs>',
|
||||
},
|
||||
},
|
||||
|
||||
-- Text objects
|
||||
textobjects = {
|
||||
select = {
|
||||
enable = true,
|
||||
lookahead = true,
|
||||
keymaps = {
|
||||
['af'] = '@function.outer',
|
||||
['if'] = '@function.inner',
|
||||
['ac'] = '@class.outer',
|
||||
['ic'] = '@class.inner',
|
||||
},
|
||||
},
|
||||
move = {
|
||||
enable = true,
|
||||
set_jumps = true,
|
||||
goto_next_start = {
|
||||
[']f'] = '@function.outer',
|
||||
[']c'] = '@class.outer',
|
||||
},
|
||||
goto_next_end = {
|
||||
[']F'] = '@function.outer',
|
||||
[']C'] = '@class.outer',
|
||||
},
|
||||
goto_previous_start = {
|
||||
['[f'] = '@function.outer',
|
||||
['[c'] = '@class.outer',
|
||||
},
|
||||
goto_previous_end = {
|
||||
['[F'] = '@function.outer',
|
||||
['[C'] = '@class.outer',
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
76
.config/nvim/lua/plugins/ui.lua
Normal file
76
.config/nvim/lua/plugins/ui.lua
Normal file
@@ -0,0 +1,76 @@
|
||||
-- ============================================================================
|
||||
-- UI - Colorscheme & Statusline
|
||||
-- ============================================================================
|
||||
|
||||
return {
|
||||
-- Tokyonight Theme
|
||||
{
|
||||
'folke/tokyonight.nvim',
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
config = function()
|
||||
require('tokyonight').setup({
|
||||
style = 'night',
|
||||
transparent = true,
|
||||
terminal_colors = true,
|
||||
styles = {
|
||||
sidebars = 'transparent',
|
||||
floats = 'transparent',
|
||||
},
|
||||
on_colors = function(colors)
|
||||
colors.bg_statusline = colors.none
|
||||
end,
|
||||
})
|
||||
vim.cmd.colorscheme('tokyonight-night')
|
||||
end,
|
||||
},
|
||||
|
||||
-- Lualine Statusline
|
||||
{
|
||||
'nvim-lualine/lualine.nvim',
|
||||
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
||||
event = 'VeryLazy',
|
||||
opts = {
|
||||
options = {
|
||||
theme = 'tokyonight',
|
||||
component_separators = { left = '', right = '' },
|
||||
section_separators = { left = '', right = '' },
|
||||
globalstatus = true,
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { 'mode' },
|
||||
lualine_b = { 'branch', 'diff', 'diagnostics' },
|
||||
lualine_c = {
|
||||
{
|
||||
'filename',
|
||||
path = 1, -- Relativer Pfad
|
||||
symbols = {
|
||||
modified = '[+]',
|
||||
readonly = '[-]',
|
||||
unnamed = '[No Name]',
|
||||
}
|
||||
}
|
||||
},
|
||||
lualine_x = { 'encoding', 'fileformat', 'filetype' },
|
||||
lualine_y = { 'progress' },
|
||||
lualine_z = { 'location' }
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- Indent guides
|
||||
{
|
||||
'lukas-reineke/indent-blankline.nvim',
|
||||
event = { 'BufReadPost', 'BufNewFile' },
|
||||
main = 'ibl',
|
||||
opts = {
|
||||
indent = {
|
||||
char = '│',
|
||||
},
|
||||
scope = {
|
||||
show_start = false,
|
||||
show_end = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user