diff options
Diffstat (limited to 'common/home/programs/nixvim/plugins')
| -rw-r--r-- | common/home/programs/nixvim/plugins/cmp.nix | 45 | ||||
| -rw-r--r-- | common/home/programs/nixvim/plugins/dashboard.nix | 68 | ||||
| -rw-r--r-- | common/home/programs/nixvim/plugins/default.nix | 27 | ||||
| -rw-r--r-- | common/home/programs/nixvim/plugins/friendly-snippets.nix | 4 | ||||
| -rw-r--r-- | common/home/programs/nixvim/plugins/lsp-format.nix | 4 | ||||
| -rw-r--r-- | common/home/programs/nixvim/plugins/lsp.nix | 39 | ||||
| -rw-r--r-- | common/home/programs/nixvim/plugins/lualine.nix | 4 | ||||
| -rw-r--r-- | common/home/programs/nixvim/plugins/luasnip.nix | 4 | ||||
| -rw-r--r-- | common/home/programs/nixvim/plugins/nvim-tree.nix | 7 | ||||
| -rw-r--r-- | common/home/programs/nixvim/plugins/telescope.nix | 4 | ||||
| -rw-r--r-- | common/home/programs/nixvim/plugins/treesitter.nix | 24 |
11 files changed, 230 insertions, 0 deletions
diff --git a/common/home/programs/nixvim/plugins/cmp.nix b/common/home/programs/nixvim/plugins/cmp.nix new file mode 100644 index 0000000..27cca04 --- /dev/null +++ b/common/home/programs/nixvim/plugins/cmp.nix @@ -0,0 +1,45 @@ +{ ... }: +{ + 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() + else + fallback() + end + end, { "i", "s" }) + ''; + "<S-Tab>" = '' + cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + 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"; } + ]; + }; +} diff --git a/common/home/programs/nixvim/plugins/dashboard.nix b/common/home/programs/nixvim/plugins/dashboard.nix new file mode 100644 index 0000000..77a9f3e --- /dev/null +++ b/common/home/programs/nixvim/plugins/dashboard.nix @@ -0,0 +1,68 @@ +{ ... }: +{ + enable = true; + settings = { + change_to_vcs_root = true; + config = { + footer = [ "" ]; + + header = [ + "███╗ ██╗ ███████╗ ██████╗ ██╗ ██╗ ██╗ ███╗ ███╗" + "████╗ ██║ ██╔════╝██╔═══██╗ ██║ ██║ ██║ ████╗ ████║" + "██╔██╗ ██║ █████╗ ██║ ██║ ██║ ██║ ██║ ██╔████╔██║" + "██║╚██╗██║ ██╔══╝ ██║ ██║ ╚██╗ ██╔╝ ██║ ██║╚██╔╝██║" + "██║ ╚████║ ███████╗╚██████╔╝ ╚████╔╝ ██║ ██║ ╚═╝ ██║" + "╚═╝ ╚═══╝ ╚══════╝ ╚═════╝ ╚═══╝ ╚═╝ ╚═╝ ╚═╝" + ]; + + mru = { + limit = 10; + }; + + project = { + enable = true; + }; + + packages.enable = false; + + shortcut = [ + { + action = { + __raw = '' + function(path) + vim.cmd('Telescope find_files') + end + ''; + }; + desc = "Files"; + group = "Label"; + icon = " "; + icon_hl = "@variable"; + key = "f"; + } + { + action = { + __raw = '' + function() + vim.cmd('cd ~/global/system/config'); vim.cmd('Telescope find_files') + end + ''; + }; + icon = " "; + icon_hl = "@variable"; + desc = "System Config"; + group = "Number"; + key = "c"; + } + ]; + + hide = [ + "statusline" + "tabline" + "winbar" + ]; + }; + theme = "hyper"; + }; + }; + diff --git a/common/home/programs/nixvim/plugins/default.nix b/common/home/programs/nixvim/plugins/default.nix new file mode 100644 index 0000000..6005c57 --- /dev/null +++ b/common/home/programs/nixvim/plugins/default.nix @@ -0,0 +1,27 @@ +{ pkgs, ... }: +let + plugins = [ + "web-devicons" + "dashboard" + "nvim-tree" + "telescope" + "lualine" + "treesitter" + "luasnip" + "friendly-snippets" + "cmp" + "lsp" + ]; +in +{ + plugins = builtins.listToAttrs ( + map (n: { + name = n; + value = + if builtins.pathExists ./${n}.nix then + (import ./${n}.nix { inherit pkgs; }) + else + { enable = true; }; + }) plugins + ); +} diff --git a/common/home/programs/nixvim/plugins/friendly-snippets.nix b/common/home/programs/nixvim/plugins/friendly-snippets.nix new file mode 100644 index 0000000..3887830 --- /dev/null +++ b/common/home/programs/nixvim/plugins/friendly-snippets.nix @@ -0,0 +1,4 @@ +{ ... }: +{ + enable = true; +} diff --git a/common/home/programs/nixvim/plugins/lsp-format.nix b/common/home/programs/nixvim/plugins/lsp-format.nix new file mode 100644 index 0000000..3887830 --- /dev/null +++ b/common/home/programs/nixvim/plugins/lsp-format.nix @@ -0,0 +1,4 @@ +{ ... }: +{ + enable = true; +} diff --git a/common/home/programs/nixvim/plugins/lsp.nix b/common/home/programs/nixvim/plugins/lsp.nix new file mode 100644 index 0000000..578518f --- /dev/null +++ b/common/home/programs/nixvim/plugins/lsp.nix @@ -0,0 +1,39 @@ +{ pkgs, ... }: +{ + 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"; + }; +} diff --git a/common/home/programs/nixvim/plugins/lualine.nix b/common/home/programs/nixvim/plugins/lualine.nix new file mode 100644 index 0000000..3887830 --- /dev/null +++ b/common/home/programs/nixvim/plugins/lualine.nix @@ -0,0 +1,4 @@ +{ ... }: +{ + enable = true; +} diff --git a/common/home/programs/nixvim/plugins/luasnip.nix b/common/home/programs/nixvim/plugins/luasnip.nix new file mode 100644 index 0000000..3887830 --- /dev/null +++ b/common/home/programs/nixvim/plugins/luasnip.nix @@ -0,0 +1,4 @@ +{ ... }: +{ + enable = true; +} diff --git a/common/home/programs/nixvim/plugins/nvim-tree.nix b/common/home/programs/nixvim/plugins/nvim-tree.nix new file mode 100644 index 0000000..dbd3256 --- /dev/null +++ b/common/home/programs/nixvim/plugins/nvim-tree.nix @@ -0,0 +1,7 @@ +{ ... }: +{ + enable = true; + autoClose = true; + disableNetrw = true; + hijackCursor = true; +} diff --git a/common/home/programs/nixvim/plugins/telescope.nix b/common/home/programs/nixvim/plugins/telescope.nix new file mode 100644 index 0000000..3887830 --- /dev/null +++ b/common/home/programs/nixvim/plugins/telescope.nix @@ -0,0 +1,4 @@ +{ ... }: +{ + enable = true; +} diff --git a/common/home/programs/nixvim/plugins/treesitter.nix b/common/home/programs/nixvim/plugins/treesitter.nix new file mode 100644 index 0000000..3fbd4b6 --- /dev/null +++ b/common/home/programs/nixvim/plugins/treesitter.nix @@ -0,0 +1,24 @@ +{ ... }: +{ + enable = true; + settings = { + auto_install = true; + highlight = { + additional_vim_regex_highlighting = true; + enable = true; + }; + incremental_selection = { + enable = true; + keymaps = { + init_selection = false; + node_decremental = "grm"; + node_incremental = "grn"; + scope_incremental = "grc"; + }; + }; + indent = { + enable = true; + }; + sync_install = false; + }; +} |