From 3035a76f4394ba6f98bd7f45bf1cf6f2af450e09 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 19 Feb 2024 23:18:13 +0100 Subject: [PATCH] neovim plugins --- configuration.nix | 21 +++++++++++++-------- home_manager.nix | 2 ++ neovim/default.nix | 28 ++++++++++++++++++++++++++++ neovim/nvim.lua | 2 ++ nvim/cfg.vim => neovim/nvimrc | 4 ++++ 5 files changed, 49 insertions(+), 8 deletions(-) create mode 100644 neovim/default.nix create mode 100644 neovim/nvim.lua rename nvim/cfg.vim => neovim/nvimrc (96%) diff --git a/configuration.nix b/configuration.nix index 9d2ac3b..1e61b36 100644 --- a/configuration.nix +++ b/configuration.nix @@ -7,6 +7,7 @@ [ ./hardware-configuration.nix ./home_manager.nix + (import ) ]; boot.tmp.useTmpfs = true; @@ -106,14 +107,18 @@ enableSSHSupport = true; }; - programs.neovim = { - enable = true; - vimAlias = true; - viAlias = true; - defaultEditor = true; - configure = { - customRC = builtins.readFile ./nvim/cfg.vim; - }; + # programs.neovim = { + # enable = true; + # vimAlias = true; + # viAlias = true; + # defaultEditor = true; + # configure = { + # customRC = builtins.readFile ./nvim/cfg.vim; + # }; + # }; + home-manager.users.root = { + home.stateVersion = "23.11"; + imports = [ ./neovim ]; }; services.syncthing = { diff --git a/home_manager.nix b/home_manager.nix index dec3f49..1262ead 100644 --- a/home_manager.nix +++ b/home_manager.nix @@ -6,6 +6,8 @@ home-manager.users.catvayor = { home.stateVersion = "23.11"; + imports = [ ./neovim ]; + xdg.configFile."sway/config".onChange = lib.mkForce ""; home.sessionVariables = { diff --git a/neovim/default.nix b/neovim/default.nix new file mode 100644 index 0000000..439893b --- /dev/null +++ b/neovim/default.nix @@ -0,0 +1,28 @@ +{ pkgs, config, lib, ... }: +{ + programs.neovim = { + enable = true; + defaultEditor = true; + plugins = with pkgs.vimPlugins; [ + (nvim-treesitter.withPlugins (_: pkgs.tree-sitter.allGrammars)) + nvim-treesitter.withAllGrammars + vim-nix + + telescope-nvim + todo-comments-nvim + + fugitive + gitsigns-nvim + ]; + extraPackages = with pkgs; [ + git + ripgrep + fd + gcc + ]; + extraConfig = builtins.readFile ./nvimrc; + extraLuaConfig = builtins.readFile ./nvim.lua; + vimAlias = true; + viAlias = true; + }; +} diff --git a/neovim/nvim.lua b/neovim/nvim.lua new file mode 100644 index 0000000..c85b215 --- /dev/null +++ b/neovim/nvim.lua @@ -0,0 +1,2 @@ +local telescope = require('telescope') +telescope.setup {} diff --git a/nvim/cfg.vim b/neovim/nvimrc similarity index 96% rename from nvim/cfg.vim rename to neovim/nvimrc index fb9de5a..c84e09a 100644 --- a/nvim/cfg.vim +++ b/neovim/nvimrc @@ -81,6 +81,10 @@ set expandtab syntax enable +nnoremap ff Telescope find_files +nnoremap fg Telescope live_grep +nnoremap fb Telescope buffers + " let g:coqtail_nomap = 1 " " function Coqfun(count, cmd)