{ pkgs, inputs, ... }: { home-manager.users.emily.imports = [ inputs.nixvim.homeManagerModules.nixvim ]; home-manager.users.emily.programs.nixvim = { enable = true; extraPlugins = [ pkgs.vimPlugins.molokai pkgs.vimPlugins.vim-airline-themes ]; colorscheme = "molokai"; vimAlias = true; highlightOverride.Normal = { ctermbg = "NONE"; bg = "NONE"; }; opts = { number = true; expandtab = true; autoindent = true; mouse = ""; encoding = "utf-8"; shiftwidth = 2; smartindent = true; tabstop = 2; ignorecase = true; incsearch = true; smartcase = true; }; keymaps = [ { action = "Neotree toggle"; key = ""; mode = "n"; options.silent = true; } { action = ""; key = ""; mode = "t"; } ]; plugins.cmp = { enable = true; settings.sources = [ { name = "nvim_lsp"; } { name = "luasnip"; } { name = "buffer"; } { name = "nvim_lua"; } { name = "path"; } ]; settings.formatting = { fields = [ "abbr" "kind" "menu" ]; format = '' function(_, item) local icons = { Namespace = "󰌗", Text = "󰉿", Method = "󰆧", Function = "󰆧", Constructor = "", Field = "󰜢", Variable = "󰀫", Class = "󰠱", Interface = "", Module = "", Property = "󰜢", Unit = "󰑭", Value = "󰎠", Enum = "", Keyword = "󰌋", Snippet = "", Color = "󰏘", File = "󰈚", Reference = "󰈇", Folder = "󰉋", EnumMember = "", Constant = "󰏿", Struct = "󰙅", Event = "", Operator = "󰆕", TypeParameter = "󰊄", Table = "", Object = "󰅩", Tag = "", Array = "[]", Boolean = "", Number = "", Null = "󰟢", String = "󰉿", Calendar = "", Watch = "󰥔", Package = "", Copilot = "", Codeium = "", TabNine = "", } local icon = icons[item.kind] or "" item.kind = string.format("%s %s", icon, item.kind or "") return item end ''; }; settings.snippet.expand = "function(args) require('luasnip').lsp_expand(args.body) end"; settings.window = { completion = { winhighlight = "FloatBorder:CmpBorder,Normal:CmpPmenu,CursorLine:CmpSel,Search:PmenuSel"; scrollbar = false; sidePadding = 0; border = [ "╭" "─" "╮" "│" "╯" "─" "╰" "│" ]; }; documentation = { border = [ "╭" "─" "╮" "│" "╯" "─" "╰" "│" ]; winhighlight = "FloatBorder:CmpBorder,Normal:CmpPmenu,CursorLine:CmpSel,Search:PmenuSel"; }; }; settings.mapping = { "" = "cmp.mapping.select_next_item()"; "" = "cmp.mapping.select_prev_item()"; "" = "cmp.mapping.select_next_item()"; "" = "cmp.mapping.select_prev_item()"; "" = "cmp.mapping.scroll_docs(-4)"; "" = "cmp.mapping.scroll_docs(4)"; "" = "cmp.mapping.complete()"; "" = "cmp.mapping.close()"; "" = "cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Insert, select = true })"; "" = '' cmp.mapping(function(fallback) if cmp.visible() then cmp.select_next_item() elseif require("luasnip").expand_or_jumpable() then vim.fn.feedkeys(vim.api.nvim_replace_termcodes("luasnip-expand-or-jump", true, true, true), "") else fallback() end end,{"i","s"}) ''; "" = '' cmp.mapping(function(fallback) if cmp.visible() then cmp.select_prev_item() elseif require("luasnip").jumpable(-1) then vim.fn.feedkeys(vim.api.nvim_replace_termcodes("luasnip-jump-prev", true, true, true), "") else fallback() end end,{"i","s"}) ''; }; }; plugins.lsp = { enable = true; keymaps.lspBuf = { "K" = "hover"; "gd" = "definition"; "gD" = "references"; "gt" = "type_definition"; "gi" = "implementation"; }; servers = { bashls.enable = true; lua-ls.enable = true; nil-ls = { enable = true; settings.formatting.command = [ "nixfmt" "-w" "140" ]; }; nixd = { enable = false; settings = { eval.depth = 5; eval.workers = 6; formatting.command = [ "nixfmt" "-w" "140" ]; options.enable = true; }; }; ruff-lsp.enable = true; rust-analyzer = { enable = true; installRustc = true; installCargo = true; }; }; }; plugins.none-ls = { enable = true; sources.diagnostics = { pylint.enable = true; statix.enable = true; }; sources.formatting = { nixfmt.enable = true; markdownlint.enable = true; }; }; plugins.neo-tree = { enable = true; closeIfLastWindow = true; }; plugins.treesitter = { enable = true; nixGrammars = true; settings.indent.enable = true; }; plugins.airline.enable = true; plugins.cmp-buffer.enable = true; plugins.cmp-emoji.enable = true; plugins.cmp-nvim-lsp.enable = true; plugins.cmp-path.enable = true; plugins.cmp_luasnip.enable = true; plugins.luasnip.enable = true; plugins.nvim-autopairs.enable = true; plugins.rainbow-delimiters.enable = true; plugins.rustaceanvim.enable = true; plugins.treesitter-context.enable = true; }; }