diff options
Diffstat (limited to 'common/home/nixvim/default.nix')
| -rw-r--r-- | common/home/nixvim/default.nix | 210 |
1 files changed, 0 insertions, 210 deletions
diff --git a/common/home/nixvim/default.nix b/common/home/nixvim/default.nix deleted file mode 100644 index 628b8d0..0000000 --- a/common/home/nixvim/default.nix +++ /dev/null @@ -1,210 +0,0 @@ -{ pkgs, ... }: -{ - enable = true; - defaultEditor = true; - - enableMan = true; - - package = pkgs.unstable.neovim-unwrapped; - - extraConfigLua = '' - local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " } - for type, icon in pairs(signs) do - local hl = "DiagnosticSign" .. type - vim.fn.sign_define(hl, { text = icon, texthl= hl, numhl = hl }) - end''; - - diagnostics = { - virtual_text = { - prefix = ""; - }; - }; - - opts = { - mouse = "a"; - number = true; - softtabstop = 0; - expandtab = false; - tabstop = 2; - shiftwidth = 2; - smartindent = true; - list = true; - listchars = { - tab = "> "; - eol = "¬"; - trail = "·"; - nbsp = "•"; - }; - splitright = true; - splitbelow = true; - showcmd = true; - wildmenu = true; - hlsearch = true; - autoread = true; - swapfile = false; - }; - - clipboard = { - register = "unnamedplus"; - providers.wl-copy.enable = true; - }; - - colorschemes.base16 = { - enable = true; - colorscheme = "gruvbox-dark-pale"; - }; - - plugins = { - nvim-tree = { - enable = true; - autoClose = true; - disableNetrw = true; - hijackCursor = true; - }; - - telescope = { - enable = true; - }; - - lualine = { - enable = true; - }; - - treesitter = { - enable = true; - settings = { - auto_install = false; - ensure_installed = "all"; - highlight = { - additional_vim_regex_highlighting = true; - enable = true; - }; - ignore_install = [ "rust" ]; - incremental_selection = { - enable = true; - keymaps = { - init_selection = false; - node_decremental = "grm"; - node_incremental = "grn"; - scope_incremental = "grc"; - }; - }; - indent = { - enable = true; - }; - sync_install = false; - }; - }; - - luasnip = { - enable = true; - }; - - friendly-snippets = { - enable = true; - }; - - cmp = { - enable = true; - autoEnableSources = true; - settings = { - mapping = { - "<C-b>" = "cmp.mapping.scroll_docs(-4)"; - "<C-f>" = "cmp.mapping.scroll_docs(4)"; - "<C-Space>" = "cmp.mapping.complete()"; - "<C-e>" = "cmp.mapping.abort()"; - "<CR>" = "cmp.mapping.confirm({ select = true })"; - "<Tab>" = '' - 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("<Plugin>luasnip-expand-or-jump", true, true, true), "") - else - fallback() - end - end, { "i", "s" }) - ''; - "<S-Tab>" = '' - 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("<Plugin>luasnip-jump-prev", true, true, true), "") - else - fallback() - end - end, { "i", "s" }) - ''; - }; - snippet = { - expand = "function(args) require('luasnip').lsp_expand(args.body) end"; - }; - sources = [ - { name = "nvim_lsp"; } - { name = "luasnip"; } - { name = "path"; } - { name = "buffer"; } - ]; - }; - }; - - lsp = { - enable = true; - servers = { - bashls = { - enable = true; - package = pkgs.unstable.bash-language-server; - }; - clangd.enable = true; - nixd = { - enable = true; - settings.formatting.command = [ "nixfmt" ]; - }; - rust-analyzer = { - enable = true; - installCargo = true; - installRustc = true; - }; - pyright.enable = true; - ocamllsp.enable = true; - }; - keymaps.lspBuf = { - "gd" = "definition"; - "gD" = "references"; - "gt" = "type_definition"; - "gi" = "implementation"; - "K" = "hover"; - "rn" = "rename"; - "<space>ca" = "code_action"; - "<space>f" = "format"; - }; - }; - - lsp-format = { - enable = true; - }; - }; - - globals = { - mapleader = ","; - }; - - keymaps = [ - { - key = "<leader>tf"; - action = "<cmd>NvimTreeToggle<cr>"; - mode = "n"; - } - { - key = "<leader>f"; - action = "<cmd>lua require('telescope.builtin').find_files()<cr>"; - mode = "n"; - } - { - key = "<space>d"; - action = "<cmd>lua vim.diagnostic.open_float()<cr>"; - mode = "n"; - } - ]; -} |