Vim/ja: Difference between revisions

FuzzyBot (talk | contribs)
Updating to match new version of source page
Haruki7049 (talk | contribs)
Created page with "以下のコードを<code>~/.nixpkgs/config.nix</code>に追加してください:"
 
(21 intermediate revisions by 2 users not shown)
Line 10: Line 10:
=== ベーシックインストール ===
=== ベーシックインストール ===


<div lang="en" dir="ltr" class="mw-content-ltr">
unstableでは:
On unstable:
</div>


<syntaxhighlight lang="nix>
<syntaxhighlight lang="nix>
Line 18: Line 16:
</syntaxhighlight>
</syntaxhighlight>


<div lang="en" dir="ltr" class="mw-content-ltr">
もしくは
or
</div>


<syntaxhighlight lang="nix>
<syntaxhighlight lang="nix>
Line 29: Line 25:
</syntaxhighlight>
</syntaxhighlight>


<div lang="en" dir="ltr" class="mw-content-ltr">
24.05かそれよりも古い場合は:
On 24.05 or older:
</div>


<syntaxhighlight lang="nix>
<syntaxhighlight lang="nix>
Line 46: Line 40:
=== Home Managerを使用した例 ===
=== Home Managerを使用した例 ===


<div class="mw-translate-fuzzy">
Vimは[[Special:MyLanguage/Home Manager|Home Manager]]を使用して簡単にセットアップ出来ます。以下は最低限の一例です:
Vimは[[Special:MyLanguage/Home Manager|Home Manager]]を使用して簡単にセットアップ出来ます。以下は最低限の一例です:
<syntaxhighlight lang="nix>
  programs.vim = {
    enable = true;
    plugins = with pkgs.vimPlugins; [ vim-airline ];
    settings = { ignorecase = true; };
    extraConfig = ''
      set mouse=a
    '';
  };
</syntaxhighlight>
</div>


<syntaxhighlight lang="nix>
<syntaxhighlight lang="nix>
Line 119: Line 101:
</div>
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
<span id="System_wide_vim/nvim_configuration"></span>
== System wide vim/nvim configuration ==
== システム全体でのvim/nvim設定 ==
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
vim/nvimのシステム全体の"ベースライン"設定が必要な場合は、次の二つの例を参照してください:
If you want a system wide "baseline" configuration for vim/nvim here are two examples:.
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
unstableでは:
On unstable:
</div>


