3.5 KiB
3.5 KiB
Neovim Configuration
Persönliche Neovim-Konfiguration mit LSP, Treesitter und PlatformIO-Integration.
Features
- Plugin-Management mit lazy.nvim
- LSP für Python (pyright), Lua (lua_ls) und C/C++ (clangd)
- Autovervollständigung mit nvim-cmp
- Syntax Highlighting mit Treesitter
- Dateibaum mit nvim-tree
- Fuzzy Finder mit Telescope
- Git Integration mit gitsigns
- PlatformIO Integration für Microcontroller-Entwicklung
- Terminal mit toggleterm
Installation
Voraussetzungen
- Neovim >= 0.11
- Git
- Node.js (für einige LSP-Server)
macOS:
brew install neovim ripgrep fd node
Debian/Ubuntu:
sudo apt install neovim ripgrep fd-find nodejs npm
Dotfiles installieren
git clone https://git.motocamp.de/rene/dotfiles-rene.git ~/git-projekte/dotfiles-rene
cd ~/git-projekte/dotfiles-rene/nvim
chmod +x install-nvim-dotfiles.sh
./install-nvim-dotfiles.sh
Beim ersten Start von nvim werden alle Plugins automatisch installiert.
Shortcuts
Allgemein
| Shortcut | Beschreibung |
|---|---|
Space |
Leader-Taste |
Space + e |
Dateibaum ein/aus |
Ctrl + t |
Terminal ein/aus |
Dateien & Suche
| Shortcut | Beschreibung |
|---|---|
Space + ff |
Dateien suchen |
Space + fg |
Text in Dateien suchen (grep) |
Space + fb |
Offene Buffer wechseln |
Code Navigation (LSP)
| Shortcut | Beschreibung |
|---|---|
gd |
Gehe zur Definition |
K |
Hover / Dokumentation |
Space + rn |
Umbenennen |
Space + ca |
Code Actions |
Autovervollständigung
| Shortcut | Beschreibung |
|---|---|
Tab |
Nächster Vorschlag |
Enter |
Vorschlag annehmen |
Ctrl + Space |
Vervollständigung öffnen |
PlatformIO
| Shortcut | Beschreibung |
|---|---|
Space + pb |
Build |
Space + pu |
Upload |
Space + pc |
Clean |
Space + pm |
Serial Monitor |
Space + pi |
Projekt initialisieren |
Vim Basics
| Shortcut | Beschreibung |
|---|---|
:w |
Speichern |
:q |
Schließen |
:q! |
Schließen ohne Speichern |
:wq |
Speichern und Schließen |
i |
Insert Mode |
Esc |
Normal Mode |
u |
Undo |
Ctrl + r |
Redo |
Struktur
nvim/
├── init.lua # Hauptkonfiguration, lazy.nvim Bootstrap
├── lua/
│ └── plugins/
│ ├── init.lua # Leere Plugin-Spec
│ ├── editor.lua # UI: Theme, Statusbar, Dateibaum, Telescope
│ ├── lsp.lua # LSP, Treesitter, Autovervollständigung
│ └── platformio.lua # PlatformIO Integration
├── install-nvim-dotfiles.sh # Installations-Skript
└── README.md
Anpassungen
Weitere Language Server hinzufügen
In lua/plugins/lsp.lua bei Mason und den LSP-Configs ergänzen:
require('mason-lspconfig').setup({
ensure_installed = { 'pyright', 'lua_ls', 'clangd', 'rust_analyzer' },
})
vim.lsp.enable('rust_analyzer')
Farbschema ändern
In lua/plugins/editor.lua:
{
'folke/tokyonight.nvim',
config = function()
vim.cmd.colorscheme('tokyonight-day') -- oder: tokyonight-storm, tokyonight-moon
end,
},
Troubleshooting
Plugins neu installieren:
:Lazy sync
LSP-Server Status:
:LspInfo
Mason (LSP-Server verwalten):
:Mason
Treesitter Parser installieren:
:TSInstall <sprache>