comparison modules/neovim.nix @ 0:face7f4d84f7

Initial commit
author Yasuri <yasuri@charliesmp.net>
date Mon, 28 Sep 2026 13:10:19 -0500
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:face7f4d84f7
1 { pkgs, ... }:
2
3 {
4 programs.neovim = {
5 enable = true;
6 defaultEditor = true;
7 viAlias = true;
8 vimAlias = true;
9
10 plugins = with pkgs.vimPlugins; [
11 nvim-treesitter.withAllGrammars
12 telescope-nvim
13 plenary-nvim
14 lualine-nvim
15 gitsigns-nvim
16 ];
17
18 extraLuaConfig = ''
19 -- options
20 local o = vim.opt
21 o.number = true
22 o.relativenumber = true
23 o.termguicolors = true
24 o.expandtab = true
25 o.shiftwidth = 2
26 o.tabstop = 2
27 o.smartindent = true
28 o.ignorecase = true
29 o.smartcase = true
30 o.cursorline = true
31 o.scrolloff = 8
32 o.signcolumn = "yes"
33 o.undofile = true
34 o.mouse = "a"
35 o.clipboard = "unnamedplus"
36
37 vim.g.mapleader = " "
38 local map = vim.keymap.set
39 local tb = require("telescope.builtin")
40 map("n", "<leader>ff", tb.find_files)
41 map("n", "<leader>fg", tb.live_grep)
42 map("n", "<leader>fb", tb.buffers)
43 map("n", "<leader>w", "<cmd>w<cr>")
44 map("n", "<esc>", "<cmd>nohlsearch<cr>")
45
46 -- colorscheme from the wallpaper
47 local c = {
48 bg = "#1c1a2b", fg = "#e8e0f0", sel = "#2f2b47", gray = "#4a4668",
49 dim = "#7a769a", pink = "#f5b0d8", rose = "#f28fad", mint = "#8fe3c8",
50 peach = "#f5d5b8", blue = "#79a6f5", mag = "#e9a0e6", cyan = "#7fd6f5",
51 }
52 vim.cmd("highlight clear")
53 vim.g.colors_name = "wall"
54 local function hl(g, v) vim.api.nvim_set_hl(0, g, v) end
55
56 -- transparent bg so st shows the wallpaper through
57 hl("Normal", { fg = c.fg })
58 hl("NormalFloat", { fg = c.fg, bg = c.sel })
59 hl("SignColumn", {})
60 hl("CursorLine", { bg = c.sel })
61 hl("Visual", { bg = c.gray })
62 hl("LineNr", { fg = c.gray })
63 hl("CursorLineNr", { fg = c.pink, bold = true })
64 hl("WinSeparator", { fg = c.gray })
65 hl("MatchParen", { fg = c.cyan, bold = true })
66 hl("Search", { fg = c.bg, bg = c.peach })
67 hl("IncSearch", { fg = c.bg, bg = c.pink })
68 hl("Pmenu", { fg = c.fg, bg = c.sel })
69 hl("PmenuSel", { fg = c.bg, bg = c.pink })
70 hl("Directory", { fg = c.blue })
71 hl("Comment", { fg = c.dim, italic = true })
72 hl("Constant", { fg = c.peach })
73 hl("String", { fg = c.mint })
74 hl("Number", { fg = c.peach })
75 hl("Identifier", { fg = c.fg })
76 hl("Function", { fg = c.blue })
77 hl("Statement", { fg = c.pink })
78 hl("Type", { fg = c.cyan })
79 hl("PreProc", { fg = c.mag })
80 hl("Special", { fg = c.mag })
81 hl("Error", { fg = c.rose })
82 hl("DiagnosticError", { fg = c.rose })
83 hl("DiagnosticWarn", { fg = c.peach })
84 hl("DiagnosticInfo", { fg = c.cyan })
85 hl("DiagnosticHint", { fg = c.mint })
86
87 -- statusline
88 local function mode(bg)
89 return {
90 a = { fg = c.bg, bg = bg, gui = "bold" },
91 b = { fg = c.fg, bg = c.sel },
92 c = { fg = c.dim },
93 }
94 end
95 require("lualine").setup({
96 options = {
97 theme = {
98 normal = mode(c.pink), insert = mode(c.mint), visual = mode(c.blue),
99 replace = mode(c.rose), command = mode(c.peach), inactive = mode(c.gray),
100 },
101 section_separators = "",
102 component_separators = "|",
103 },
104 })
105
106 require("gitsigns").setup()
107 vim.api.nvim_create_autocmd("FileType", {
108 callback = function(args) pcall(vim.treesitter.start, args.buf) end,
109 })
110 '';
111 };
112 }