{ pkgs, ... }: { programs.nixvim = { enable = true; globals = { mapleader = " "; projectionist_heuristics = { "mix.exs" = { "lib/*.ex" = { type = "source"; alternate = "test/{}_test.exs"; }; "test/*_test.exs" = { type = "test"; alternate = "lib/{}.ex"; dispatch = "mix test {file}"; }; }; }; }; opts = { number = true; relativenumber = true; shiftwidth = 2; expandtab = true; tabstop = 2; }; colorschemes.catppuccin.enable = true; keymaps = [ { key = ";"; action = ":"; mode = [ "n" "v" ]; } { key = "q;"; action = "q:"; mode = [ "n" "v" ]; } { key = "y"; action = ''"+y''; mode = [ "n" "v" ]; } { key = "Y"; action = ''"+Y''; mode = [ "n" "v" ]; } { key = "p"; action = ''"+p''; mode = [ "n" "v" ]; } { key = "P"; action = ''"+P''; mode = [ "n" "v" ]; } { key = "w"; action = "w"; mode = [ "n" ]; } { key = "q"; action = "q"; mode = [ "n" ]; } { key = ""; action = "nohlsearch"; mode = [ "n" ]; } { key = ''"''; action = "split"; mode = [ "n" ]; } { key = "%"; action = "vsplit"; mode = [ "n" ]; } { key = ""; action = "NvimTreeToggle"; mode = [ "n" ]; } { key = "fl"; action = "NvimTreeFindFile"; mode = [ "n" ]; } { key = ""; action = "Telescope find_files theme=dropdown"; mode = [ "n" ]; } { key = "/"; action = "Telescope live_grep"; mode = [ "n" ]; } { key = ""; action = "ZellijNavigateLeft"; mode = [ "n" ]; } { key = ""; action = "ZellijNavigateDown"; mode = [ "n" ]; } { key = ""; action = "ZellijNavigateUp"; mode = [ "n" ]; } { key = ""; action = "ZellijNavigateRight"; mode = [ "n" ]; } ]; autoGroups = { format_on_save = { clear = true; }; }; autoCmd = [{ event = "BufWritePre"; group = "format_on_save"; pattern = "*"; command = "lua vim.lsp.buf.format()"; }]; extraPlugins = with pkgs.vimPlugins; [ vim-abolish vim-rhubarb vim-dispatch vim-dispatch-neovim vim-projectionist splitjoin-vim ]; plugins.commentary.enable = true; plugins.repeat.enable = true; plugins.fugitive.enable = true; plugins.nvim-autopairs.enable = true; plugins.nvim-surround.enable = true; plugins.web-devicons.enable = true; plugins.treesitter = { enable = true; settings.indent.enable = true; settings.highlight.enable = true; grammarPackages = with pkgs.vimPlugins.nvim-treesitter.builtGrammars; [ bash json lua markdown nix toml vim yaml elixir heex javascript typescript css html terraform ]; }; plugins.lsp = { enable = true; servers = { elixirls.enable = true; fish_lsp.enable = true; html.enable = true; nixd.enable = true; tailwindcss.enable = true; terraform_lsp.enable = true; ts_ls.enable = true; }; keymaps.lspBuf = { grn = "rename"; grr = "references"; gri = "implementation"; grd = "definition"; }; }; plugins.telescope = { enable = true; extensions.fzf-native.enable = true; }; plugins.cmp = { enable = true; autoEnableSources = true; settings = { sources = [ { name = "nvim_lsp"; } { name = "luasnip"; } { name = "path"; } { name = "buffer"; } ]; mapping = { "" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})"; "" = "cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})"; "" = "cmp.mapping.confirm({ select = true })"; "" = '' cmp.mapping(function(fallback) local luasnip = require('luasnip') if cmp.visible() then cmp.confirm({ select = true }) elseif luasnip.expand_or_locally_jumpable() then luasnip.expand_or_jump() else fallback() end end, {'i', 's'}) ''; "" = '' cmp.mapping(function(fallback) local luasnip = require('luasnip') if luasnip.locally_jumpable(-1) then luasnip.jump(-1) else fallback() end end, {'i', 's'}) ''; }; snippet.expand = '' function(args) require('luasnip').lsp_expand(args.body) end ''; }; }; plugins.zellij-nav.enable = true; plugins.neotest = { enable = true; adapters.elixir.enable = true; }; plugins.which-key = { enable = true; }; plugins.nvim-tree = { enable = true; settings.disable_netrw = true; openOnSetup = false; }; plugins.copilot-lua.enable = false; plugins.copilot-cmp.enable = false; plugins.codecompanion = { enable = false; settings = { strategies = { agent.adapter = "copilot"; chat.adapter = "copilot"; inline.adapter = "copilot"; }; }; }; }; }