From b51f9bc1014ce350abe73f2c419e0bf6512194c2 Mon Sep 17 00:00:00 2001 From: Andrey0189 Date: Wed, 17 Apr 2024 05:52:14 +0500 Subject: Initial commit --- nixos/modules/nixvim/plugins/barbar.nix | 12 +++++++ nixos/modules/nixvim/plugins/cmp.nix | 32 +++++++++++++++++ nixos/modules/nixvim/plugins/comment.nix | 10 ++++++ nixos/modules/nixvim/plugins/floaterm.nix | 12 +++++++ nixos/modules/nixvim/plugins/lsp.nix | 46 ++++++++++++++++++++++++ nixos/modules/nixvim/plugins/lualine.nix | 47 +++++++++++++++++++++++++ nixos/modules/nixvim/plugins/mini.nix | 20 +++++++++++ nixos/modules/nixvim/plugins/neotree.nix | 7 ++++ nixos/modules/nixvim/plugins/nix.nix | 3 ++ nixos/modules/nixvim/plugins/plugins-bundle.nix | 15 ++++++++ nixos/modules/nixvim/plugins/telescope.nix | 29 +++++++++++++++ nixos/modules/nixvim/plugins/transparent.nix | 3 ++ 12 files changed, 236 insertions(+) create mode 100644 nixos/modules/nixvim/plugins/barbar.nix create mode 100644 nixos/modules/nixvim/plugins/cmp.nix create mode 100644 nixos/modules/nixvim/plugins/comment.nix create mode 100644 nixos/modules/nixvim/plugins/floaterm.nix create mode 100644 nixos/modules/nixvim/plugins/lsp.nix create mode 100644 nixos/modules/nixvim/plugins/lualine.nix create mode 100644 nixos/modules/nixvim/plugins/mini.nix create mode 100644 nixos/modules/nixvim/plugins/neotree.nix create mode 100644 nixos/modules/nixvim/plugins/nix.nix create mode 100644 nixos/modules/nixvim/plugins/plugins-bundle.nix create mode 100644 nixos/modules/nixvim/plugins/telescope.nix create mode 100644 nixos/modules/nixvim/plugins/transparent.nix (limited to 'nixos/modules/nixvim/plugins') diff --git a/nixos/modules/nixvim/plugins/barbar.nix b/nixos/modules/nixvim/plugins/barbar.nix new file mode 100644 index 0000000..516ec13 --- /dev/null +++ b/nixos/modules/nixvim/plugins/barbar.nix @@ -0,0 +1,12 @@ +{ + programs.nixvim.plugins.barbar = { + enable = true; + keymaps = { + silent = true; + + next = ""; + previous = ""; + close = ""; + }; + }; +} diff --git a/nixos/modules/nixvim/plugins/cmp.nix b/nixos/modules/nixvim/plugins/cmp.nix new file mode 100644 index 0000000..66afc03 --- /dev/null +++ b/nixos/modules/nixvim/plugins/cmp.nix @@ -0,0 +1,32 @@ +{ + programs.nixvim.plugins.cmp = { + enable = true; + + settings = { + snippet.expand = "function(args) require('luasnip').lsp_expand(args.body) end"; + + mapping = { + "" = "cmp.mapping.scroll_docs(-4)"; + "" = "cmp.mapping.scroll_docs(4)"; + "" = "cmp.mapping.complete()"; + "" = "cmp.mapping.close()"; + "" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})"; + "" = "cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})"; + "" = "cmp.mapping.confirm({ select = true })"; + }; + + sources = [ + {name = "path";} + {name = "nvim_lsp";} + {name = "cmp_tabby";} + {name = "luasnip";} + { + name = "buffer"; + # Words from other open buffers can also be suggested. + option.get_bufnrs.__raw = "vim.api.nvim_list_bufs"; + } + {name = "neorg";} + ]; + }; + }; +} diff --git a/nixos/modules/nixvim/plugins/comment.nix b/nixos/modules/nixvim/plugins/comment.nix new file mode 100644 index 0000000..5aa38ad --- /dev/null +++ b/nixos/modules/nixvim/plugins/comment.nix @@ -0,0 +1,10 @@ +{ + programs.nixvim.plugins.comment = { + enable = true; + + settings = { + opleader.line = "gcc"; + toggler.line = "gcc"; + }; + }; +} diff --git a/nixos/modules/nixvim/plugins/floaterm.nix b/nixos/modules/nixvim/plugins/floaterm.nix new file mode 100644 index 0000000..7185d66 --- /dev/null +++ b/nixos/modules/nixvim/plugins/floaterm.nix @@ -0,0 +1,12 @@ +{ + programs.nixvim.plugins.floaterm = { + enable = true; + + width = 0.8; + height = 0.8; + + title = ""; + + keymaps.toggle = ""; + }; +} diff --git a/nixos/modules/nixvim/plugins/lsp.nix b/nixos/modules/nixvim/plugins/lsp.nix new file mode 100644 index 0000000..045f7ed --- /dev/null +++ b/nixos/modules/nixvim/plugins/lsp.nix @@ -0,0 +1,46 @@ +{ + programs.nixvim.plugins = { + + treesitter = { + enable = true; + nixvimInjections = true; + folding = true; + indent = true; + }; + + treesitter-refactor = { + enable = true; + highlightDefinitions = { + enable = true; + # Set to false if you have an `updatetime` of ~100. + clearOnCursorMove = false; + }; + }; + + hmts.enable = true; + + # lspkind = { + # enable = true; + # + # cmp = { + # enable = true; + # menu = { + # nvim_lsp = "[LSP]"; + # nvim_lua = "[api]"; + # path = "[path]"; + # luasnip = "[snip]"; + # buffer = "[buffer]"; + # neorg = "[neorg]"; + # cmp_tabby = "[Tabby]"; + # }; + # }; + # }; + + lsp = { + enable = true; + servers = { + nil_ls.enable = true; + }; + }; + }; +} diff --git a/nixos/modules/nixvim/plugins/lualine.nix b/nixos/modules/nixvim/plugins/lualine.nix new file mode 100644 index 0000000..4fa95d7 --- /dev/null +++ b/nixos/modules/nixvim/plugins/lualine.nix @@ -0,0 +1,47 @@ +{ + programs.nixvim.plugins.lualine = { + + enable = true; + globalstatus = true; + + # +-------------------------------------------------+ + # | A | B | C X | Y | Z | + # +-------------------------------------------------+ + + sections = { + lualine_a = ["mode"]; + lualine_b = ["branch"]; + lualine_c = ["filename" "diff"]; + + lualine_x = [ + "diagnostics" + + # Show active language server + { + name.__raw = '' + function() + local msg = "" + local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype') + local clients = vim.lsp.get_active_clients() + if next(clients) == nil then + return msg + end + for _, client in ipairs(clients) do + local filetypes = client.config.filetypes + if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then + return client.name + end + end + return msg + end + ''; + icon = " "; + # color.fg = "#ffffff"; + } + "encoding" + "fileformat" + "filetype" + ]; + }; + }; +} diff --git a/nixos/modules/nixvim/plugins/mini.nix b/nixos/modules/nixvim/plugins/mini.nix new file mode 100644 index 0000000..bd41a68 --- /dev/null +++ b/nixos/modules/nixvim/plugins/mini.nix @@ -0,0 +1,20 @@ +{ + programs.nixvim.plugins.mini = { + enable = true; + + modules = { + align = {}; + basics = { + options.extra_ui = true; + }; + clue = {}; + cursorword = {}; + doc = {}; + extra = {}; + indentscope = {}; + trailspace = {}; + misc = {}; + surround = {}; + }; + }; +} diff --git a/nixos/modules/nixvim/plugins/neotree.nix b/nixos/modules/nixvim/plugins/neotree.nix new file mode 100644 index 0000000..b0c19be --- /dev/null +++ b/nixos/modules/nixvim/plugins/neotree.nix @@ -0,0 +1,7 @@ +{ + programs.nixvim.plugins.neo-tree = { + enable = true; + filesystem.followCurrentFile.enabled = true; + closeIfLastWindow = true; + }; +} diff --git a/nixos/modules/nixvim/plugins/nix.nix b/nixos/modules/nixvim/plugins/nix.nix new file mode 100644 index 0000000..295695a --- /dev/null +++ b/nixos/modules/nixvim/plugins/nix.nix @@ -0,0 +1,3 @@ +{ + programs.nixvim.plugins.nix.enable = true; +} diff --git a/nixos/modules/nixvim/plugins/plugins-bundle.nix b/nixos/modules/nixvim/plugins/plugins-bundle.nix new file mode 100644 index 0000000..9dd1140 --- /dev/null +++ b/nixos/modules/nixvim/plugins/plugins-bundle.nix @@ -0,0 +1,15 @@ +{ + imports = [ + ./lualine.nix + ./transparent.nix + ./neotree.nix + ./mini.nix + ./comment.nix + ./floaterm.nix + ./telescope.nix + ./barbar.nix + ./nix.nix + ./lsp.nix + ./cmp.nix + ]; +} diff --git a/nixos/modules/nixvim/plugins/telescope.nix b/nixos/modules/nixvim/plugins/telescope.nix new file mode 100644 index 0000000..1309eca --- /dev/null +++ b/nixos/modules/nixvim/plugins/telescope.nix @@ -0,0 +1,29 @@ +{ + programs.nixvim.plugins.telescope = { + enable = true; + + keymaps = { + "ff" = "find_files"; + "b" = "buffers"; + "fh" = "help_tags"; + "gf" = "git_files"; + "of" = "oldfiles"; + # "fg" = "live_grep"; + # "fd" = "diagnostics"; + }; + + keymapsSilent = true; + + settings.defaults = { + file_ignore_patterns = [ + "^.git/" + "^.mypy_cache/" + "^__pycache__/" + "^output/" + "^data/" + "%.ipynb" + ]; + set_env.COLORTERM = "truecolor"; + }; + }; +} diff --git a/nixos/modules/nixvim/plugins/transparent.nix b/nixos/modules/nixvim/plugins/transparent.nix new file mode 100644 index 0000000..d2139ee --- /dev/null +++ b/nixos/modules/nixvim/plugins/transparent.nix @@ -0,0 +1,3 @@ +{ + programs.nixvim.plugins.transparent.enable = true; +} -- cgit v1.2.3