Tree


README.mdcommits | blame
config/

README.md

# Installation

On OpenBSD, just install required pacjages:

    pkg install neovim xclip
   
    got clone ssh://anon@repo.vincentdelft.be/nvim
    got checkout nvim.git 
    cd nvim
    cp config/init.lua to ~/.config/nvim/
    mkdir -p ~/.config/nvim/sessions/

# Configuration

start nvim and make sure lazy update all packages at 1st run

# Maintenance

regularely update modules by doing in nvim: `Lazy update`

# Documentation

This Neovim setup is designed for **Python development, shell scripting, HTML/CSS editing, and Markdown writing**.  
It uses [lazy.nvim](https://github.com/folke/lazy.nvim) for plugin management and focuses on **LSP, autocompletion, Treesitter syntax highlighting, and session persistence**.


## Features

- 🚀 **Lazy.nvim** – fast plugin manager  
- 🐍 **Python LSP** with `pylsp` + `pylint` integration  
- 🐚 **ShellCheck** for inline shell script linting  
- 🌐 **HTML/CSS/JS** improvements with Treesitter + autotagging  
- 📝 **Markdown spell-check** for writing clean documentation  
- 🎨 **Colors**: default scheme is `ron` (fallback `habamax`)  
- 💾 **Sessions auto-save & restore** with `persistence.nvim`  
- ⚡ **Completion engine** (`nvim-cmp`) with snippets, paths, buffer, emoji  


## Plugins

### Core Editing
- **`nvim-treesitter`** → Syntax highlighting & smart indentation (bash, python, html, css, javascript, lua)  
- **`nvim-ts-autotag`** → Auto-close and rename paired HTML/JSX tags  
- **`ccc.nvim`** → Inline color preview and color picker for CSS/HTML  

### LSP & Autocompletion
- **`nvim-lspconfig`** → Manages language servers  
- **`nvim-cmp`** + sources:  
  - LSP completions (`cmp-nvim-lsp`)  
  - Buffer words (`cmp-buffer`)  
  - Filesystem paths (`cmp-path`)  
  - Function signatures (`cmp-nvim-lsp-signature-help`)  
  - Emoji (`cmp-emoji`)  
- **`LuaSnip`** → Snippet engine  

### Linting & Spell Checking
- **`shellcheck.nvim`** → Lint shell scripts directly in Neovim  
- **Spell-check** → Enabled for Markdown (`*.md`) files to avoid typos  

### Sessions
- **`persistence.nvim`** → Save/restore sessions automatically in `~/.config/nvim/sessions/`  

## Language Configuration

- **Python**
  - LSP: [`pylsp`](https://github.com/python-lsp/python-lsp-server)  
  - `pylint` enabled (style warnings relaxed for line length & f-strings)  
  - Jedi completions  

- **Shell**
  - `shellcheck.nvim` integrated for on-the-fly linting  

- **HTML/CSS/JS**
  - 2-space indentation for HTML  
  - Treesitter-based highlighting  
  - Autotag for paired tags  

- **Markdown**
  - Spell-check enabled to catch typos  


## Keybindings

Leader key: `<Space>`

### LSP
- `gd` → Go to definition  
- `K` → Hover documentation  
- `<leader>ca` → Code action  
- `<leader>e` → Show diagnostics in float  
- `<leader>q` → List diagnostics  

### Sessions
- `<leader>ss` → Save session  
- `<leader>sr` → Restore session  
- `<leader>sl` → Restore last session  

### Completion (`nvim-cmp`)
- `<C-b>` / `<C-f>` → Scroll docs  
- `<C-Space>` → Trigger completion  
- `<C-e>` → Abort completion  
- `<CR>` → Confirm completion  


## Diagnostics in Statusline

Shows inline diagnostic messages for the **current line**, with icons:  
- ⛔ Error  
- âš ī¸ Warning  
- â„šī¸ Info  
- 💡 Hint  


## Clipboard Tips

For system clipboard integration (requires `xclip` on Linux/*BSD):  
- In Visual mode:  
  - `"+y` → Yank to clipboard (paste with Ctrl+V)  
  - `"*y` → Yank to selection (paste with middle-click)  

Examples:  
```vim
:.,.+5yank *   " yank 5 lines → paste with middle click  
:.,.+5yank +   " yank 5 lines → paste with Ctrl+V