From 2779aed36593682248a5526cf45eefa8a7c57c1f Mon Sep 17 00:00:00 2001 From: Bryan Ramos Date: Wed, 15 Apr 2026 21:11:55 -0400 Subject: [PATCH] chore: unstage incorrectly tracked submodule contents Remove files that were committed as regular tracked files instead of as git submodule references. Submodules will be re-added properly. --- user/modules/bash/bash/aliases | 25 -- user/modules/bash/bash/bashrc | 21 -- user/modules/bash/bash/prompt | 179 ---------- user/modules/git/git/README.md | 9 - user/modules/git/git/config | 28 -- user/modules/git/git/ignore | 14 - user/modules/neovim/nvim/README.md | 73 ----- user/modules/neovim/nvim/init.lua | 13 - .../neovim/nvim/lua/config/keymaps.lua | 23 -- user/modules/neovim/nvim/lua/config/lazy.lua | 35 -- .../neovim/nvim/lua/config/options.lua | 48 --- .../neovim/nvim/lua/plugins/bufferline.lua | 40 --- .../neovim/nvim/lua/plugins/colorscheme.lua | 109 ------ .../neovim/nvim/lua/plugins/disabled.lua | 5 - .../neovim/nvim/lua/plugins/gitsigns.lua | 59 ---- .../nvim/lua/plugins/indent-blankline.lua | 22 -- user/modules/neovim/nvim/lua/plugins/lsp.lua | 310 ------------------ .../neovim/nvim/lua/plugins/lualine.lua | 60 ---- .../neovim/nvim/lua/plugins/neotree.lua | 102 ------ .../neovim/nvim/lua/plugins/telescope.lua | 62 ---- .../neovim/nvim/lua/plugins/which-key.lua | 89 ----- user/modules/vim/vim/.gitignore | 3 - user/modules/vim/vim/README.md | 74 ----- user/modules/vim/vim/vimrc | 193 ----------- 24 files changed, 1596 deletions(-) delete mode 100644 user/modules/bash/bash/aliases delete mode 100644 user/modules/bash/bash/bashrc delete mode 100644 user/modules/bash/bash/prompt delete mode 100644 user/modules/git/git/README.md delete mode 100644 user/modules/git/git/config delete mode 100644 user/modules/git/git/ignore delete mode 100644 user/modules/neovim/nvim/README.md delete mode 100644 user/modules/neovim/nvim/init.lua delete mode 100644 user/modules/neovim/nvim/lua/config/keymaps.lua delete mode 100644 user/modules/neovim/nvim/lua/config/lazy.lua delete mode 100644 user/modules/neovim/nvim/lua/config/options.lua delete mode 100644 user/modules/neovim/nvim/lua/plugins/bufferline.lua delete mode 100644 user/modules/neovim/nvim/lua/plugins/colorscheme.lua delete mode 100644 user/modules/neovim/nvim/lua/plugins/disabled.lua delete mode 100644 user/modules/neovim/nvim/lua/plugins/gitsigns.lua delete mode 100644 user/modules/neovim/nvim/lua/plugins/indent-blankline.lua delete mode 100644 user/modules/neovim/nvim/lua/plugins/lsp.lua delete mode 100644 user/modules/neovim/nvim/lua/plugins/lualine.lua delete mode 100644 user/modules/neovim/nvim/lua/plugins/neotree.lua delete mode 100644 user/modules/neovim/nvim/lua/plugins/telescope.lua delete mode 100644 user/modules/neovim/nvim/lua/plugins/which-key.lua delete mode 100644 user/modules/vim/vim/.gitignore delete mode 100644 user/modules/vim/vim/README.md delete mode 100644 user/modules/vim/vim/vimrc diff --git a/user/modules/bash/bash/aliases b/user/modules/bash/bash/aliases deleted file mode 100644 index ea7697b..0000000 --- a/user/modules/bash/bash/aliases +++ /dev/null @@ -1,25 +0,0 @@ -# Navigation -alias cd='cd -L' - -# Colors -eval "$(dircolors -b)" -alias ls='ls --color=auto' - -# Search -alias grep='grep --color=auto' - -# Tree (uses eza if available) -if command -v eza >/dev/null 2>&1; then - alias tree='eza --tree --icons=never' -fi - -# Open (graphical environment only) -if [ -n "$DISPLAY" ] || [ -n "$WAYLAND_DISPLAY" ]; then - alias open='xdg-open' -fi - -if command -v nvim >/dev/null 2>&1; then - alias vim='nvim' -fi - -alias cdg='cd "$(git rev-parse --show-toplevel 2>/dev/null)"' diff --git a/user/modules/bash/bash/bashrc b/user/modules/bash/bash/bashrc deleted file mode 100644 index 4e08b82..0000000 --- a/user/modules/bash/bash/bashrc +++ /dev/null @@ -1,21 +0,0 @@ -# Use gpg-agent for SSH (YubiKey support) -if command -v gpgconf >/dev/null 2>&1; then - export SSH_AUTH_SOCK - SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)" -fi - -# Source prompt and aliases -BASH_CONFIG_DIR="${BASH_SOURCE%/*}" -. "$BASH_CONFIG_DIR/prompt" -. "$BASH_CONFIG_DIR/aliases" - -# Vi mode -set -o vi - -# Completion -bind 'set completion-ignore-case on' -bind 'set completion-map-case on' - -if command -v direnv >/dev/null 2>&1; then - eval "$(direnv hook bash)" -fi diff --git a/user/modules/bash/bash/prompt b/user/modules/bash/bash/prompt deleted file mode 100644 index 9b7a494..0000000 --- a/user/modules/bash/bash/prompt +++ /dev/null @@ -1,179 +0,0 @@ -# Detect graphical environment once at source time -if [ -n "$DISPLAY" ] || [ -n "$WAYLAND_DISPLAY" ]; then - _gfx=1 - _py_sym=$'\ue73c' - _js_sym=$'\ue781' - _nix_sym=$'\ue843' - _proj_sym=$'\ueb45 ' - _branch_sym=$'\uf418' -else - _gfx="" - _py_sym="py" - _js_sym="js" - _nix_sym="nix" - _proj_sym="../" - _branch_sym="git" -fi - -# Pre-compute colored icons -_python_icon="\[\033[01;33m\]$_py_sym\[\033[00m\]" -_node_icon="\[\033[01;93m\]$_js_sym\[\033[00m\]" -_nix_icon="\[\033[01;34m\]$_nix_sym\[\033[00m\]" - -# SSH check once at source time -if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then - _ssh_PS1="\n\[\033[01;37m\]\u@\h:\[\033[00m\]\n" -else - _ssh_PS1="" -fi - -# Static prompt parts -_green_arrow="\[\033[01;32m\]>> " -_white_text="\[\033[00m\]" - -# Cache: dir -> "git_root|superproject|" or "-" for non-git -declare -A _dir_cache - -# Find git root by walking up (no git spawn) -_find_git_root() { - local dir="$PWD" - while [ -n "$dir" ]; do - if [ -e "$dir/.git" ]; then - _git_root="$dir" - return 0 - fi - dir="${dir%/*}" - done - return 1 -} - -# Find superproject by walking up from git root -_find_superproject() { - local dir="${_git_root%/*}" - _superproject="" - while [ -n "$dir" ]; do - if [ -e "$dir/.git" ]; then - _superproject="$dir" - return 0 - fi - dir="${dir%/*}" - done - return 1 -} - -# Read branch from .git/HEAD (no git spawn) -_read_branch() { - local git_dir="$_git_root/.git" - local head_file - - # Submodule: .git is a file with "gitdir: " - if [ -f "$git_dir" ]; then - read -r _ head_file < "$git_dir" - head_file="$head_file/HEAD" - else - head_file="$git_dir/HEAD" - fi - - [ -f "$head_file" ] || return 1 - - local head - read -r head < "$head_file" - - if [[ "$head" == "ref: refs/heads/"* ]]; then - _git_branch="${head#ref: refs/heads/}" - else - # Detached HEAD - short hash - _git_branch="${head:0:7}" - fi -} - -# Build venv icons (must run every prompt - env can change) -_build_venv_icons() { - venv_icons="" - [ -n "$IN_NIX_SHELL" ] && venv_icons+="$_nix_icon " - [ -n "$VIRTUAL_ENV" ] && venv_icons+="$_python_icon " - [ -d "$_git_root/node_modules" ] && venv_icons+="$_node_icon " -} - -# Main prompt logic -_set_prompt() { - local cached="${_dir_cache[$PWD]}" - - # Check cache - if [ -z "$cached" ]; then - if _find_git_root; then - _find_superproject - _dir_cache[$PWD]="$_git_root|$_superproject|" - else - _dir_cache[$PWD]="-" - cached="-" - fi - fi - - # Non-git directory - if [ "$cached" = "-" ] || [ "${_dir_cache[$PWD]}" = "-" ]; then - venv_icons="" - [ -n "$IN_NIX_SHELL" ] && venv_icons+="$_nix_icon " - [ -n "$VIRTUAL_ENV" ] && venv_icons+="$_python_icon " - PS1="$_ssh_PS1\n\[\033[01;34m\]\w\[\033[00m\]\n$venv_icons$_green_arrow$_white_text" - return - fi - - # Parse cache - [ -z "$cached" ] && cached="${_dir_cache[$PWD]}" - IFS='|' read -r _git_root _superproject _ <<< "$cached" - - # Get branch (can change without cd) - if fails, git root is gone - if ! _read_branch; then - unset "_dir_cache[$PWD]" - _set_prompt - return - fi - - # Build paths using bash string ops (no readlink spawn) - local git_curr_dir="${PWD#$_git_root}" - local git_root_dir="${_git_root##*/}" - - # Build working_dir - local working_dir - if [ -n "$_superproject" ]; then - local super_name="${_superproject##*/}" - working_dir="\[\033[01;34m\]$_proj_sym$super_name/$git_root_dir$git_curr_dir\[\033[00m\]" - elif [ -z "$git_curr_dir" ]; then - working_dir="\[\033[01;34m\]$_proj_sym$git_root_dir\[\033[00m\]" - else - working_dir="\[\033[01;34m\]$_proj_sym$git_root_dir$git_curr_dir\[\033[00m\]" - fi - - # Build branch PS1 - local git_branch_PS1 - if [ -n "$_gfx" ]; then - git_branch_PS1="\[\033[01;31m\]$_git_branch $_branch_sym:\[\033[00m\]" - else - git_branch_PS1="\[\033[01;31m\]$_git_branch:\[\033[00m\]" - fi - - # Build venv icons - _build_venv_icons - - PS1="$_ssh_PS1\n$working_dir\n$venv_icons$_green_arrow$git_branch_PS1$_white_text" -} - -# Invalidate cache for current directory -_prompt_cache_invalidate() { - unset "_dir_cache[$PWD]" -} - -# Wrap git to invalidate cache on repo-creating commands -git() { - command git "$@" - local ret=$? - [[ "$1" =~ ^(init|clone)$ ]] && _prompt_cache_invalidate - return $ret -} - -if [ -n "$PROMPT_COMMAND" ]; then - PROMPT_COMMAND="_set_prompt;$PROMPT_COMMAND" -else - PROMPT_COMMAND="_set_prompt" -fi diff --git a/user/modules/git/git/README.md b/user/modules/git/git/README.md deleted file mode 100644 index 86fba58..0000000 --- a/user/modules/git/git/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# Git Config - -My global git configuration. - -## Install - -```bash -git clone git@github.com:itme-brain/git.git ~/.config/git -``` diff --git a/user/modules/git/git/config b/user/modules/git/git/config deleted file mode 100644 index 042a282..0000000 --- a/user/modules/git/git/config +++ /dev/null @@ -1,28 +0,0 @@ -[init] - defaultBranch = master - -# Use vimdiff for diffs and merge conflicts -[diff] - tool = vimdiff - -[merge] - tool = vimdiff - -[mergetool] - keepBackup = false - -[mergetool "vimdiff"] - trustExitCode = true - -[user] - name = Bryan Ramos - email = bryan@ramos.codes - signingKey = F1F3466458452B2DF351F1E864D12BA95ACE1F2D - -# Auto-set upstream on first push -[push] - autoSetupRemote = true - -# Enable per-project with: git config --local commit.gpgSign true -[commit] - gpgSign = false diff --git a/user/modules/git/git/ignore b/user/modules/git/git/ignore deleted file mode 100644 index 2831c75..0000000 --- a/user/modules/git/git/ignore +++ /dev/null @@ -1,14 +0,0 @@ -# JavaScript / Node -node_modules - -# Nix -.direnv -result - -# Haskell -dist-newstyle - -# Nuxt -.nuxt/ -.output/ -dist diff --git a/user/modules/neovim/nvim/README.md b/user/modules/neovim/nvim/README.md deleted file mode 100644 index 144eb56..0000000 --- a/user/modules/neovim/nvim/README.md +++ /dev/null @@ -1,73 +0,0 @@ -# Neovim Configuration - -Portable Neovim configuration using lazy.nvim and native LSP (Neovim 0.11+, tested on 0.12.1). - -## Installation - -### Standalone (any system) -```bash -git clone git@github.com:itme-brain/nvim.git ~/.config/nvim -``` - -### As part of NixOS config -```bash -git clone --recurse-submodules git@github.com:itme-brain/nixos.git -``` - -## Features - -- **Native LSP** (`vim.lsp.config` / `vim.lsp.enable`) - no manual server list needed -- **Smart LSP picker** (`css`) - auto-detects installed servers for current filetype -- **Neovim 0.12 compatible** - uses built-in `:lsp` commands and keeps legacy `:Lsp*` aliases working -- **Portable** - works on NixOS (LSPs via extraPackages) or any system (LSPs via Mason) -- **Mason** - auto-disabled on NixOS, auto-installs essentials elsewhere - -## LSP Setup - -On NixOS, LSPs come from: -- `neovim.extraPackages` (global essentials) -- Project `devShell` (project-specific) - -On other systems, Mason auto-installs: -- `lua_ls` - Lua/Neovim -- `nil_ls` - Nix -- `bashls` - Bash/Shell -- `jsonls` - JSON -- `html` - HTML -- `cssls` - CSS -- `marksman` - Markdown -- `taplo` - TOML -- `yamlls` - YAML - -The smart picker (`css`) scans all lspconfig servers and shows only those with binaries installed. -On Neovim 0.12+, start/stop/restart uses the built-in `:lsp` commands under the hood. - -## Key Bindings - -| Key | Action | -|-----|--------| -| `css` | Start LSP (smart picker) | -| `csx` | Stop LSP | -| `csr` | Restart LSP | -| `cf` | Format code | -| `ca` | Code action | -| `cr` | Rename symbol | -| `gd` | Go to definition | -| `gr` | Find references | -| `e` | Toggle file explorer | -| `bd` | Delete buffer | -| `/` | Live grep from git root | -| `ff` | Find files from git root | - -## Plugins - -- **lazy.nvim** - plugin manager -- **nvim-lspconfig** - LSP configurations -- **nvim-cmp** - completion -- **telescope.nvim** - fuzzy finder -- **nvim-treesitter** - syntax highlighting -- **neo-tree.nvim** - file explorer -- **gitsigns.nvim** - git integration -- **lualine.nvim** - statusline -- **bufferline.nvim** - buffer tabs -- **which-key.nvim** - keybinding hints diff --git a/user/modules/neovim/nvim/init.lua b/user/modules/neovim/nvim/init.lua deleted file mode 100644 index fad0bd2..0000000 --- a/user/modules/neovim/nvim/init.lua +++ /dev/null @@ -1,13 +0,0 @@ -local function load_config_directory(directory) - local config_path = vim.fn.stdpath("config") .. "/lua/" .. directory - local files = vim.fn.readdir(config_path, function(name) - return name:sub(-4) == ".lua" - end) - - for _, file in ipairs(files) do - local file_name = file:sub(1, -5) - require(directory .. "." .. file_name) - end -end - -load_config_directory("config") diff --git a/user/modules/neovim/nvim/lua/config/keymaps.lua b/user/modules/neovim/nvim/lua/config/keymaps.lua deleted file mode 100644 index a12a224..0000000 --- a/user/modules/neovim/nvim/lua/config/keymaps.lua +++ /dev/null @@ -1,23 +0,0 @@ --- Keep cursor centered while navigating document -vim.keymap.set("n", "", "zz", { silent = true }) -vim.keymap.set("n", "", "zz", { silent = true }) - --- Remap Ctrl + J/K/H/L to navigate between windows -vim.keymap.set('n', '', 'j', { noremap = true, silent = true }) -vim.keymap.set('n', '', 'k', { noremap = true, silent = true }) -vim.keymap.set('n', '', 'h', { noremap = true, silent = true }) -vim.keymap.set('n', '', 'l', { noremap = true, silent = true }) - -vim.keymap.set('n', '', ':vertical resize +10', { noremap = true, silent = true }) -vim.keymap.set('n', '', ':vertical resize -10', { noremap = true, silent = true }) -vim.keymap.set('n', '', ':horizontal resize +10', { noremap = true, silent = true }) -vim.keymap.set('n', '', ':horizontal resize -10', { noremap = true, silent = true }) - --- Remap Shift + H/L to switch between buffers -vim.keymap.set('n', '', ':bprevious', { noremap = true, silent = true }) -vim.keymap.set('n', '', ':bnext', { noremap = true, silent = true }) - -vim.keymap.set("v", "<", "", ">gv") - -vim.keymap.set("n", "", ':nohlsearchlet @/=""', { noremap = true, silent = true}) diff --git a/user/modules/neovim/nvim/lua/config/lazy.lua b/user/modules/neovim/nvim/lua/config/lazy.lua deleted file mode 100644 index 89c356d..0000000 --- a/user/modules/neovim/nvim/lua/config/lazy.lua +++ /dev/null @@ -1,35 +0,0 @@ --- Bootstrap lazy.nvim -local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -if not (vim.uv or vim.loop).fs_stat(lazypath) then - local lazyrepo = "https://github.com/folke/lazy.nvim.git" - local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) - if vim.v.shell_error ~= 0 then - vim.api.nvim_echo({ - { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, - { out, "WarningMsg" }, - { "\nPress any key to exit..." }, - }, true, {}) - vim.fn.getchar() - os.exit(1) - end -end -vim.opt.rtp:prepend(lazypath) - --- Make sure to setup `mapleader` and `maplocalleader` before --- loading lazy.nvim so that mappings are correct. --- This is also a good place to setup other settings (vim.opt) -vim.g.mapleader = " " -vim.g.maplocalleader = "\\" - --- Setup lazy.nvim -require("lazy").setup({ - spec = { - -- import your plugins - { import = "plugins" }, - }, - -- Configure any other settings here. See the documentation for more details. - -- colorscheme that will be used when installing plugins. - install = { colorscheme = { "onedark" } }, - -- automatically check for plugin updates - checker = { enabled = false }, -}) diff --git a/user/modules/neovim/nvim/lua/config/options.lua b/user/modules/neovim/nvim/lua/config/options.lua deleted file mode 100644 index 3bb30b8..0000000 --- a/user/modules/neovim/nvim/lua/config/options.lua +++ /dev/null @@ -1,48 +0,0 @@ -vim.o.clipboard = "unnamedplus" -vim.g.autoformat = false - -vim.opt.number = true -vim.opt.relativenumber = true -vim.opt.cursorline = true --- Enable true color if terminal supports it (disabled in TTY/headless) -if vim.env.COLORTERM == "truecolor" or vim.env.COLORTERM == "24bit" then - vim.opt.termguicolors = true -end - -vim.opt.tabstop = 2 -vim.opt.shiftwidth = 2 -vim.opt.softtabstop = 2 -vim.opt.expandtab = true -vim.opt.smartindent = true -vim.opt.ignorecase = true -vim.opt.smartcase = true -vim.opt.incsearch = false - -vim.opt.swapfile = false -vim.opt.backup = false -vim.opt.undofile = true - -vim.opt.guicursor = "n-v-c:block,i:block,r:block" - -vim.opt.fillchars = { eob = " " } - -local options_group = vim.api.nvim_create_augroup("config_options", { clear = true }) - -vim.api.nvim_create_autocmd("FileType", { - group = options_group, - pattern = { "python", "haskell", "c", "cpp" }, - callback = function() - local opt = vim.opt_local - opt.tabstop = 4 - opt.shiftwidth = 4 - opt.softtabstop = 4 - end, -}) - -vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, { - group = options_group, - pattern = "*.purs", - callback = function(event) - vim.bo[event.buf].filetype = "purescript" - end, -}) diff --git a/user/modules/neovim/nvim/lua/plugins/bufferline.lua b/user/modules/neovim/nvim/lua/plugins/bufferline.lua deleted file mode 100644 index 8ddec03..0000000 --- a/user/modules/neovim/nvim/lua/plugins/bufferline.lua +++ /dev/null @@ -1,40 +0,0 @@ -return { - { - "akinsho/bufferline.nvim", - version = "*", - dependencies = "nvim-tree/nvim-web-devicons", - config = function() - require("bufferline").setup{ - options = { - separator_style = "thin", - show_buffer_close_buttons = false, - show_close_icon = false, - }, - highlights = { - -- Force all icon backgrounds to transparent - buffer_selected = { bg = "NONE" }, - buffer_visible = { bg = "NONE" }, - background = { bg = "NONE" }, - fill = { bg = "NONE" }, - separator = { bg = "NONE" }, - separator_selected = { bg = "NONE" }, - separator_visible = { bg = "NONE" }, - close_button = { bg = "NONE" }, - close_button_selected = { bg = "NONE" }, - close_button_visible = { bg = "NONE" }, - modified = { bg = "NONE" }, - modified_selected = { bg = "NONE" }, - modified_visible = { bg = "NONE" }, - duplicate = { bg = "NONE" }, - duplicate_selected = { bg = "NONE" }, - duplicate_visible = { bg = "NONE" }, - indicator_selected = { bg = "NONE" }, - indicator_visible = { bg = "NONE" }, - pick = { bg = "NONE" }, - pick_selected = { bg = "NONE" }, - pick_visible = { bg = "NONE" }, - }, - } - end - } -} diff --git a/user/modules/neovim/nvim/lua/plugins/colorscheme.lua b/user/modules/neovim/nvim/lua/plugins/colorscheme.lua deleted file mode 100644 index a5ab11e..0000000 --- a/user/modules/neovim/nvim/lua/plugins/colorscheme.lua +++ /dev/null @@ -1,109 +0,0 @@ -return { - { - "chriskempson/base16-vim", - config = function() - local color_group = vim.api.nvim_create_augroup("config_colorscheme", { clear = true }) - - local highlights = { - Normal = { bg = "NONE", fg = "#FFFFFF" }, - Visual = { bg = "Gray", fg = "Black" }, - NonText = { bg = "NONE" }, - LineNr = { bg = "NONE" }, - CursorLine = { bg = "NONE" }, - CursorLineNr = { bg = "NONE", fg = "#E5C07B", bold = true }, - Search = { bg = "#FFCC66", fg = "#000000" }, - Pmenu = { bg = "Black", fg = "White" }, - PmenuSel = { bg = "Green", fg = "Black" }, - PmenuThumb = { bg = "Green" }, - PmenuSbar = { bg = "Black" }, - WinSeparator = { bg = "NONE" }, - GitGutterChange = { bg = "NONE" }, - GitGutterAdd = { bg = "NONE" }, - GitGutterDelete = { bg = "NONE" }, - GitSignsAddNr = { bg = "NONE", fg = "#98c379" }, - GitSignsChangeNr = { bg = "NONE", fg = "#61afef" }, - GitSignsDeleteNr = { bg = "NONE", fg = "#e06c75" }, - SignColumn = { bg = "NONE" }, - NeoTreeGitAdded = { bg = "NONE", fg = "#98c379" }, - NeoTreeGitModified = { bg = "NONE", fg = "#e5c07b" }, - NeoTreeGitDeleted = { bg = "NONE", fg = "#e06c75" }, - NeoTreeGitConflict = { bg = "NONE", fg = "#e06c75" }, - NeoTreeGitUntracked = { bg = "NONE", fg = "#61afef" }, - TelescopeSelection = { bg = "Gray", fg = "Green", bold = true }, - TelescopePreviewMatch = { bg = "Yellow", fg = "Black" }, - TreesitterContext = { bg = "NONE" }, - LazyH1 = { bg = "Black", fg = "Green" }, - IblScope = { bg = "NONE", fg = "Yellow" }, - ConflictMarker = { fg = "red" }, - DiffAdd = { bg = "NONE" }, - DiffChange = { bg = "NONE" }, - DiffDelete = { bg = "NONE" }, - DiffText = { bg = "NONE" }, - BufferLineFill = { bg = "NONE" }, - BufferLineBackground = { bg = "NONE", fg = "#5c6370" }, - BufferLineBuffer = { bg = "NONE", fg = "#5c6370" }, - BufferLineBufferSelected = { bg = "NONE", fg = "#FFFFFF", bold = true }, - BufferLineBufferVisible = { bg = "NONE", fg = "#abb2bf" }, - BufferLineCloseButton = { bg = "NONE", fg = "#5c6370" }, - BufferLineCloseButtonSelected = { bg = "NONE", fg = "#e06c75" }, - BufferLineCloseButtonVisible = { bg = "NONE", fg = "#5c6370" }, - BufferLineModified = { bg = "NONE", fg = "#e5c07b" }, - BufferLineModifiedSelected = { bg = "NONE", fg = "#e5c07b" }, - BufferLineModifiedVisible = { bg = "NONE", fg = "#e5c07b" }, - BufferLineSeparator = { bg = "NONE", fg = "#3e4452" }, - BufferLineSeparatorSelected = { bg = "NONE", fg = "#3e4452" }, - BufferLineSeparatorVisible = { bg = "NONE", fg = "#3e4452" }, - BufferLineIndicatorSelected = { bg = "NONE", fg = "#61afef" }, - YankHighlight = { bg = "yellow", fg = "black" }, - } - - local function apply_highlights() - for group, spec in pairs(highlights) do - vim.api.nvim_set_hl(0, group, spec) - end - end - - local conflict_pattern = [[<<<<<<< HEAD\|=======\|>>>>>>> .\+]] - local function apply_conflict_match(win) - if vim.w[win].conflict_marker_match_id then - pcall(vim.fn.matchdelete, vim.w[win].conflict_marker_match_id, win) - end - vim.w[win].conflict_marker_match_id = vim.fn.matchadd("ConflictMarker", conflict_pattern, 10, -1, { - window = win, - }) - end - - vim.cmd.colorscheme("base16-onedark") - apply_highlights() - - vim.api.nvim_create_autocmd("ColorScheme", { - group = color_group, - callback = apply_highlights, - }) - - vim.api.nvim_create_autocmd({ "BufWinEnter", "WinEnter" }, { - group = color_group, - callback = function(event) - apply_conflict_match(vim.api.nvim_get_current_win()) - end, - }) - - vim.api.nvim_create_autocmd("TextYankPost", { - group = color_group, - callback = function() - vim.highlight.on_yank({ higroup = "YankHighlight", timeout = 150 }) - end, - }) - end, - }, - - { - "folke/todo-comments.nvim", - dependencies = { "nvim-lua/plenary.nvim" }, - }, - - { - "fei6409/log-highlight.nvim" - } - -} diff --git a/user/modules/neovim/nvim/lua/plugins/disabled.lua b/user/modules/neovim/nvim/lua/plugins/disabled.lua deleted file mode 100644 index 64e75ec..0000000 --- a/user/modules/neovim/nvim/lua/plugins/disabled.lua +++ /dev/null @@ -1,5 +0,0 @@ -return { - { "williamboman/mason.nvim", enabled = false }, - { "williamboman/mason-lspconfig.nvim", enabled = false }, - { "jay-babu/mason-nvim-dap.nvim", enabled = false }, -} diff --git a/user/modules/neovim/nvim/lua/plugins/gitsigns.lua b/user/modules/neovim/nvim/lua/plugins/gitsigns.lua deleted file mode 100644 index b34952f..0000000 --- a/user/modules/neovim/nvim/lua/plugins/gitsigns.lua +++ /dev/null @@ -1,59 +0,0 @@ -return { - { - "lewis6991/gitsigns.nvim", - config = function() - require('gitsigns').setup { - signs = { - add = { text = '+' }, - change = { text = '~' }, - delete = { text = '-' }, - topdelete = { text = '‾' }, - changedelete = { text = '~' }, - untracked = { text = '┆' }, - }, - signs_staged = { - add = { text = '+' }, - change = { text = '~' }, - delete = { text = '-' }, - topdelete = { text = '‾' }, - changedelete = { text = '~' }, - untracked = { text = '┆' }, - }, - signs_staged_enable = true, - signcolumn = false, -- Toggle with `:Gitsigns toggle_signs` - numhl = true, -- Toggle with `:Gitsigns toggle_numhl` - linehl = false, -- Toggle with `:Gitsigns toggle_linehl` - word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff` - watch_gitdir = { - follow_files = true - }, - auto_attach = true, - attach_to_untracked = false, - current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame` - current_line_blame_opts = { - virt_text = true, - virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align' - delay = 0, - ignore_whitespace = false, - virt_text_priority = 100, - }, - current_line_blame_formatter = ', - ', - sign_priority = 6, - update_debounce = 100, - status_formatter = nil, -- Use default - max_file_length = 40000, -- Disable if file is longer than this (in lines) - preview_config = { - -- Options passed to nvim_open_win - border = 'single', - style = 'minimal', - relative = 'cursor', - row = 0, - col = 1 - }, - } - require("which-key").add({ - { "Gb", ":Gitsigns toggle_current_line_blame", desc = "Git blame" } - }) - end - } -} diff --git a/user/modules/neovim/nvim/lua/plugins/indent-blankline.lua b/user/modules/neovim/nvim/lua/plugins/indent-blankline.lua deleted file mode 100644 index 27fae5a..0000000 --- a/user/modules/neovim/nvim/lua/plugins/indent-blankline.lua +++ /dev/null @@ -1,22 +0,0 @@ -return { - { - "lukas-reineke/indent-blankline.nvim", - config = function() - local hooks = require("ibl.hooks") - - hooks.register(hooks.type.HIGHLIGHT_SETUP, function() - vim.api.nvim_set_hl(0, "IblIndent", { link = "Comment" }) - end) - - require("ibl").setup({ - indent = { - char = "|", - highlight = "IblIndent", - }, - scope = { - enabled = false - }, - }) - end, - } -} diff --git a/user/modules/neovim/nvim/lua/plugins/lsp.lua b/user/modules/neovim/nvim/lua/plugins/lsp.lua deleted file mode 100644 index c31339b..0000000 --- a/user/modules/neovim/nvim/lua/plugins/lsp.lua +++ /dev/null @@ -1,310 +0,0 @@ --- Neovim 0.11+ LSP configuration --- Uses nvim-lspconfig for server definitions + vim.lsp.enable() API - --- Detect NixOS (Mason doesn't work on NixOS due to FHS issues) -local is_nixos = vim.fn.filereadable("/etc/NIXOS") == 1 - --- Servers to ensure are installed via Mason (non-NixOS only) --- On NixOS, install these via extraPackages or per-project devShells -local mason_ensure_installed = { - "lua_ls", -- Neovim config - "nil_ls", -- Nix (nixd not available in Mason) - "bashls", -- Shell scripts - "jsonls", -- JSON configs - "html", -- HTML - "cssls", -- CSS - "marksman", -- Markdown - "taplo", -- TOML - "yamlls", -- YAML -} - -return { - { - "nvim-treesitter/nvim-treesitter", - build = ":TSUpdate", - config = function() - require('nvim-treesitter.configs').setup({ - ensure_installed = { - "lua", - "c", - "cpp", - "python", - "nix", - "rust", - "bash", - "markdown", - "html", - "javascript", - "css", - - "vim", - - "git_config", - "git_rebase", - "gitattributes", - "gitcommit", - "gitignore" - }, - auto_install = true, - sync_install = true, - highlight = { - enable = true, - } - }) - end - }, - - { - "m4xshen/autoclose.nvim", - config = function() - require("autoclose").setup() - end - }, - - { - "hrsh7th/nvim-cmp", - dependencies = { - { - "L3MON4D3/LuaSnip", - version = "v2.*", - build = "make install_jsregexp", - }, - "saadparwaiz1/cmp_luasnip", - "hrsh7th/cmp-nvim-lsp" - }, - - config = function() - local cmp = require("cmp") - cmp.setup({ - enabled = function() - local context = require("cmp.config.context") - if vim.api.nvim_get_mode().mode == "c" then - return true - else - return not context.in_treesitter_capture("comment") and not context.in_syntax_group("comment") - end - end, - - snippet = { - expand = function(args) - require('luasnip').lsp_expand(args.body) - end - }, - - mapping = cmp.mapping.preset.insert({ - [""] = cmp.mapping.select_prev_item(), - [""] = cmp.mapping.select_next_item(), - [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.scroll_docs(4), - [""] = cmp.mapping.abort(), - [""] = cmp.mapping.confirm(), - [""] = cmp.mapping(function(fallback) - fallback() - end, { "i", "s" }), - }), - - sources = cmp.config.sources({ - { name = 'nvim_lsp' }, - { name = 'luasnip' }, - }, { - { name = 'buffer' } - }), - }) - end - }, - - -- Mason: portable LSP installer (disabled on NixOS where it doesn't work) - { - "williamboman/mason.nvim", - enabled = not is_nixos, - config = function() - require("mason").setup() - end - }, - { - "williamboman/mason-lspconfig.nvim", - enabled = not is_nixos, - dependencies = { "williamboman/mason.nvim" }, - config = function() - require("mason-lspconfig").setup({ - ensure_installed = mason_ensure_installed, - automatic_installation = false, -- Only install what's in ensure_installed - }) - end - }, - - { - "neovim/nvim-lspconfig", - dependencies = { - "hrsh7th/cmp-nvim-lsp", - }, - config = function() - local lspconfig = require('lspconfig') - - -- Neovim 0.12 exposes built-in :lsp commands and skips lspconfig's legacy - -- :Lsp* aliases. Recreate the old names so existing mappings keep working. - if vim.fn.exists(':lsp') == 2 and vim.fn.exists(':LspStart') == 0 then - vim.api.nvim_create_user_command('LspStart', function(info) - vim.cmd('lsp enable ' .. table.concat(info.fargs, ' ')) - end, { nargs = '*' }) - - vim.api.nvim_create_user_command('LspRestart', function(info) - vim.cmd('lsp restart ' .. table.concat(info.fargs, ' ')) - end, { nargs = '*', bang = true }) - - vim.api.nvim_create_user_command('LspStop', function(info) - local suffix = info.bang and '!' or '' - vim.cmd('lsp stop' .. suffix .. ' ' .. table.concat(info.fargs, ' ')) - end, { nargs = '*', bang = true }) - end - - -- Diagnostic display configuration - vim.diagnostic.config({ - virtual_text = { - prefix = '●', - spacing = 2, - current_line = true; - }, - float = { - border = 'rounded', - source = true, - }, - signs = { - text = { - [vim.diagnostic.severity.ERROR] = '', - [vim.diagnostic.severity.WARN] = '', - [vim.diagnostic.severity.INFO] = '', - [vim.diagnostic.severity.HINT] = '', - }, - }, - underline = true, - update_in_insert = false, - severity_sort = true, - }) - - -- Add border to hover and signature help windows. - local hover_handler = vim.lsp.handlers.hover - vim.lsp.handlers['textDocument/hover'] = function(err, result, ctx, config) - return hover_handler(err, result, ctx, vim.tbl_extend('force', config or {}, { - border = 'rounded', - })) - end - - local signature_help_handler = vim.lsp.handlers.signature_help - vim.lsp.handlers['textDocument/signatureHelp'] = function(err, result, ctx, config) - return signature_help_handler(err, result, ctx, vim.tbl_extend('force', config or {}, { - border = 'rounded', - })) - end - - -- Get all known server names by scanning lspconfig's lsp directory - local function get_all_servers() - local servers = {} - local lsp_path = vim.fn.stdpath('data') .. '/lazy/nvim-lspconfig/lsp' - local files = vim.fn.readdir(lsp_path, function(name) - return name:sub(-4) == '.lua' - end) - for _, file in ipairs(files) do - local server = file:sub(1, -5) - table.insert(servers, server) - end - return servers - end - - local all_servers = get_all_servers() - - -- local navic = require('nvim-navic') - local capabilities = require('cmp_nvim_lsp').default_capabilities() - - -- Global config applied to all servers - vim.lsp.config('*', { - autostart = false, -- Don't auto-attach, use css to start manually - capabilities = capabilities, - -- on_attach = function(client, bufnr) - -- if client.server_capabilities.documentSymbolProvider then - -- navic.attach(client, bufnr) - -- end - -- end, - }) - - -- Server-specific settings (merged with lspconfig defaults) - vim.lsp.config.lua_ls = { - settings = { - Lua = { - diagnostics = { - globals = { 'vim' } - } - } - } - } - - -- Check if server binary is available - local function is_server_installed(config) - if config.default_config and config.default_config.cmd then - local cmd = config.default_config.cmd[1] - return vim.fn.executable(cmd) == 1 - end - return false - end - - -- Find and start LSP server(s) for current filetype - local function lsp_start_smart() - local ft = vim.bo.filetype - if ft == '' then - vim.notify("No filetype detected", vim.log.levels.WARN) - return - end - - -- Find all matching servers (filetype match + binary installed) - local matching = {} - for _, server in ipairs(all_servers) do - local ok, config = pcall(require, 'lspconfig.configs.' .. server) - if ok and config.default_config and config.default_config.filetypes then - if vim.tbl_contains(config.default_config.filetypes, ft) and is_server_installed(config) then - table.insert(matching, server) - end - end - end - - -- Sort for consistent ordering - table.sort(matching) - - local function start_server(server) - vim.lsp.enable(server) - end - - if #matching == 0 then - vim.notify("No LSP server installed for filetype: " .. ft, vim.log.levels.WARN) - elseif #matching == 1 then - start_server(matching[1]) - else - vim.ui.select(matching, { - prompt = "Select LSP server:", - }, function(choice) - if choice then - start_server(choice) - end - end) - end - end - - -- LSP keybindings - require("which-key").add({ - { "cs", group = "LSP Commands" }, - { "cf", function() vim.lsp.buf.format() end, desc = "Code Format" }, - { "csi", ":checkhealth vim.lsp", desc = "LSP Info" }, - { "csr", ":lsp restart", desc = "LSP Restart" }, - { "css", lsp_start_smart, desc = "LSP Start" }, - { "csx", ":lsp stop", desc = "LSP Stop" }, - }) - end - }, - - { - "taproot-wizards/bitcoin-script-hints.nvim", - dependencies = { "nvim-treesitter/nvim-treesitter" }, - config = function() - require("bitcoin-script-hints").setup() - end - } -} diff --git a/user/modules/neovim/nvim/lua/plugins/lualine.lua b/user/modules/neovim/nvim/lua/plugins/lualine.lua deleted file mode 100644 index 1c09d05..0000000 --- a/user/modules/neovim/nvim/lua/plugins/lualine.lua +++ /dev/null @@ -1,60 +0,0 @@ -return { - { - "nvim-lualine/lualine.nvim", - dependencies = { - "nvim-tree/nvim-web-devicons", - "SmiteshP/nvim-navic" - }, - config = function() - require("lualine").setup ({ - options = { - icons_enabled = true, - theme = 'material', - component_separators = { left = '>', right = '|'}, - section_separators = { left = '', right = ''}, - disabled_filetypes = { - statusline = {}, - winbar = {}, - }, - ignore_focus = {}, - always_divide_middle = true, - globalstatus = true, - refresh = { - statusline = 1000, - tabline = 1000, - winbar = 1000, - } - }, - sections = { - lualine_a = {'mode'}, - lualine_b = {'branch', 'diff', 'diagnostics'}, - lualine_c = { - {'filename'}, - { function() return require("nvim-navic").get_location() end, cond = function() - return require("nvim-navic").is_available() - end, - }, - }, - lualine_x = {'filetype'}, - lualine_y = {'progress'}, - lualine_z = {'location'} - }, - inactive_sections = { - lualine_a = {}, - lualine_b = {}, - lualine_c = {}, - lualine_x = {}, - lualine_y = {}, - lualine_z = {} - }, - tabline = {}, - winbar = {}, - inactive_winbar = {}, - extensions = { - 'lazy', - 'neo-tree', - } - }) - end - } -} diff --git a/user/modules/neovim/nvim/lua/plugins/neotree.lua b/user/modules/neovim/nvim/lua/plugins/neotree.lua deleted file mode 100644 index c7de716..0000000 --- a/user/modules/neovim/nvim/lua/plugins/neotree.lua +++ /dev/null @@ -1,102 +0,0 @@ -return { - { - "nvim-neo-tree/neo-tree.nvim", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended - "MunifTanjim/nui.nvim", - }, - config = function() - require("neo-tree").setup({ - enable_diagnostics = false, - default_component_configs = { - git_status = { - symbols = { - added = "+", - modified = "~", - deleted = "-", - renamed = ">", - untracked = "?", - ignored = "!", - unstaged = "U", - staged = "S", - conflict = "C", - }, - }, - }, - window = { - position = "left", - width = 20, - }, - event_handlers = { - { - event = "neo_tree_window_after_open", - handler = function() - local win = vim.api.nvim_get_current_win() - vim.wo[win].winfixwidth = true - vim.wo[win].winfixbuf = true - vim.wo[win].cursorline = true - end - }, - }, - }) - - -- Keep the selected entry readable without a solid row background. - vim.api.nvim_set_hl(0, "NeoTreeCursorLine", { bg = "NONE", fg = "#a6e3a1" }) - - -- Apply highlight and re-apply on colorscheme change - vim.api.nvim_create_autocmd({ "FileType", "ColorScheme" }, { - pattern = { "neo-tree", "*" }, - callback = function(ev) - if ev.event == "ColorScheme" then - vim.api.nvim_set_hl(0, "NeoTreeCursorLine", { bg = "NONE", fg = "#a6e3a1" }) - end - local win = vim.api.nvim_get_current_win() - local buf = vim.api.nvim_win_get_buf(win) - if vim.bo[buf].filetype == "neo-tree" then - vim.wo[win].winhighlight = "CursorLine:NeoTreeCursorLine" - end - end, - }) - - -- Lock cursor to leftmost column in neo-tree - vim.api.nvim_create_autocmd("CursorMoved", { - pattern = "neo-tree*", - callback = function() - local col = vim.api.nvim_win_get_cursor(0)[2] - if col ~= 0 then - vim.api.nvim_win_set_cursor(0, { vim.api.nvim_win_get_cursor(0)[1], 0 }) - end - end, - }) - - local function toggle_neotree() - local api = vim.api - local bufs = api.nvim_list_bufs() - - for _, buf in ipairs(bufs) do - local name = api.nvim_buf_get_name(buf) - if name:match("neo%-tree filesystem") then - vim.cmd("Neotree close") - return - end - end - - vim.cmd("Neotree") - end - - require("which-key").add({ - { "e", toggle_neotree, desc = "File Explorer" } - }) - - --vim.fn.sign_define("DiagnosticSignError", - -- {text = " ", texthl = "DiagnosticSignError"}) - --vim.fn.sign_define("DiagnosticSignWarn", - -- {text = " ", texthl = "DiagnosticSignWarn"}) - --vim.fn.sign_define("DiagnosticSignInfo", - -- {text = " ", texthl = "DiagnosticSignInfo"}) - --vim.fn.sign_define("DiagnosticSignHint", - -- {text = "󰌵", texthl = "DiagnosticSignHint"}) - end, - }, -} diff --git a/user/modules/neovim/nvim/lua/plugins/telescope.lua b/user/modules/neovim/nvim/lua/plugins/telescope.lua deleted file mode 100644 index 06d1e0c..0000000 --- a/user/modules/neovim/nvim/lua/plugins/telescope.lua +++ /dev/null @@ -1,62 +0,0 @@ -local function get_root() - local result = vim.system({ "git", "rev-parse", "--show-toplevel" }, { text = true }):wait() - if result.code == 0 and result.stdout then - local git_dir = vim.trim(result.stdout) - if git_dir ~= "" then - return git_dir - end - end - - return vim.fn.getcwd() -end - -return { - { - "nvim-telescope/telescope.nvim", - branch = '0.1.x', - dependencies = { - { 'nvim-lua/plenary.nvim' }, - { 'nvim-tree/nvim-web-devicons' } - }, - config = function() - -- Custom Telescope command to grep from Git root - require("which-key").add({ - { "/", function() - require('telescope.builtin').live_grep({ cwd = get_root() }) - end, - desc = "grep" }, - { "ff", function() - require('telescope.builtin').find_files({ cwd = get_root() }) - end, - desc = "Search for Files" }, - { "fp", ":Telescope oldfiles", desc = "Oldfiles" }, - { "?", ":Telescope command_history", desc = "Command History" }, - { "cm", ":Telescope man_pages", desc = "Manpages" }, - - -- Code - { "gd", - function() - local attached = vim.lsp.get_clients({ bufnr = 0 }) - if next(attached) ~= nil then - require('telescope.builtin').lsp_definitions() - else - vim.api.nvim_feedkeys("gd", "n", false) - end - end, - mode = "n", - desc = "Go to Definition" - }, - { "gd", ":Telescope lsp_definitions", desc = "Go to Definition" }, - { "gr", ":Telescope lsp_references", desc = "Goto References" }, - { "gi", ":Telescope lsp_implementations", desc = "Go to Implementations" }, - { "gt", ":Telescope lsp_type_definitions", desc = "Go to Type Definition" }, - { "cv", ":Telescope treesitter", desc = "Function Names & Variables" }, - { "cd", ":Telescope diagnostics", desc = "Code Diagnostics" }, - - -- Git - { "Gt", ":Telescope git_branches", desc = "Git Branches" }, - { "Gc", ":Telescope git_commits", desc = "Git Commits" }, - }) - end - } -} diff --git a/user/modules/neovim/nvim/lua/plugins/which-key.lua b/user/modules/neovim/nvim/lua/plugins/which-key.lua deleted file mode 100644 index 94aac0a..0000000 --- a/user/modules/neovim/nvim/lua/plugins/which-key.lua +++ /dev/null @@ -1,89 +0,0 @@ -return { - { - "folke/which-key.nvim", - event = "VeryLazy", - opts = { - spec = { - { "l", ":Lazy", desc = "Lazy" }, - { "t", - function() - vim.cmd.botright("new") - vim.opt_local.number = false - vim.opt_local.relativenumber = false - vim.cmd.resize(10) - vim.cmd.terminal() - vim.cmd.startinsert() - end, - mode = "n", - desc = "Open Terminal" - }, - - --{ "wd", "execute 'bd' | execute 'close'", desc = "Delete window & buffer" }, - -- Window & Buffer Management - { "w", group = "Windows"}, - { "wc", ":close", desc = "Close Window" }, - { "ws", ":split", desc = "Horizontal Window Split" }, - { "wv", ":vsplit", desc = "Vertial Window Split" }, - { "wm", "_", desc = "Maximize Window" }, - - { "b", group = "Buffers"}, - { "bd", function() - local function is_neotree(bufnr) - return vim.bo[bufnr].filetype == "neo-tree" - end - - local current_buf = vim.api.nvim_get_current_buf() - - -- Skip if in neo-tree - if is_neotree(current_buf) then - vim.notify("Cannot delete buffer from neo-tree", vim.log.levels.WARN) - return - end - local buflisted = vim.fn.getbufinfo({ buflisted = 1 }) - -- Prevent deleting last buffer - if #buflisted <= 1 then - vim.notify("Cannot delete last buffer", vim.log.levels.WARN) - return - end - vim.cmd.bprevious() - vim.cmd.bdelete({ args = { tostring(current_buf) } }) - -- If we ended up in neo-tree, move back to a regular window - local new_buf = vim.api.nvim_get_current_buf() - if is_neotree(new_buf) then - vim.cmd.wincmd("l") - end - end, desc = "Delete Buffer" }, - { "bD", function() - local current_buf = vim.api.nvim_get_current_buf() - local current_win = vim.api.nvim_get_current_win() - - if vim.bo[current_buf].filetype == "neo-tree" then - vim.notify("Cannot delete neo-tree buffer", vim.log.levels.WARN) - return - end - - local wins = vim.fn.win_findbuf(current_buf) - if #wins > 1 then - vim.api.nvim_win_close(current_win, false) - end - - if vim.api.nvim_buf_is_valid(current_buf) then - vim.cmd('bdelete! ' .. current_buf) - end - end, desc = "Delete Window & Buffer" }, - - { "ca", vim.lsp.buf.code_action, desc = "Code Action" }, - { "cr", vim.lsp.buf.rename, desc = "Rename Variable" }, - { "ch", vim.lsp.buf.hover, desc = "Hover Info" }, - { "ce", vim.diagnostic.open_float, desc = "Show Diagnostic" }, - { "]d", vim.diagnostic.goto_next, desc = "Next Diagnostic" }, - { "[d", vim.diagnostic.goto_prev, desc = "Prev Diagnostic" }, - - { "G", group = "Git"}, - { "f", group = "Files"}, - { "c", group = "Code"}, - { "g", group = "Goto"}, - }, - }, - } -} diff --git a/user/modules/vim/vim/.gitignore b/user/modules/vim/vim/.gitignore deleted file mode 100644 index b6a61f0..0000000 --- a/user/modules/vim/vim/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -autoload -plugged -.netrwhist diff --git a/user/modules/vim/vim/README.md b/user/modules/vim/vim/README.md deleted file mode 100644 index 4d23289..0000000 --- a/user/modules/vim/vim/README.md +++ /dev/null @@ -1,74 +0,0 @@ -# Vim Config - -Lightweight Vim config that mirrors the core editing feel of the Neovim setup without the IDE stack. - -## Install - -```bash -git clone git@github.com:itme-brain/vim.git ~/.vim -vim # plugins auto-install on first run -``` - -Requires `curl` and `git` for vim-plug bootstrap. On NixOS this is managed via home-manager instead. - -## How it works - -- Vim auto-loads `~/.vim/vimrc` — no symlinks needed -- [vim-plug](https://github.com/junegunn/vim-plug) auto-downloads itself via curl on first run if missing -- Missing plugins are installed with `PlugInstall --sync` on `VimEnter`, then the vimrc is re-sourced -- `silent! colorscheme` suppresses errors if the colorscheme hasn't been fetched yet (e.g. offline first run) -- Undo history persists to `~/.vim/undodir` across sessions (`undofile`) - -## Plugins - -| Plugin | What it does | -|--------|-------------| -| base16-vim | Colorscheme (onedark) | -| vim-surround | Surround text objects (`cs"'`, `ysiw]`) | -| auto-pairs | Auto-close brackets/quotes | -| fzf + fzf.vim | Fuzzy finder (files, buffers, grep) | -| vim-log-highlighting | Syntax highlighting for log files | -| vim-highlightedyank | Flash feedback on yank | -| lightline.vim | Statusline | -| vim-anzu | Search match count in statusline | - -## Keybinds - -Leader is `Space`. - -### File explorer & search -| Key | Action | -|-----|--------| -| `e` | Toggle netrw sidebar | -| `/` | Ripgrep search from git root | -| `ff` | Find files from git root (fzf) | -| `fp` | Recent files (fzf) | -| `fb` | Open buffers (fzf) | -| `?` | Command history (fzf) | - -### Buffers -| Key | Action | -|-----|--------| -| `H` / `L` | Previous / next buffer | -| `bd` | Delete buffer safely | - -### Windows -| Key | Action | -|-----|--------| -| `` | Navigate windows (skips netrw) | -| `` | Resize windows | -| `wc` | Close window | -| `ws` | Horizontal split | -| `wv` | Vertical split | -| `wm` | Maximize window | - -### Other -| Key | Action | -|-----|--------| -| `` | Clear search highlight | -| `` / `` | Scroll half-page (centered) | -| `<` / `>` (visual) | Indent and keep selection | -| `t` | Terminal (bottom split) | -| `ts` | Insert timestamp | -| `pu` | PlugUpdate | -| `pi` | PlugInstall | diff --git a/user/modules/vim/vim/vimrc b/user/modules/vim/vim/vimrc deleted file mode 100644 index 7a526d5..0000000 --- a/user/modules/vim/vim/vimrc +++ /dev/null @@ -1,193 +0,0 @@ -let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim' -if empty(glob(data_dir . '/autoload/plug.vim')) - silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' -endif - -autocmd VimEnter * if len(filter(values(g:plugs), '!isdirectory(v:val.dir)')) - \| PlugInstall --sync | source $MYVIMRC - \| endif - -call plug#begin('~/.vim/plugged') - Plug 'chriskempson/base16-vim' - Plug 'tpope/vim-surround' - Plug 'jiangmiao/auto-pairs' - Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } - Plug 'junegunn/fzf.vim' - Plug 'mtdl9/vim-log-highlighting' - Plug 'machakann/vim-highlightedyank' - Plug 'itchyny/lightline.vim' - Plug 'osyo-manga/vim-anzu' -call plug#end() - -let mapleader = "\" -set background=dark -if has('termguicolors') - set termguicolors -endif -silent! colorscheme base16-onedark - -highlight Normal ctermbg=NONE guibg=NONE ctermfg=White guifg=#FFFFFF -highlight NonText ctermbg=NONE guibg=NONE -highlight CursorLine ctermbg=NONE guibg=NONE -highlight CursorLineNr ctermfg=Yellow guifg=#E5C07B ctermbg=NONE guibg=NONE cterm=bold gui=bold -highlight HighlightedyankRegion ctermfg=Black guifg=#000000 ctermbg=Yellow guibg=yellow -highlight NormalNC ctermbg=NONE guibg=NONE -highlight Search ctermfg=Black guifg=#000000 ctermbg=Yellow guibg=#FFCC66 -highlight LineNr ctermbg=NONE guibg=NONE -highlight Visual ctermbg=Gray guibg=Gray ctermfg=Black guifg=Black - -let g:highlightedyank_highlight_duration = 140 -let g:lightline = { 'colorscheme': 'deus', } - -let $FZF_DEFAULT_OPTS = '--bind=tab:up,shift-tab:down' -let g:fzf_layout = { 'window': 'enew' } - -" netrw settings -let g:netrw_banner = 0 -let g:netrw_winsize = 20 -let g:netrw_liststyle = 3 -let g:netrw_browse_split = 4 -let g:netrw_altv = 1 - -autocmd FileType netrw nnoremap :wincmd l -autocmd FileType netrw nnoremap :wincmd h -autocmd FileType netrw nnoremap :wincmd j -autocmd FileType netrw nnoremap :wincmd k - -set laststatus=2 - -set number -set relativenumber -set cursorline -set scrolloff=8 - -set noincsearch -set ignorecase -set smartcase - -set clipboard=unnamedplus -set noswapfile -set nobackup -set undofile -set undodir=~/.vim/undodir - -set hidden - -set tabstop=2 -set shiftwidth=2 -set softtabstop=2 -set expandtab -set smartindent -set fillchars=eob:\ - -set statusline=%{exists('*anzu#search_status')?anzu#search_status():''} - -" --- Netrw toggle (like neo-tree) --- -function! NetrwToggle() - for i in range(1, winnr('$')) - if getbufvar(winbufnr(i), '&filetype') ==# 'netrw' - execute i . 'wincmd w' - close - return - endif - endfor - let g:netrw_return_win = winnr() - Lexplore -endfunction - -function! SafeWincmd(dir) - let target = winnr(a:dir) - if target == winnr() - return - endif - if getbufvar(winbufnr(target), '&filetype') ==# 'netrw' - return - endif - execute 'wincmd ' . a:dir -endfunction - -function! GitRoot() - let l:root = systemlist('git rev-parse --show-toplevel') - if v:shell_error == 0 && !empty(l:root) && !empty(l:root[0]) - return l:root[0] - endif - return getcwd() -endfunction - -function! SafeBdelete() - if &filetype ==# 'netrw' - echohl WarningMsg | echom 'Cannot delete buffer from netrw' | echohl None - return - endif - - let l:buflisted = getbufinfo({'buflisted': 1}) - if len(l:buflisted) <= 1 - echohl WarningMsg | echom 'Cannot delete last buffer' | echohl None - return - endif - - let l:buf = bufnr('%') - bprevious - execute 'bdelete ' . l:buf -endfunction - -" --- Plugin management --- -nnoremap pu :PlugUpdate -nnoremap pd :PlugUpgrade -nnoremap ps :PlugStatus -nnoremap pi :PlugInstall - -" --- Search (anzu) --- -nmap n (anzu-n-with-echo) -nmap N (anzu-N-with-echo) -nmap * (anzu-star-with-echo) -nmap # (anzu-sharp-with-echo) -nmap (anzu-clear-search-status) -nnoremap :nohlet @/="" - -" --- Visual indentation --- -vnoremap < >gv - -" --- Scrolling (centered) --- -nnoremap zz -nnoremap zz - -" --- Window navigation (matches nvim , skips netrw) --- -nnoremap :call SafeWincmd('h') -nnoremap :call SafeWincmd('j') -nnoremap :call SafeWincmd('k') -nnoremap :call SafeWincmd('l') - -" --- Window resize (matches nvim ) --- -nnoremap :vertical resize +10 -nnoremap :vertical resize -10 -nnoremap :resize +10 -nnoremap :resize -10 - -" --- Window management --- -nnoremap wc :close -nnoremap ws :split -nnoremap wv :vsplit -nnoremap wm _ -nnoremap ww :wincmd w -nnoremap wW :wincmd W - -" --- File explorer & search --- -nnoremap e :call NetrwToggle() -nnoremap / :execute 'lcd ' . fnameescape(GitRoot()) Rg -nnoremap ff :execute 'lcd ' . fnameescape(GitRoot()) Files -nnoremap fp :History -nnoremap fb :Buffers -nnoremap ? :History: - -" --- Buffers --- -nnoremap bd :call SafeBdelete() -nnoremap H :bprevious -nnoremap L :bnext - -" --- Terminal --- -nnoremap t :below terminal ++rows=10 - -" --- Misc --- -nnoremap ts :execute "normal! a" . strftime('[%b %d %H:%M:%S - BR]')