From f7264ae43434ab218fab3f6982e7a277719cfe54 Mon Sep 17 00:00:00 2001 From: Yves Dubromelle Date: Fri, 5 Aug 2022 16:03:14 +0200 Subject: [PATCH] =?UTF-8?q?vim:=20nouvelle=20fa=C3=A7on=20d'appeler=20les?= =?UTF-8?q?=20plugins,=20reorga=20du=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../terminal/default-applications.nix | 2 - applications/terminal/default.nix | 1 + applications/terminal/vim.nix | 46 +++++++++++-------- applications/terminal/vimrc | 2 + 4 files changed, 29 insertions(+), 22 deletions(-) diff --git a/applications/terminal/default-applications.nix b/applications/terminal/default-applications.nix index ca150ef..89d3188 100644 --- a/applications/terminal/default-applications.nix +++ b/applications/terminal/default-applications.nix @@ -29,7 +29,6 @@ mkIf true { tmux # nécessaire pour byobu tree # affiche une arborescence de fichiers et dossiers usbutils - (import ./vim.nix) wget # client HTTP console which # pour connaitre le chemin d'un exécutable ]; @@ -70,6 +69,5 @@ mkIf true { }; lfs.enable = true; }; - }; }; } diff --git a/applications/terminal/default.nix b/applications/terminal/default.nix index 75e111e..510a21c 100644 --- a/applications/terminal/default.nix +++ b/applications/terminal/default.nix @@ -27,6 +27,7 @@ in ./edition-video.nix # modifier les vidéos ./jeux.nix # jouer, tout simplement ;) ./radio.nix # outils pour faire de la radio SDR + ./vim.nix # vim avec plugins ## if isDesktop ./adminsys.nix # pour gérer le système dans son ensemble et les services diff --git a/applications/terminal/vim.nix b/applications/terminal/vim.nix index 6cac9e0..e392e77 100644 --- a/applications/terminal/vim.nix +++ b/applications/terminal/vim.nix @@ -1,22 +1,28 @@ -with import {}; +{pkgs, ... }: -vim_configurable.customize { - # Specifies the vim binary name. - # E.g. set this to "my-vim" and you need to type "my-vim" to open this vim - # This allows to have multiple vim packages installed (e.g. with a different set of plugins) - name = "vim"; - vimrcConfig.customRC = builtins.readFile ./vimrc; - vimrcConfig.vam.knownPlugins = pkgs.vimPlugins; - vimrcConfig.vam.pluginDictionaries = [ - { names = [ - # Here you can place all your vim plugins - # They are installed managed by `vam` (a vim plugin manager) - #"vim-addon-nix" - "elm-vim" - "vim-fish" - "vim-nix" - "wombat256-vim" - "vimwiki" - ]; } - ]; +let + myVim = pkgs.vim_configurable.customize { + # Specifies the vim binary name. + # E.g. set this to "my-vim" and you need to type "my-vim" to open this vim + # This allows to have multiple vim packages installed (e.g. with a different set of plugins) + name = "vim"; + vimrcConfig.customRC = builtins.readFile ./vimrc; + vimrcConfig.packages.myVimPackage = with pkgs.vimPlugins; { + start = [ + wombat256-vim + ]; + opt = [ + elm-vim + vim-fish + vim-nix + vimwiki + ]; + }; + }; + +in { + programs.vim = { + defaultEditor = true; + package = myVim; + }; } diff --git a/applications/terminal/vimrc b/applications/terminal/vimrc index 24051b9..b9f3c41 100644 --- a/applications/terminal/vimrc +++ b/applications/terminal/vimrc @@ -2,6 +2,8 @@ " This must be first, because it changes other options as a side effect. set nocompatible +syntax on + " allow backspacing over everything in insert mode set backspace=indent,eol,start