<syntaxHighlight lang="nix">
<syntaxHighlight lang="nix">
Line 139: Line 116:
     package = (pkgs.vim_configurable.override {  }).customize{
     package = (pkgs.vim_configurable.override {  }).customize{
       name = "vim";
       name = "vim";
       <div lang="en" dir="ltr" class="mw-content-ltr">
       # 例として、Nixファイルのシンタックスハイライト表示用のプラグインをインストールする
# Install plugins for example for syntax highlighting of nix files
</div>
       vimrcConfig.packages.myplugins = with pkgs.vimPlugins; {
       vimrcConfig.packages.myplugins = with pkgs.vimPlugins; {
         start = [ vim-nix vim-lastplace ];
         start = [ vim-nix vim-lastplace ];
Line 147: Line 122:
       };
       };
       vimrcConfig.customRC = ''
       vimrcConfig.customRC = ''
         <div lang="en" dir="ltr" class="mw-content-ltr">
         " 自分のカスタムvimrc
" your custom vimrc
</div>
         set nocompatible
         set nocompatible
         set backspace=indent,eol,start
         set backspace=indent,eol,start
         <div lang="en" dir="ltr" class="mw-content-ltr">
         " シンタックスハイライトをデフォルトでオンにする
" Turn on syntax highlighting by default
</div>
         syntax on
         syntax on
         " ...
         " ...
Line 163: Line 134:
</syntaxHighlight>
</syntaxHighlight>


<div lang="en" dir="ltr" class="mw-content-ltr">
24.05かそれよりも古い場合は
On 24.05 or older:
</div>


<syntaxHighlight lang="nix">
<syntaxHighlight lang="nix">
Line 174: Line 143:
     ((vim_configurable.override {  }).customize{
     ((vim_configurable.override {  }).customize{
       name = "vim";
       name = "vim";
       <div lang="en" dir="ltr" class="mw-content-ltr">
       # 例としてNixファイルのシンタックスハイライト表示用のプラグインをインストールする
# Install plugins for example for syntax highlighting of nix files
</div>
       vimrcConfig.packages.myplugins = with pkgs.vimPlugins; {
       vimrcConfig.packages.myplugins = with pkgs.vimPlugins; {
         start = [ vim-nix vim-lastplace ];
         start = [ vim-nix vim-lastplace ];
Line 182: Line 149:
       };
       };
       vimrcConfig.customRC = ''
       vimrcConfig.customRC = ''
         <div lang="en" dir="ltr" class="mw-content-ltr">
         " 自分のカスタムvimrc
" your custom vimrc
</div>
         set nocompatible
         set nocompatible
         set backspace=indent,eol,start
         set backspace=indent,eol,start
         <div lang="en" dir="ltr" class="mw-content-ltr">
         " シンタックスハイライトをデフォルトでオンにする
" Turn on syntax highlighting by default
</div>
         syntax on
         syntax on
         " ...
         " ...
Line 207: Line 170:
     configure = {
     configure = {
       customRC = ''
       customRC = ''
         <div lang="en" dir="ltr" class="mw-content-ltr">
         " 自分のカスタムvimrc
" your custom vimrc
</div>
         set nocompatible
         set nocompatible
         set backspace=indent,eol,start
         set backspace=indent,eol,start
Line 223: Line 184:
</syntaxHighlight>
</syntaxHighlight>


<div lang="en" dir="ltr" class="mw-content-ltr">
これらのファイルを自分の<code>configuration.nix</code>でインポートする
import these in your <code>configuration.nix</code> and
</div>
<syntaxHighlight lang="nix">
<syntaxHighlight lang="nix">
{     
{     
Line 236: Line 195:
</syntaxHighlight>
</syntaxHighlight>


<div lang="en" dir="ltr" class="mw-content-ltr">
<span id="Custom_setup_without_using_Home_Manager"></span>
== Custom setup without using Home Manager ==
== Home Managerを使用しないカスタムセットアップ ==
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">
Line 244: Line 202:
</div>
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
Vimプラグインはnixの助けを借りてインストールすることができます。vimプラグインマネージャーを使用せず、すべて<code>.nixpkgs/config</code>で行うことができます。
Vim plugins can be installed with the help of nix. You can omit using vim plugin managers and do everything in your <code>.nixpkgs/config</code>.
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">
Line 252: Line 208:
</div>
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
<span id="Customizations"></span>
=== Customizations ===
=== カスタマイズする ===
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
vimもneovimも、あなたの好きなプラグインや追加ライブラリを含むようにさらに設定することができます。利用可能な全ての vim プラグインをリストアップするには、<code>nix search nixpkgs#vimPlugins</code>を実行してください。
Both vim and neovim can be further configured to include your favorite plugins and additional libraries. To list all available vim plugins, run <code>nix search nixpkgs#vimPlugins</code>.
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
以下のコードを<code>~/.nixpkgs/config.nix</code>に追加してください:
Add the following code to your <code>~/.nixpkgs/config.nix</code>:
</div>


<syntaxHighlight lang="nix">
<syntaxHighlight lang="nix">
Line 380: Line 331:
<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">
As per the instructions found in https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks/vim.section.md
As per the instructions found in https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks/vim.section.md
</div>
<div lang="en" dir="ltr" class="mw-content-ltr">
* First run <code>./update.py</code>.
* First run <code>./update.py</code>.
</div>
<div lang="en" dir="ltr" class="mw-content-ltr">
* Commit the changes with the commit message "vimPlugins: Update".
* Commit the changes with the commit message "vimPlugins: Update".
</div>
<div lang="en" dir="ltr" class="mw-content-ltr">
* Add your plugin to ./vim-plugin-names (please try to maintain the list alphabetically sorted). You can customize the branch by appending for example <code>@main</code> to an entry (search the file for examples)
* Add your plugin to ./vim-plugin-names (please try to maintain the list alphabetically sorted). You can customize the branch by appending for example <code>@main</code> to an entry (search the file for examples)
</div>
<div lang="en" dir="ltr" class="mw-content-ltr">
* Run <code>./update.py</code> once again to generate the plugin's nix expression.
* Run <code>./update.py</code> once again to generate the plugin's nix expression.
</div>
<div lang="en" dir="ltr" class="mw-content-ltr">
* Commit your changes one more time, this time with the message formated as such: "vimPlugins.[plugin-name]: init at [version]".
* Commit your changes one more time, this time with the message formated as such: "vimPlugins.[plugin-name]: init at [version]".
</div>
<div lang="en" dir="ltr" class="mw-content-ltr">
* If you need to add additional code/patches to the generated code, add those lines to <code>pkgs/misc/vim-plugins/vim2nix/additional-nix-code</code> and rerun <code>./update.py</code>. They will be included in the generated code.
* If you need to add additional code/patches to the generated code, add those lines to <code>pkgs/misc/vim-plugins/vim2nix/additional-nix-code</code> and rerun <code>./update.py</code>. They will be included in the generated code.
</div>
</div>
Line 537: Line 506:
<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">
* [https://github.com/jagajaga/my_configs/blob/master/.nixpkgs/common.nix Jagajaga’s config]
* [https://github.com/jagajaga/my_configs/blob/master/.nixpkgs/common.nix Jagajaga’s config]
</div>
<div lang="en" dir="ltr" class="mw-content-ltr">
* [https://github.com/andrewrk/dotfiles/blob/master/.nixpkgs/config.nix andrewrk's config]
* [https://github.com/andrewrk/dotfiles/blob/master/.nixpkgs/config.nix andrewrk's config]
</div>
<div lang="en" dir="ltr" class="mw-content-ltr">
* [https://github.com/wagnerf42/nixos-config/blob/master/config/my_vim.nix wagnerf42's config (good for rust language)]
* [https://github.com/wagnerf42/nixos-config/blob/master/config/my_vim.nix wagnerf42's config (good for rust language)]
</div>
</div>
Line 588: Line 563:
   wrapGui = true;
   wrapGui = true;
};
};
</syntaxhighlight
</syntaxhighlight>


[[Category:Applications]]
[[Category:Applications]]
[[Category:Text Editor{{#translation:}}]]
[[Category:Text Editor{{#translation:}}]]