Vim: Difference between revisions
|  drop 24.05  compat |  Remove deprecated alias | ||
| (5 intermediate revisions by 4 users not shown) | |||
| Line 7: | Line 7: | ||
| === Basic Install === <!--T:3--> | === Basic Install === <!--T:3--> | ||
| </translate> | </translate> | ||
| <syntaxhighlight lang="nix> | <syntaxhighlight lang="nix> | ||
| Line 21: | Line 17: | ||
| </translate> | </translate> | ||
| <syntaxhighlight lang="nix> | <syntaxhighlight lang="nix"> | ||
|    programs.vim = { |    programs.vim = { | ||
|      enable = true; |      enable = true; | ||
|      package = pkgs. |      package = pkgs.vim-full; | ||
|    }; |    }; | ||
| </syntaxhighlight> | </syntaxhighlight> | ||
| Line 33: | Line 29: | ||
| </translate> | </translate> | ||
| <syntaxhighlight lang="nix> | <syntaxhighlight lang="nix"> | ||
|    environment.systemPackages = with pkgs; [  |    environment.systemPackages = with pkgs; [ vim-full ]; | ||
| </syntaxhighlight> | </syntaxhighlight> | ||
| <translate> | <translate> | ||
| Line 62: | Line 58: | ||
| <!--T:11--> | <!--T:11--> | ||
| You can configure home-manager to install spelling files into your user directory by packaging individual spell files.  Here' an example for neovim and French: | You can configure home-manager to install spelling files into your user directory by packaging individual spell files.  Here' an example for [[neovim]] and French: | ||
| </translate> | </translate> | ||
| Line 111: | Line 107: | ||
| </translate> | </translate> | ||
| < | <syntaxhighlight lang="nix"> | ||
| { pkgs, ... }: | { pkgs, ... }: | ||
| { | { | ||
| Line 117: | Line 113: | ||
|      enable = true; |      enable = true; | ||
|      defaultEditor = true; |      defaultEditor = true; | ||
|      package = (pkgs. |      package = (pkgs.vim-full.override {  }).customize{ | ||
|        name = "vim"; |        name = "vim"; | ||
| <translate> | <translate> | ||
| Line 144: | Line 140: | ||
|    }; |    }; | ||
| } | } | ||
| </ | </syntaxhighlight> | ||
| <syntaxHighlight lang="nix"> | <syntaxHighlight lang="nix"> | ||
| { pkgs, ... }: | { pkgs, ... }: | ||
| Line 246: | Line 202: | ||
| </translate> | </translate> | ||
| < | <syntaxhighlight lang="nix"> | ||
| { | { | ||
|    packageOverrides = pkgs: with pkgs; { |    packageOverrides = pkgs: with pkgs; { | ||
|      myVim =  |      myVim = vim-full.customize { | ||
|        name = "vim-with-plugins"; |        name = "vim-with-plugins"; | ||
| <translate> | <translate> | ||
| Line 276: | Line 232: | ||
|    }; |    }; | ||
| } | } | ||
| </ | </syntaxhighlight> | ||
| <translate> | <translate> | ||
| Line 290: | Line 246: | ||
| </translate> | </translate> | ||
| < | <syntaxhighlight lang="nix"> | ||
| vim-full.customize { | |||
|    name = "vim-with-plugins"; |    name = "vim-with-plugins"; | ||
| <translate> | <translate> | ||
| Line 302: | Line 258: | ||
|    ''; |    ''; | ||
| } | } | ||
| </ | </syntaxhighlight> | ||
| <translate> | <translate> | ||
| Line 311: | Line 267: | ||
| </translate> | </translate> | ||
| < | <syntaxhighlight lang="nix"> | ||
| vim-full.customize { | |||
|    vimrcConfig.packages.myVimPackage = with pkgs.vimPlugins; { |    vimrcConfig.packages.myVimPackage = with pkgs.vimPlugins; { | ||
| <translate> | <translate> | ||
| Line 331: | Line 287: | ||
|    } |    } | ||
| }; | }; | ||
| </ | </syntaxhighlight> | ||
| <translate> | <translate> | ||
| Line 373: | Line 329: | ||
| </translate> | </translate> | ||
| < | <syntaxhighlight lang="nix"> | ||
| let | let | ||
|    vim-better-whitespace = pkgs.vimUtils.buildVimPlugin { |    vim-better-whitespace = pkgs.vimUtils.buildVimPlugin { | ||
| Line 386: | Line 342: | ||
| in { | in { | ||
|    users.users.<yourNickname>.packages = [ |    users.users.<yourNickname>.packages = [ | ||
|      (pkgs. |      (pkgs.vim-full.customize { | ||
|        vimrcConfig.packages.myVimPackage = with pkgs.vimPlugins; { |        vimrcConfig.packages.myVimPackage = with pkgs.vimPlugins; { | ||
|          start = [ vim-better-whitespace ]; |          start = [ vim-better-whitespace ]; | ||
| Line 393: | Line 349: | ||
|    ]; |    ]; | ||
| }; | }; | ||
| </ | </syntaxhighlight> | ||
| <translate> | <translate> | ||
| Line 455: | Line 411: | ||
| <!--T:59--> | <!--T:59--> | ||
| The following snippet will make a full featured python IDE. | The following snippet will make a full featured [[python]] IDE. | ||
| ==== Using language client ==== <!--T:60--> | ==== Using language client ==== <!--T:60--> | ||
| </translate> | </translate> | ||
| < | <syntaxhighlight lang="nix"> | ||
| vim-full.customize { | |||
|    vimrcConfig = { |    vimrcConfig = { | ||
|      customRC = '' |      customRC = '' | ||
| Line 479: | Line 435: | ||
|      } |      } | ||
| }; | }; | ||
| </ | </syntaxhighlight> | ||
| <translate> | <translate> | ||
| Line 517: | Line 473: | ||
| <!--T:67--> | <!--T:67--> | ||
| A better alternative to youcompleteme for C/C++ is to use [https://github.com/cquery-project/cquery/ cquery] in combination with the [https://github.com/autozimu/LanguageClient-neovim LanguageClient-neovim]. It will also find in c header files when used in a nix-shell if you install cquery from nixpkgs as it uses a custom [https://github.com/NixOS/nixpkgs/commit/04f3b76dcec21f2fcba6b1b0afbb3ed224165050#diff-11cdfc0385b9e017089c1ac09c5b838e shell wrapper] | A better alternative to youcompleteme for C/C++ is to use [https://github.com/cquery-project/cquery/ cquery] in combination with the [https://github.com/autozimu/LanguageClient-neovim LanguageClient-neovim]. It will also find in c header files when used in a nix-shell if you install cquery from nixpkgs as it uses a custom [https://github.com/NixOS/nixpkgs/commit/04f3b76dcec21f2fcba6b1b0afbb3ed224165050#diff-11cdfc0385b9e017089c1ac09c5b838e shell wrapper] | ||
| == gvim and gview == <!--T:70--> | == gvim and gview == <!--T:70--> | ||
| <!--T:71--> | <!--T:71--> | ||
| <code> | You can enable <code>guiSupport</code> to make <code>gvim</code> available, though this won't give you <code>gview</code>: | ||
| </translate> | </translate> | ||
| <syntaxhighlight lang= | <syntaxhighlight lang="nix"> | ||
| (pkgs.vim-full.customize { | |||
|    guiSupport = true; | |||
| }) | |||
| } | |||
| </syntaxhighlight> | </syntaxhighlight> | ||
| <translate> | <translate> | ||
| Line 556: | Line 489: | ||
| </translate> | </translate> | ||
| [[Category:Applications]] | [[Category:Applications]] | ||
| [[Category:CLI Applications]] | |||
| [[Category:Text Editor{{#translation:}}]] | [[Category:Text Editor{{#translation:}}]] | ||