updated nvim config, added local_ai

This commit is contained in:
2026-08-16 10:16:13 -07:00
parent 35cf83cb70
commit da513216a3
17 changed files with 734 additions and 321 deletions

View File

@@ -0,0 +1,2 @@
-- Bootstrap lazy.nvim, LazyVim and custom plugins
require("config.lazy")

View File

@@ -0,0 +1,5 @@
-- Autocmds are automatically loaded on the VeryLazy event
-- Default autocmds set by LazyVim:
-- https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua
-- Custom autocmds can be defined here

View File

@@ -0,0 +1,8 @@
-- Keymaps are automatically loaded on the VeryLazy event
-- Default keymaps set by LazyVim:
-- https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua
local map = vim.keymap.set
-- Custom keymaps can be added below:
-- Example: map("n", "<leader>pv", vim.cmd.Ex, { desc = "Open file explorer" })

View File

@@ -0,0 +1,56 @@
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)
require("lazy").setup({
spec = {
-- 1. Add LazyVim core and import its default plugins
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
-- 2. Optional LazyVim Extras (uncomment or add extras as needed)
{ import = "lazyvim.plugins.extras.lang.nix" },
{ import = "lazyvim.plugins.extras.lang.rust" },
{ import = "lazyvim.plugins.extras.lang.python" },
{ import = "lazyvim.plugins.extras.lang.typescript" },
{ import = "lazyvim.plugins.extras.lang.json" },
{ import = "lazyvim.plugins.extras.formatting.prettier" },
-- 3. Import user plugins from lua/plugins/*.lua
{ import = "plugins" },
},
defaults = {
-- Plugins load during startup unless explicitly marked lazy
lazy = false,
-- Always track latest git commit
version = false,
},
install = { colorscheme = { "tokyonight", "habamax" } },
checker = {
enabled = true,
notify = false,
},
performance = {
rtp = {
paths = vim.env.NVIM_TREESITTER_PARSERS and { vim.env.NVIM_TREESITTER_PARSERS } or {},
disabled_plugins = {
"gzip",
"tarPlugin",
"tohtml",
"tutor",
"zipPlugin",
},
},
},
})

View File

@@ -0,0 +1,17 @@
-- Options are automatically loaded before lazy.nvim startup
-- Default options that are always set by LazyVim:
-- https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua
local opt = vim.opt
-- Tab and indentation settings
opt.tabstop = 4
opt.shiftwidth = 4
opt.expandtab = true
-- Line numbers
opt.number = true
opt.relativenumber = true
-- Clipboard integration with system/Wayland
opt.clipboard = "unnamedplus"

View File

@@ -0,0 +1,24 @@
return {
-- Tokyo Night colorscheme configuration
{
"folke/tokyonight.nvim",
lazy = false,
priority = 1000,
opts = {
style = "night",
transparent = true,
styles = {
sidebars = "transparent",
floats = "transparent",
},
},
},
-- Configure LazyVim to use tokyonight by default
{
"LazyVim/LazyVim",
opts = {
colorscheme = "tokyonight",
},
},
}

View File

@@ -0,0 +1,48 @@
-- User custom plugin configurations and overrides
return {
-- Disable Mason on NixOS (all LSPs/formatters/linters are managed declaratively via Nix)
{ "mason.nvim", enabled = false },
{ "mason-lspconfig.nvim", enabled = false },
{ "mason-nvim-dap.nvim", enabled = false },
-- Treesitter configuration tailored for NixOS
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
-- Nix provides all precompiled grammars in ~/.config/nvim/parser and rtp.
-- Clear LazyVim's default ensure_installed list to prevent compile triggers on startup.
opts.ensure_installed = {}
opts.auto_install = false
opts.sync_install = false
opts.highlight = {
enable = true,
additional_vim_regex_highlighting = false,
}
opts.indent = { enable = true }
end,
},
-- Example: Telescope / fzf configuration
{
"nvim-telescope/telescope.nvim",
opts = {
defaults = {
layout_strategy = "horizontal",
layout_config = { prompt_position = "top" },
sorting_strategy = "ascending",
winblend = 0,
},
},
},
-- Linting configuration (graceful fallback if linters are not yet in PATH)
{
"mfussenegger/nvim-lint",
opts = function(_, opts)
opts.linters_by_ft = opts.linters_by_ft or {}
if vim.fn.executable("statix") == 0 then
opts.linters_by_ft["nix"] = {}
end
end,
},
}

76
home/nvim/default.nix Normal file
View File

@@ -0,0 +1,76 @@
{ config, pkgs, lib, ... }:
let
treesitterParsers = pkgs.symlinkJoin {
name = "treesitter-parsers";
paths = builtins.attrValues pkgs.vimPlugins.nvim-treesitter.passthru.grammarPlugins;
};
in
{
programs.neovim = {
enable = true;
defaultEditor = true;
viAlias = true;
vimAlias = true;
withNodeJs = true;
withPython3 = true;
extraPackages = with pkgs; [
# Native compilation tools & Treesitter CLI
gcc
clang
gnumake
cmake
tree-sitter
# Search & Fuzzy Finding
ripgrep
fd
fzf
# Archive and Network Utilities
git
curl
unzip
gnutar
gzip
# Language Servers, Linters & Formatters (Declarative, no Mason needed)
# Nix
nil
nixfmt
statix
# Lua
lua-language-server
stylua
# C / C++
llvmPackages_latest.clang-tools
llvmPackages_latest.lldb
# Rust
rust-analyzer
# Python
pyright
ruff
# Web / TypeScript / JavaScript / HTML / CSS / JSON
vtsls
vscode-langservers-extracted
prettier
# Shell
shfmt
shellcheck
];
extraWrapperArgs = [
"--set" "NVIM_TREESITTER_PARSERS" "${treesitterParsers}"
];
};
# Symlink LazyVim configuration to ~/.config/nvim recursively
xdg.configFile."nvim" = {
source = ./config;
recursive = true;
};
# Symlink precompiled Treesitter parsers directly into ~/.config/nvim/parser
xdg.configFile."nvim/parser".source = "${treesitterParsers}/parser";
}