From cb31edd30ab613c5484f60a06c770008e9ccd862 Mon Sep 17 00:00:00 2001 From: Matthew Stobbs Date: Thu, 20 Aug 2026 15:18:12 -0500 Subject: [PATCH] moving nvim.lua for stobbsm to nvim.nix --- config/nvim/stobbsm/nvim.lua | 16 +--- config/nvim/stobbsm/nvim.nix | 170 +++++++++++++++++++++++++++++++++++ demilich/home.nix | 22 ----- 3 files changed, 171 insertions(+), 37 deletions(-) create mode 100644 config/nvim/stobbsm/nvim.nix diff --git a/config/nvim/stobbsm/nvim.lua b/config/nvim/stobbsm/nvim.lua index c8e1e42..51a3b53 100644 --- a/config/nvim/stobbsm/nvim.lua +++ b/config/nvim/stobbsm/nvim.lua @@ -56,19 +56,6 @@ vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' } vim.opt.inccommand = 'split' -- Set foldmethod, change in .editorconfig of projects vim.opt.foldmethod = 'marker' --- General gui settings -vim.o.guifont = 'JetBrainsMono Nerd Font:12' --- Neovide settings -if vim.g.neovide then - vim.env.PATH = '/usr/local/bin:' .. vim.env.PATH - vim.env.PATH = '/usr/local/go/bin:' .. vim.env.PATH - vim.env.PATH = '/opt/homebrew/bin:' .. vim.env.PATH - vim.env.PATH = vim.env.HOME .. '/.local/bin:' .. vim.env.PATH - vim.env.PATH = vim.env.HOME .. '/.cargo/bin:' .. vim.env.PATH - vim.env.PATH = vim.env.HOME .. '/.local/cargo/bin:' .. vim.env.PATH - vim.env.PATH = vim.env.HOME .. '/go/bin:' .. vim.env.PATH - vim.env.PATH = vim.env.HOME .. '/.local/npm/bin:' .. vim.env.PATH -end vim.cmd.colorscheme 'sprouting-dark' -- }}} -- {{{ Helper functions @@ -263,7 +250,6 @@ vim.filetype.add({ }) -- }}} -- {{{ LSP Configuration local lspproto = vim.lsp.protocol -local lspconfig = vim.lsp.config local lspenable = vim.lsp.enable local capabilities = lspproto.make_client_capabilities() -- Formatter autocmd @@ -553,4 +539,4 @@ wk.add({ { '', 'tabprev', desc = 'Navigate to previous tab' }, { '', 'tabnext', desc = 'Navigate to next tab' }, }, -}) -- }}} +}) -- }}} \ No newline at end of file diff --git a/config/nvim/stobbsm/nvim.nix b/config/nvim/stobbsm/nvim.nix new file mode 100644 index 0000000..8821b79 --- /dev/null +++ b/config/nvim/stobbsm/nvim.nix @@ -0,0 +1,170 @@ +{ pkgs, ... }: { + programs.neovim = { + enable = true; + extraLuaConfig = [ + "vim.g.mapleader = ' '" + "vim.g.maplocalleader = ' '" + "vim.g.have_nerd_font = true" + "vim.opt.clipboard = 'unnamedplus'" + "vim.opt.cursorline = true" + "vim.opt.expandtab = true" + "vim.opt.hlsearch = true" + "vim.opt.inccommand = 'split'" + "vim.opt.modeline = true" + "vim.opt.mouse = 'a'" + "vim.opt.number = true" + "vim.opt.preserveindent = true" + "vim.opt.relativenumber = true" + "vim.opt.ruler = true" + "vim.opt.scrolloff = 5" + "vim.opt.shiftwidth = 2" + "vim.opt.showmode = true" + "vim.opt.showtabline = 1" + "vim.opt.softtabstop = 2" + "vim.opt.tabstop = 2" + "vim.opt.termguicolors = true" + "vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' }" + "vim.opt.inccommand = 'split'" + "vim.opt.foldmethod = 'marker'" + "vim.cmd.colorscheme 'sprouting-dark'" + ]; + plugins = with pkgs.vimPlugins; [ + { plugin = mini-align; } + { plugin = mini-basics; } + { plugin = mini-diff; } + { plugin = mini-extra; } + { plugin = mini-git; } + { plugin = mini-icons; } + { plugin = mini-move; } + { plugin = mini-operators; } + { plugin = mini-pairs; } + { plugin = mini-snippets; } + { plugin = mini-splitjoin; } + { + plugin = mini-statusline; + type = "lua"; + config = /* lua */'' + content = { + active = function() + local check_macro_recording = function() + if vim.fn.reg_recording() ~= \'\' then + return '@' .. vim.fn.reg_recording() + else + return \'\' + end + end + + -- configure statusline for active windows + local mode, mode_hl = MiniStatusline.section_mode { trunc_width = 120 } + local git = MiniStatusline.section_git { trunc_width = 40 } + local diff = MiniStatusline.section_diff { trunc_width = 75 } + local diagnostics = MiniStatusline.section_diagnostics { trunc_width = 75 } + local lsp = MiniStatusline.section_lsp { trunc_width = 75 } + local filename = MiniStatusline.section_filename { trunc_width = 140 } + local fileinfo = MiniStatusline.section_fileinfo { trunc_width = 120 } + local location = MiniStatusline.section_location { trunc_width = 75 } + local search = MiniStatusline.section_searchcount { trunc_width = 75 } + local macro = check_macro_recording() + + return MiniStatusline.combine_groups { + { hl = mode_hl, strings = { mode } }, + { hl = 'MiniStatuslineDevinfo', strings = { git, diff, diagnostics, lsp } }, + '%<', -- Mark general truncate point + { hl = 'MiniStatuslineFilename', strings = { filename } }, + '%=', -- End left alignment + { hl = 'MiniStatuslineFilename', strings = { macro } }, + { hl = 'MiniStatuslineFileinfo', strings = { fileinfo } }, + { hl = mode_hl, strings = { search, location } }, + } + end, + use_icons = true, + set_vim_settings = true, + } + ''; + } + { plugin = nui-nvim; } + { plugin = nvim-colorizer-lua; } + { + plugin = noice-nvim; + type = "lua"; + config = /* lua */'' + lsp = { + override = { + ['vim.lsp.util.convert_input_to_markdown_lines'] = true, + ['vim.lsp.util.stylize_markdown'] = true, + }, + }, + popupmenu = { + enabled = true, + backend = 'nui', + }, + notify = { + enabled = true, + view = 'notify', + }, + routes = { + { + view = 'notify', + filter = { event = 'msg_showmode' }, + }, + }, + ''; + } + { + plugin = snacks-nvim; + type = "lua"; + config = /* lua */'' + animate = {}, + dim = {}, + image = {}, + indent = {}, + lazygit = {}, + picker = {}, + ''; + } + { plugin = lazygit-nvim; } + { plugin = nvim-lspconfig; } + { plugin = nvim-treesitter; } + { plugin = plenary-nvim; } + { plugin = go-nvim; } + { plugin = guihua-lua; } + { + plugin = conform-nvim; + type = "lua"; + config = /* lua */'' + formatters_by_ft = { + ansible = { 'ansible-lint' }, + buf = { 'buf' }, + cmake = { 'cmake_format' }, + go = { 'goimports' }, + markdown = { 'cbfmt', 'mdformat' }, + sql = { 'sqlfluff' }, + terraform = { 'terraform_fmt' }, + templ = { 'go tool templ fmt' }, + }, + ''; + } + { plugin = which-key-nvim; } + { plugin = yazi-nvim; } + { plugin = dashboard-nvim; } + ]; + defaultEditor = true; + viAlias = true; + vimAlias = true; + vimdiffAlias = true; + withNodeJs = true; + withPerl = true; + withPython3 = true; + extraPackages = with pkgs; [ + delve + ginkgo + golangci-lint + gopls + gotests + gotestsum + gotools + govulncheck + tree-sitter + ]; + }; +} \ No newline at end of file diff --git a/demilich/home.nix b/demilich/home.nix index 2da6023..dbee704 100644 --- a/demilich/home.nix +++ b/demilich/home.nix @@ -239,28 +239,6 @@ }; }; }; - neovim = { - enable = true; - initLua = builtins.readFile ../config/nvim/stobbsm/nvim.lua; - defaultEditor = true; - viAlias = true; - vimAlias = true; - vimdiffAlias = true; - withNodeJs = true; - withPerl = true; - withPython3 = true; - extraPackages = with pkgs; [ - delve - ginkgo - golangci-lint - gopls - gotests - gotestsum - gotools - govulncheck - tree-sitter - ]; - }; # noctalia = { # enable = true; # settings = "${config.xdg.configHome}/dotfiles/niri/.config/niri/full.kdl";