From c373bca0779f2b6066c5f65dd9fd5bbbfbfe764b Mon Sep 17 00:00:00 2001 From: George Chatzopoulos Date: Wed, 4 Nov 2026 16:00:25 +0200 Subject: [PATCH] Configuring vim --- flake.nix | 2 +- modules/global-packages.nix | 46 ++++++++++++++++++++++++++++++++++++- 2 files changed, 46 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index 4ac2633..eecf0ab 100644 --- a/flake.nix +++ b/flake.nix @@ -98,4 +98,4 @@ }; }; }; -} \ No newline at end of file +} diff --git a/modules/global-packages.nix b/modules/global-packages.nix index 0cbc8a5..1ebb822 100644 --- a/modules/global-packages.nix +++ b/modules/global-packages.nix @@ -6,7 +6,51 @@ kitty tmux # Text Editor - vim + ((vim-full.override { }).customize{ + name = "vim"; + vimrcConfig.packages.myplugins = with pkgs.vimPlugins; { + start = [ + vim-nix # Essential syntax highlighting and indents for Nix files + rust-vim # Official Rust plugin for detection, syntax, and formatting + vim-lsp # Lightweight Language Server Protocol client for C/C++ and Rust autocomplete + vim-lsp-settings # Automatically configures LSPs (like clangd and rust-analyzer) + asyncomplete-vim # Required to give you popup auto-complete menus for vim-lsp + asyncomplete-lsp-vim + vim-lastplace # Reopens files at your last edit position + ]; + opt = []; + }; + vimrcConfig.customRC = '' + " Basic Defaults + set nocompatible + set backspace=indent,eol,start + + " Enable line numbers + set number + set relativenumber + + " Indentation rules + set tabstop=4 + set shiftwidth=4 + set expandtab + + " Better searching + set hlsearch + set incsearch + set ignorecase + set smartcase + + " Enable syntax highlighting and mouse support + syntax on + set mouse=a + + " LSP Configuration (Tab to navigate completion menu) + inoremap pumvisible() ? "\" : "\" + inoremap pumvisible() ? "\" : "\" + inoremap pumvisible() ? asyncomplete#close_popup() . "\" : "\" + ''; + }) + # Building Tools pkg-config meson