{ ... }: { programs.nixvim = { opts = { tabstop = 4; shiftwidth = 4; softtabstop = 0; expandtab = true; smartindent = true; }; plugins = { treesitter = { enable = true; settings = { auto_install = true; highlight = { additional_vim_regex_highlighting = true; custom_captures = { }; enable = true; }; indent.enable = false; folding = true; parser_install_dir = { __raw = "vim.fs.joinpath(vim.fn.stdpath('data'), 'treesitter')"; }; }; }; treesitter-context = { enable = true; settings = { line_numbers = true; max_lines = 0; min_window_height = 0; mode = "cursor"; multiline_threshold = 5; separator = "-"; trim_scope = "inner"; zindex = 20; }; }; indent-blankline = { enable = true; settings = { exclude = { buftypes = [ "terminal" "quickfix" ]; filetypes = [ "" "checkhealth" "help" "lspinfo" "packer" "TelescopePrompt" "TelescopeResults" "yaml" ]; }; indent = { char = "│"; }; scope = { show_end = false; show_exact_scope = true; show_start = false; }; }; }; lsp = { enable = true; servers = { gopls.enable = true; nixd.enable = true; lua-ls.enable = true; pylsp.enable = true; clangd = { enable = true; cmd = [ "clangd" "--fallback-style=webkit" ]; }; }; keymaps = { lspBuf = { gr = { action = "references"; desc = "Go to references"; }; gi = { action = "implementation"; desc = "Go to implementation"; }; gt = { action = "type_definition"; desc = "Go to type definition"; }; }; extra = [ { action = "LspStop"; key = "lx"; options = { desc = "Stop LSP"; }; } { action = "LspStart"; key = "ls"; options = { desc = "Start LSP"; }; } { action = "LspRestart"; key = "lr"; options = { desc = "Restart LSP"; }; } { action = "Telescope lsp_definitions"; key = "gd"; options = { desc = "Go to definitions"; }; } ]; }; }; cmp = { enable = true; autoEnableSources = true; settings = { mapping = { "" = "cmp.mapping.complete()"; "" = "cmp.mapping.scroll_docs(-4)"; "" = "cmp.mapping.close()"; "" = "cmp.mapping.scroll_docs(4)"; "" = "cmp.mapping.confirm({ select = true })"; "" = '' cmp.mapping(function (fallback) local luasnip = require('luasnip') if cmp.visible() then cmp.select_prev_item() elseif luasnip.jumpable(-1) then luasnip.jump(-1) else fallback() end end, {'i', 's'}) ''; "" = '' cmp.mapping(function (fallback) local luasnip = require('luasnip') if luasnip.expandable() then luasnip.expand() elseif cmp.visible() then cmp.select_next_item() elseif luasnip.jumpable(1) then luasnip.jump(1) else fallback() end end, {'i', 's'}) ''; }; sources = [ { name = "nvim_lsp"; } { name = "path"; } { name = "buffer"; } { name = "luasnip"; } ]; }; }; cmp-nvim-lsp.enable = true; cmp-nvim-lsp-signature-help.enable = true; telescope = { enable = true; }; luasnip.enable = true; friendly-snippets.enable = true; }; }; }