From a30711ef62284236d7bf5f46a9a5db415b6f5727 Mon Sep 17 00:00:00 2001 From: joygnu Date: Mon, 8 Jul 2024 14:25:03 +0200 Subject: [PATCH] neovim --- modules/neovim/default.nix | 46 ---------------- modules/neovim/plugins/alpha.nix | 78 --------------------------- modules/neovim/plugins/cmp.nix | 81 ---------------------------- modules/neovim/plugins/default.nix | 10 ---- modules/neovim/plugins/lsp.nix | 12 ----- modules/neovim/plugins/luasnip.nix | 16 ------ modules/neovim/plugins/telescope.nix | 48 ----------------- modules/neovim/set.nix | 28 ---------- 8 files changed, 319 deletions(-) delete mode 100644 modules/neovim/default.nix delete mode 100644 modules/neovim/plugins/alpha.nix delete mode 100644 modules/neovim/plugins/cmp.nix delete mode 100644 modules/neovim/plugins/default.nix delete mode 100644 modules/neovim/plugins/lsp.nix delete mode 100644 modules/neovim/plugins/luasnip.nix delete mode 100644 modules/neovim/plugins/telescope.nix delete mode 100644 modules/neovim/set.nix diff --git a/modules/neovim/default.nix b/modules/neovim/default.nix deleted file mode 100644 index ca03b3e..0000000 --- a/modules/neovim/default.nix +++ /dev/null @@ -1,46 +0,0 @@ -{ ... }: -{ - home-manager.users.joy = { - imports = [ - ./plugins - ./set.nix - ]; - programs.nixvim = { - enable = true; - defaultEditor = true; - vimAlias = true; - clipboard.register = "unnamedplus"; - colorschemes.gruvbox.enable = true; - - plugins = { - presence-nvim = { - enable = true; - mainImage = "file"; - }; - bufferline = { - enable = true; - separatorStyle = "slope"; - }; - treesitter = { - enable = true; - indent = true; - nixvimInjections = true; - }; - treesitter-context.enable = true; - nvim-tree = { - enable = true; - renderer.groupEmpty = true; - }; - lualine.enable = true; - }; - - keymaps = [ - { - mode = "n"; - key = ""; - action = "NvimTreeToggle"; - } - ]; - }; - }; -} diff --git a/modules/neovim/plugins/alpha.nix b/modules/neovim/plugins/alpha.nix deleted file mode 100644 index 3975997..0000000 --- a/modules/neovim/plugins/alpha.nix +++ /dev/null @@ -1,78 +0,0 @@ -{ ... }: -{ - programs.nixvim.plugins.alpha = { - enable = true; - layout = [ - { - type = "padding"; - val = 4; - } - { - opts = { - hl = "AlphaHeader"; - position = "center"; - }; - type = "text"; - val = [ - " ▄▄▄█████▓ ▒█████ ███▄ ▄███▓ " - " ▓ ██▒ ▓▒▒██▒ ██▒▓██▒▀█▀ ██▒ " - " ▒ ▓██░ ▒░▒██░ ██▒▓██ ▓██░ " - " ░ ▓██▓ ░ ▒██ ██░▒██ ▒██ " - " ▒██▒ ░ ░ ████▓▒░▒██▒ ░██▒ " - " ▒ ░░ ░ ▒░▒░▒░ ░ ▒░ ░ ░ " - " ░ ░ ▒ ▒░ ░ ░ ░ " - " ░ ░ ░ ░ ▒ ░ ░ " - " ░ ░ ░ " - " " - " git@github.com:TomJuri " - ]; - } - { - type = "padding"; - val = 2; - } - { - type = "group"; - val = let - mkButton = shortcut: cmd: val: hl: { - type = "button"; - inherit val; - opts = { - inherit hl shortcut; - keymap = [ - "n" - shortcut - cmd - {} - ]; - position = "center"; - cursor = 0; - width = 40; - align_shortcut = "right"; - hl_shortcut = "Keyword"; - }; - }; - in [ - ( - mkButton - "f" - "lua require('telescope.builtin').find_files({hidden = true})" - "🔍 Find File" - "Operator" - ) - ( - mkButton - "q" - "qa" - "💣 Quit" - "String" - ) - ]; - } - { - type = "padding"; - val = 2; - } - ]; - }; -} diff --git a/modules/neovim/plugins/cmp.nix b/modules/neovim/plugins/cmp.nix deleted file mode 100644 index 309fbcc..0000000 --- a/modules/neovim/plugins/cmp.nix +++ /dev/null @@ -1,81 +0,0 @@ -{ ... }: -{ - programs.nixvim = { - plugins = { - cmp-nvim-lsp.enable = true; - cmp_luasnip.enable = true; - cmp = { - enable = true; - settings = { - autoEnableSources = true; - experimental = { ghost_text = true; }; - performance = { - debounce = 57; - fetchingTimeout = 197; - maxViewEntries = 27; - }; - - snippet.expand = '' - function(args) - require('luasnip').lsp_expand(args.body) - end - ''; - - formatting.fields = ["kind" "abbr" "menu"]; - - sources = [ - { - name = "nvim_lsp"; - } - { - name = "luasnip"; - } - ]; - - mapping = { - "" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})"; - "" = "cmp.mapping.confirm({ select = true })"; - "" = "cmp.mapping.complete()"; - "" = "cmp.mapping.select_next_item()"; - "" = "cmp.mapping.select_prev_item()"; - }; - - window = { - completion.border = "solid"; - documentation.border = "solid"; - }; - }; - }; - }; - extraConfigLua = '' - luasnip = require("luasnip") - kind_icons = { - Text = "󰊄", - Method = "", - Function = "󰡱", - Constructor = "", - Field = "", - Variable = "󱀍", - Class = "", - Interface = "", - Module = "󰕳", - Property = "", - Unit = "", - Value = "", - Enum = "", - Keyword = "", - Snippet = "", - Color = "", - File = "", - Reference = "", - Folder = "", - EnumMember = "", - Constant = "", - Struct = "", - Event = "", - Operator = "", - TypeParameter = "", - } - ''; - }; -} diff --git a/modules/neovim/plugins/default.nix b/modules/neovim/plugins/default.nix deleted file mode 100644 index 80a20e4..0000000 --- a/modules/neovim/plugins/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ ... }: -{ - imports = [ - ./alpha.nix - ./cmp.nix - ./lsp.nix - ./luasnip.nix - ./telescope.nix - ]; -} diff --git a/modules/neovim/plugins/lsp.nix b/modules/neovim/plugins/lsp.nix deleted file mode 100644 index c133f97..0000000 --- a/modules/neovim/plugins/lsp.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ ... }: -{ - programs.nixvim.plugins.lsp = { - enable = true; - servers = { - nil-ls = { enable = true; }; - kotlin-language-server = { enable = true; }; - rust-analyzer = { enable = true; installCargo = true; installRustc = true; }; - pyright = { enable = true; }; - }; - }; -} diff --git a/modules/neovim/plugins/luasnip.nix b/modules/neovim/plugins/luasnip.nix deleted file mode 100644 index 888df13..0000000 --- a/modules/neovim/plugins/luasnip.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ pkgs, ... }: -{ - programs.nixvim.plugins.luasnip = { - enable = true; - extraConfig = { - enable_autosnippets = true; - store_selection_keys = ""; - }; - fromVscode = [ - { - lazyLoad = true; - paths = "${pkgs.vimPlugins.friendly-snippets}"; - } - ]; - }; -} diff --git a/modules/neovim/plugins/telescope.nix b/modules/neovim/plugins/telescope.nix deleted file mode 100644 index 7996520..0000000 --- a/modules/neovim/plugins/telescope.nix +++ /dev/null @@ -1,48 +0,0 @@ -{ pkgs, ... }: -{ - home.packages = [ - pkgs.ripgrep - ]; - - programs.nixvim.plugins.telescope = { - enable = true; - extensions = { - file-browser = { - enable = true; - }; - fzf-native = { - enable = true; - }; - }; - settings = { - defaults = { - layout_config = { - horizontal = { - prompt_position = "top"; - }; - }; - sorting_strategy = "ascending"; - }; - }; - keymaps = { - "" = { - action = "find_files, {}"; - options = { - desc = "Find project files"; - }; - }; - "/" = { - action = "live_grep"; - options = { - desc = "Grep (root dir)"; - }; - }; - "" = { - action = "git_files, {}"; - options = { - desc = "Search git files"; - }; - }; - }; - }; -} diff --git a/modules/neovim/set.nix b/modules/neovim/set.nix deleted file mode 100644 index da15fa0..0000000 --- a/modules/neovim/set.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ ... }: -{ - programs.nixvim = { - globals.mapleader = " "; - - opts = { - number = true; - relativenumber = true; - - tabstop = 2; - softtabstop = 2; - showtabline = 2; - expandtab = true; - - shiftwidth = 2; - smartindent = true; - - breakindent = true; - cursorline = true; - scrolloff = 8; - cmdheight = 0; - wrap = true; - termguicolors = true; - colorcolumn = "150"; - showmode = false; - }; - }; -}