From 84742c9b1a60cabf90f94a0e3aa8595ab32de954 Mon Sep 17 00:00:00 2001 From: Noa Aarts Date: Thu, 28 Mar 2024 22:07:49 +0100 Subject: [PATCH] remove nixvim --- common/nvim/nvim.nix | 239 ------------------------------------------- 1 file changed, 239 deletions(-) diff --git a/common/nvim/nvim.nix b/common/nvim/nvim.nix index aafcfbd..e726057 100644 --- a/common/nvim/nvim.nix +++ b/common/nvim/nvim.nix @@ -19,243 +19,4 @@ extraLuaConfig = lib.fileContents ./init.lua; }; - programs.nixvim = { - enable = false; - defaultEditor = true; - viAlias = true; - vimAlias = true; - - colorschemes.tokyonight = { - enable = true; - style = "night"; - }; - - globals = { - mapleader = " "; - maplocalleader = " "; - }; - - options = { - hlsearch = true; - number = true; - relativenumber = true; - mouse = "a"; - showmode = false; - breakindent = true; - undofile = true; - ignorecase = true; - smartcase = true; - signcolumn = "yes"; - updatetime = 250; - timeoutlen = 300; - splitright = true; - splitbelow = true; - - shiftwidth = 4; - tabstop = 4; - - list = true; - listchars = { tab = "» "; trail = "·"; nbsp = "␣"; }; - - inccommand = "split"; - cursorline = true; - - scrolloff = 10; - foldmethod = "expr"; - foldexpr = "nvim_treesitter#foldexpr()"; - - }; - autoGroups = { - "kickstart-highlight-yank" = { clear = true; }; - }; - - autoCmd = [ - { - event = "TextYankPost"; - group = "kickstart-highlight-yank"; - command = ''lua vim.highlight.on_yank()''; - } - { - event = ["BufReadPost" "FileReadPost"]; - command = "normal zR"; - } - ]; - - filetype.extension = { - templ = "templ"; - }; - - keymaps = [ - { mode = "n"; key = ""; action = "nohlsearch";} - { mode = "t"; key = ""; action = ""; options.desc = "Exit terminal mode" ;} - { mode = "n"; key = ""; action = ""; options.desc = "Move focus to the left window" ;} - { mode = "n"; key = ""; action = ""; options.desc = "Move focus to the right window" ;} - { mode = "n"; key = ""; action = ""; options.desc = "Move focus to the lower window" ;} - { mode = "n"; key = ""; action = ""; options.desc = "Move focus to the upper window" ;} - { mode = "n"; key = "pv"; lua = true; action = "vim.cmd.Ex";} - { mode = "x"; key = "p"; action = ''"_dP''; options.desc = "paste without override";} - { mode = [ "n" "v" ]; key = "y"; action = ''"+y''; options.desc = "copy to system clipboard";} - { mode = "n"; key = "Y"; action = ''"+Y''; options.desc = "copy line to system clipboard";} - { mode = [ "n" "v" ]; key = "d"; action = ''"_d''; options.desc = "delete without override";} - { mode = "v"; key = "J"; action = ":m '>+1gv=gv"; options.desc = "move selected down";} - { mode = "v"; key = "K"; action = ":m '<-2gv=gv"; options.desc = "move selected up";} - ]; - - plugins = { - fugitive.enable = true; - nvim-colorizer.enable = true; - comment.enable = true; - gitsigns = { - enable = true; - signs = { - add.text = "+"; - change.text = "~"; - delete.text = "_"; - topdelete.text = "‾"; - changedelete.text = "~"; - untracked.text = "┆"; - }; - }; - which-key = { - enable = true; - registrations = { - "c" = "[C]ode"; - "d" = "[D]ocument"; - "r" = "[R]ename"; - "s" = "[S]earch"; - "w" = "[W]orkspace"; - }; - }; - telescope = { - enable = true; - extensions = { - fzf-native.enable = true; - ui-select.enable = true; - }; - keymaps = { - "sh" = { action = "help_tags"; desc = "[S]earch [H]elp"; }; - "sk" = { action = "keymaps"; desc = "[S]earch [K]eymaps"; }; - "sf" = { action = "find_files"; desc = "[S]earch [F]iles"; }; - "ss" = { action = "builtin"; desc = "[S]earch [S]elect Telescope"; }; - "sw" = { action = "grep_string"; desc = "[S]earch current [W]ord"; }; - "sg" = { action = "live_grep"; desc = "[S]earch by [G]rep"; }; - "sd" = { action = "diagnostics"; desc = "[S]earch [D]iagnostics"; }; - "sr" = { action = "resume"; desc = "[S]earch [R]esume"; }; - "s." = { action = "oldfiles"; desc = ''[S]earch Recent Files ("." for repeat)''; }; - "" = { action = "buffers"; desc = "[ ] Find existing buffers"; }; - }; - }; - conform-nvim = { - enable = true; - formatOnSave = { - timeoutMs = 500; - lspFallback = true; - }; - formattersByFt = { - lua = [ "stylua" ]; - python = [ "black" ]; - yaml = [ "yamlls" ]; - }; - }; - cmp = { - enable = true; - # TODO: find out how cmp works - }; - todo-comments = { - enable = true; - signs = false; - }; - mini = { - enable = true; - modules = { - ai = { - n_lines = 500; - }; - surround = {}; - statusline = {}; - }; - }; - treesitter = { - enable = true; - indent = true; - folding = true; - nixvimInjections = true; - ignoreInstall = [ - "comment" - ]; - }; - treesitter-context = { - enable = true; - maxLines = 8; - }; - fidget.enable = true; - lsp = { - enable = true; - # TODO: use onAttach instead of the autocmd - onAttach = '' - local map = function(keys, func, desc) - vim.keymap.set("n", keys, func, { buffer = event.buf, desc = "LSP: " .. desc }) - end - map("gd", require("telescope.builtin").lsp_definitions, "[G]oto [D]efinition") - map("gr", require("telescope.builtin").lsp_references, "[G]oto [R]eferences") - map("gI", require("telescope.builtin").lsp_implementations, "[G]oto [I]mplementation") - map("D", require("telescope.builtin").lsp_type_definitions, "Type [D]efinition") - map("ds", require("telescope.builtin").lsp_document_symbols, "[D]ocument [S]ymbols") - map( - "ws", - require("telescope.builtin").lsp_dynamic_workspace_symbols, - "[W]orkspace [S]ymbols" - ) - local client = vim.lsp.get_client_by_id(event.data.client_id) - if client and client.server_capabilities.documentHighlightProvider then - vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, { - buffer = event.buf, - callback = vim.lsp.buf.document_highlight, - }) - vim.api.nvim_create_autocmd({ "CursorMoved", "CursorMovedI" }, { - buffer = event.buf, - callback = vim.lsp.buf.clear_references, - }) - end - ''; - # NOTE: there can also be keymaps for lsp apparently - - keymaps = { - diagnostic = { - "[d" = "goto_prev"; - "]d" = "goto_next"; - "e" = "open_float"; - "q" = "setloclist"; - }; - lspBuf = { - "K" = "hover"; - "rn" = "rename"; - "ca" = "code_action"; - "gD" = "declaration"; - }; - }; - - servers = { - gopls.enable = true; - htmx.enable = true; - lua-ls.enable = true; - nil_ls.enable = true; - pylsp.enable = true; - rust-analyzer = { - enable = true; - installRustc = false; - installCargo = false; - }; - yamlls.enable = true; - }; - }; - lsp-format = { - enable = true; - }; - }; - extraPlugins = with pkgs.vimPlugins; [ - vim-sleuth - neodev-nvim - ]; - }; }