Files
nix-config/home/Winter/common/features/nvimConf.nix
T

225 lines
5.4 KiB
Nix

{
inputs,
...
}: {
imports = [
inputs.nixvim.homeModules.nixvim
];
programs.nixvim = {
enable = true;
defaultEditor = true;
vimAlias = true;
opts = {
number = true;
relativenumber = true;
};
colorschemes.monokai-pro = {
enable = true;
settings = {
filter = "classic"; # Options: classic, octagon, pro, machine
transparent_background = true;
};
};
highlightOverride = {
# Core & empty space below buffers/trees
Normal = { bg = "none"; };
NormalNC = { bg = "none"; };
EndOfBuffer = { bg = "none"; };
SignColumn = { bg = "none"; };
WinSeparator = { bg = "none"; fg = "#75715e"; };
# Floating windows
NormalFloat = { bg = "none"; };
FloatBorder = { bg = "none"; fg = "#75715e"; };
# Neo-tree (including empty area below files)
NeoTreeNormal = { bg = "none"; };
NeoTreeNormalNC = { bg = "none"; };
NeoTreeEndOfBuffer = { bg = "none"; };
NeoTreeWinSeparator = { bg = "none"; fg = "#75715e"; };
# Which-key (v3 uses WhichKeyNormal)
WhichKeyNormal = { bg = "none"; };
WhichKeyFloat = { bg = "none"; };
WhichKeyBorder = { bg = "none"; fg = "#75715e"; };
# Telescope
TelescopeNormal = { bg = "none"; };
TelescopeBorder = { bg = "none"; fg = "#75715e"; };
};
plugins = {
# --- navigation ---
telescope = {
enable = true;
extensions.fzf-native.enable = true;
};
neo-tree = {
enable = true;
settings = {
filesystem = {
# Automatically focus the currently open file in the tree
follow_current_file = {
enabled = true;
leave_dirs_open = false;
};
# Keep Neo-tree's root independent of Neovim's global :cd
bind_to_cwd = false;
};
};
};
project-nvim = {
enable = true;
enableTelescope = true;
settings = {
detection_methods = [ "pattern" "lsp" ];
patterns = [ ".git" "flake.nix" "Cargo.toml" ];
};
};
# --- UI & Visuals ---
lualine.enable = true;
alpha = {
enable = true;
theme = "dashboard";
};
which-key.enable = true;
indent-blankline.enable = true;
# --- utils ---
gitsigns.enable = true; #git diffs
trouble.enable = true; #diagnostics
# --- Misc ---
# Mini.nvim, see github for all options
mini = {
enable = true;
mockDevIcons = true; # Lets mini.icons serve icons to lualine/trouble/which-key
modules = {
pairs = {}; #bracket/quote auto pairs
icons = {}; #required by ^^^
move = {};
#TODO: consider
#surround = {};
#ai = {};
#comment = {};
};
};
# auto complete
# TODO: add keybinds
cmp = {
enable = true;
autoEnableSources = true;
settings.sources = [
{ name = "nvim_lsp"; }
{ name = "path"; }
{ name = "buffer"; }
];
};
lsp = {
enable = true;
servers = {
nil_ls = { # Nix
enable = true;
settings = {
nix.flake.autoArchive = true;
};
};
clangd.enable = true; # C/C++
html.enable = true;
pyright.enable = true; # Python
lua_ls.enable = true; #TODO: requires more setup
jsonls.enable = true;
fish_lsp.enable = true; # Fish shell
bashls.enable = true; # Bash shell
};
};
rustaceanvim.enable = true;
# duo live same file editing
live-share = {
enable = true;
settings = {
username = "Winter";
};
};
};
# Define the global helper function so you can run :lua setWezTheme('solid') anytime
extraConfigLua = ''
_G.setWezTheme = function(theme)
local val = theme or ""
local b64 = vim.base64.encode(val)
local seq = string.format('\x1b]1337;SetUserVar=%s=%s\x07', 'WEZTERM_THEME', b64)
if vim.env.TMUX then
seq = string.format('\x1bPtmux;\x1b%s\x1b\\', seq)
end
pcall(vim.fn.chansend, vim.v.stderr, seq)
end
'';
autoGroups = {
WezTermUserVar = {
clear = true;
};
};
autoCmd = [
# --- Sets tab spacing for file types ---
{
event = [ "FileType" ];
pattern = [ "html" "css" "javascript" "typescript" "nix" "lua" ];
callback = {
__raw = ''
function()
vim.opt_local.expandtab = true
vim.opt_local.shiftwidth = 2
vim.opt_local.softtabstop = 2
end
'';
};
}
# --- Set default WezTerm profile on entry/resume ---
{
event = [ "UIEnter" "VimResume" ];
group = "WezTermUserVar";
callback = {
__raw = ''
function()
setWezTheme('nvim')
end
'';
};
}
# --- Clear WezTerm profile (revert to base config) on exit/suspend ---
{
event = [ "VimLeavePre" "VimSuspend" ];
group = "WezTermUserVar";
callback = {
__raw = ''
function()
setWezTheme("")
end
'';
};
}
];
};
}