{ pkgs, ... }: { # TODO # Linter (ale) # Markdown spellcheck # Missing plugins from old vim config # Trailing spaces in statusline # Good example: https://github.com/fred-drake/neovim/blob/master/config/python/language.nix imports = [ ./telescope.nix ]; programs.nixvim = { colorscheme = "sonokai"; enable = true; extraPlugins = [ pkgs.vimPlugins.indentLine pkgs.vimPlugins.nvim-lspconfig pkgs.vimPlugins.polyglot pkgs.vimPlugins.sonokai ]; globals = { mapleader = ","; sonokai_style = "atlantis"; sonokai_disable_italic_comment = 1; }; keymaps = [ { key = "rm"; action = "RenderMarkdown toggle"; } ]; opts = { colorcolumn = "88"; cursorline = true; number = true; termguicolors = true; }; plugins = { cmp = { enable = true; # Completion autoEnableSources = true; settings.sources = [ { name = "nvim_lsp"; } { name = "path"; } { name = "buffer"; } ]; settings.mapping = { "" = "cmp.mapping.scroll_docs(-2)"; "" = "cmp.mapping.scroll_docs(2)"; "" = "cmp.mapping.complete()"; "" = "cmp.mapping.close()"; "" = "cmp.mapping(cmp.mapping.select_next_item({behavior = cmp.SelectBehavior.Select}), {'i', 's'})"; "" = "cmp.mapping(cmp.mapping.select_prev_item({behavior = cmp.SelectBehavior.Select}), {'i', 's'})"; "" = "cmp.mapping.confirm({ select = false, behavior = cmp.ConfirmBehavior.Replace })"; }; }; committia.enable = true; # Enhanced git commits gitgutter.enable = true; # Show git change in first line guess-indent.enable = true; # Guess indent of the file lsp.enable = true; lsp.servers.pylsp = { enable = true; settings.plugins = { black.enabled = true; isort.enabled = true; ruff.enabled = true; ruff.formatEnabled = false; }; }; lsp.servers.bashls.enable = true; lsp.servers.gopls.enable = true; lsp.servers.nixd.enable = true; lsp.servers.terraformls = { enable = true; rootDir = "require('lspconfig.util').root_pattern('.git', '.terraform')"; }; lsp.servers.tflint.enable = true; lsp.servers.yamlls.enable = true; lsp-format.enable = true; # Automatically format on save lsp-lines.enable = true; # Display lsp hints in lines lsp-signature.enable = true; # Show function signature when typing lualine.enable = true; # Statusline render-markdown.enable = true; treesitter.enable = true; web-devicons.enable = true; }; }; }