Changed Neovim to use Nixvim instead of Lazyvim.
Moved Neovim into its own directory
This commit is contained in:
@ -22,7 +22,7 @@
|
||||
./firefox.nix
|
||||
./boot-splash.nix
|
||||
./zsh.nix
|
||||
./neovim.nix
|
||||
./neovim
|
||||
./packages
|
||||
];
|
||||
|
||||
|
||||
@ -1,95 +0,0 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
{
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
# ...
|
||||
extraPackages = with pkgs.vimPlugins; [
|
||||
lazy-nvim
|
||||
LazyVim
|
||||
|
||||
bufferline-nvim
|
||||
# stylua
|
||||
# ripgrep
|
||||
];
|
||||
|
||||
extraLuaConfig =
|
||||
let
|
||||
plugins = with pkgs.vimPlugins; [
|
||||
LazyVim
|
||||
bufferline-nvim
|
||||
cmp-buffer
|
||||
cmp-nvim-lsp
|
||||
cmp-path
|
||||
cmp_luasnip
|
||||
conform-nvim
|
||||
dashboard-nvim
|
||||
dressing-nvim
|
||||
flash-nvim
|
||||
friendly-snippets
|
||||
gitsigns-nvim
|
||||
indent-blankline-nvim
|
||||
lualine-nvim
|
||||
neo-tree-nvim
|
||||
neoconf-nvim
|
||||
neodev-nvim
|
||||
noice-nvim
|
||||
nui-nvim
|
||||
nvim-cmp
|
||||
nvim-lint
|
||||
nvim-lspconfig
|
||||
nvim-notify
|
||||
nvim-spectre
|
||||
nvim-treesitter
|
||||
nvim-treesitter-context
|
||||
nvim-treesitter-textobjects
|
||||
nvim-ts-autotag
|
||||
nvim-ts-context-commentstring
|
||||
nvim-web-devicons
|
||||
persistence-nvim
|
||||
plenary-nvim
|
||||
telescope-fzf-native-nvim
|
||||
telescope-nvim
|
||||
todo-comments-nvim
|
||||
tokyonight-nvim
|
||||
trouble-nvim
|
||||
vim-illuminate
|
||||
vim-startuptime
|
||||
which-key-nvim
|
||||
{ name = "LuaSnip"; path = luasnip; }
|
||||
{ name = "catppuccin"; path = catppuccin-nvim; }
|
||||
];
|
||||
|
||||
mkEntryFromDrv = drv:
|
||||
if lib.isDerivation drv then { name = "${lib.getName drv}"; path = drv; }
|
||||
else drv;
|
||||
|
||||
lazyPath = pkgs.linkFarm "lazy-plugins" (builtins.map mkEntryFromDrv plugins);
|
||||
in
|
||||
''
|
||||
vim.opt.clipboard = "unnamedplus"
|
||||
vim.opt.shiftwidth = 2
|
||||
|
||||
vim.opt.mousescroll = "ver:0,hor:0"
|
||||
|
||||
vim.opt.rtp:prepend("${pkgs.vimPlugins.lazy-nvim}")
|
||||
|
||||
require("lazy").setup({
|
||||
defaults = { lazy = true },
|
||||
dev = {
|
||||
path = "${lazyPath}",
|
||||
patterns = { "" },
|
||||
fallback = true,
|
||||
},
|
||||
spec = {
|
||||
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
|
||||
{ "nvim-telescope/telescope-fzf-native.nvim", enabled = true },
|
||||
{ "mason-org/mason-lspconfig.nvim", enabled = false },
|
||||
{ "mason-org/mason.nvim", enabled = false },
|
||||
--{ import = "plugins" },
|
||||
{ "nvim-treesitter/nvim-treesitter", opts = { ensure_installed = {} } },
|
||||
},
|
||||
})
|
||||
|
||||
'';
|
||||
};
|
||||
}
|
||||
@ -10,7 +10,7 @@
|
||||
];
|
||||
|
||||
home-manager.sharedModules = [
|
||||
./neovim-home.nix
|
||||
./home.nix
|
||||
];
|
||||
|
||||
|
||||
122
modules/neovim/home.nix
Normal file
122
modules/neovim/home.nix
Normal file
@ -0,0 +1,122 @@
|
||||
{ inputs, config, lib, pkgs, ... }:
|
||||
{
|
||||
imports = [
|
||||
inputs.nixvim.homeModules.nixvim
|
||||
];
|
||||
|
||||
programs.nixvim = {
|
||||
enable = true;
|
||||
|
||||
waylandSupport = true;
|
||||
|
||||
# Basic options
|
||||
opts = {
|
||||
autoindent = true;
|
||||
clipboard = "unnamedplus";
|
||||
shiftwidth = 2;
|
||||
mousescroll = "ver:0,hor:0";
|
||||
|
||||
expandtab = true; # Always insert spaces, never hard tab characters
|
||||
tabstop = 2; # Make hard tabs display as 2 columns (matches shiftwidth)
|
||||
softtabstop = 2; # Backspace deletes 2 spaces at a time
|
||||
|
||||
number = true;
|
||||
relativenumber = true;
|
||||
|
||||
cursorline = true; # Highlights the entire current line
|
||||
cursorlineopt = "both"; # Highlights both the line AND the line number
|
||||
|
||||
termguicolors = true;
|
||||
};
|
||||
|
||||
colorschemes.catppuccin = {
|
||||
enable = true;
|
||||
settings = {
|
||||
flavour = "mocha";
|
||||
term_colors = true;
|
||||
|
||||
styles = {
|
||||
booleans = [ "bold" "italic" ];
|
||||
conditionals = [ "bold" ];
|
||||
functions = [ "bold" ];
|
||||
keywords = [ "italic" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
keymaps = [
|
||||
{
|
||||
mode = "v";
|
||||
key = ">";
|
||||
action = ">gv";
|
||||
options.desc = "Indent and keep selection";
|
||||
}
|
||||
{
|
||||
mode = "v";
|
||||
key = "<";
|
||||
action = "<gv";
|
||||
options.desc = "Unindent and keep selection";
|
||||
}
|
||||
];
|
||||
|
||||
plugins = {
|
||||
# Statusline at the bottom of the screen
|
||||
lualine.enable = true;
|
||||
# Tab bar at the top of the screen
|
||||
bufferline.enable = true;
|
||||
# File type icons used by many UI plugins (Dependency)
|
||||
web-devicons.enable = true;
|
||||
# Replaces the default cmdline, messages, and popupmenu with a nicer UI
|
||||
noice.enable = true;
|
||||
# Popup notification manager
|
||||
notify.enable = true;
|
||||
treesitter = {
|
||||
# Syntax parsing for accurate highlighting and code understanding
|
||||
enable = true;
|
||||
settings = {
|
||||
highlight.enable = true;
|
||||
indent.enable = true;
|
||||
};
|
||||
};
|
||||
# Shows the current function/class context pinned at the top of the buffer
|
||||
treesitter-context.enable = true;
|
||||
# Text objects based on treesitter nodes (e.g. select a function body)
|
||||
treesitter-textobjects.enable = true;
|
||||
# Auto-closes and renames HTML/JSX tags using treesitter
|
||||
ts-autotag.enable = true;
|
||||
# Adds indentation guide lines to every indent level
|
||||
indent-blankline = {
|
||||
enable = true;
|
||||
settings = {
|
||||
indent = {
|
||||
char = "│";
|
||||
tab_char = "│"; # Explicitly define the tab indent guide character
|
||||
};
|
||||
scope = {
|
||||
enabled = true;
|
||||
};
|
||||
whitespace = {
|
||||
remove_blankline_trail = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
# Highlights and searches TODO/FIXME/HACK comments
|
||||
todo-comments.enable = true;
|
||||
nvim-autopairs = {
|
||||
enable = true;
|
||||
settings = {
|
||||
check_ts = true; # Use treesitter to avoid pairing inside strings/comments
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
extraPlugins = with pkgs.vimPlugins; [
|
||||
];
|
||||
|
||||
# Additional Lua configuration
|
||||
extraConfigLua = ''
|
||||
-- Custom Lua config here
|
||||
vim.opt.cpoptions:append('I')
|
||||
'';
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user