Neovim/ru: Difference between revisions

FuzzyBot (talk | contribs)
Updating to match new version of source page
FuzzyBot (talk | contribs)
Updating to match new version of source page
Tags: Mobile edit Mobile web edit
Line 80: Line 80:


<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
<div lang="en" dir="ltr" class="mw-content-ltr">
# Global Configuration
# Global Configuration
</div>
programs.neovim = {
programs.neovim = {
   enable = true;
   enable = true;
Line 86: Line 88:
};
};


<div lang="en" dir="ltr" class="mw-content-ltr">
# Home Configuration
# Home Configuration
</div>
programs.neovim = {
programs.neovim = {
   enable = true;
   enable = true;
Line 123: Line 127:


<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
<div lang="en" dir="ltr" class="mw-content-ltr">
# Global Configuration
# Global Configuration
</div>
programs.neovim = {
programs.neovim = {
   enable = true;
   enable = true;
Line 145: Line 151:
};
};


<div lang="en" dir="ltr" class="mw-content-ltr">
# Home Configuration
# Home Configuration
# You have to add the line below to set it as the default editor:
# You have to add the line below to set it as the default editor:
</div>
environment.variables.EDITOR = "nvim";
environment.variables.EDITOR = "nvim";
</syntaxhighlight>
</syntaxhighlight>
Line 211: Line 219:
<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
plugins = [
plugins = [
   # Example Plugin: nvim-tree-lua
   <div lang="en" dir="ltr" class="mw-content-ltr">
# Example Plugin: nvim-tree-lua
</div>
   pkgs.vimPlugins.nvim-tree-lua
   pkgs.vimPlugins.nvim-tree-lua


   # Example Plugin: vim-startify with configuration
   <div lang="en" dir="ltr" class="mw-content-ltr">
# Example Plugin: vim-startify with configuration
</div>
   {
   {
     plugin = pkgs.vimPlugins.vim-startify;
     plugin = pkgs.vimPlugins.vim-startify;
Line 220: Line 232:
   }
   }


   # Example Plugin: nvim-colorizer-lua with Lua config
   <div lang="en" dir="ltr" class="mw-content-ltr">
# Example Plugin: nvim-colorizer-lua with Lua config
   # Due to how the runtimepath for Lua modules is processed, your configuration may require  
   # Due to how the runtimepath for Lua modules is processed, your configuration may require  
   # packadd! plugin-name to require a module. A home-manager example:
   # packadd! plugin-name to require a module. A home-manager example:
</div>
   {
   {
     plugin = pkgs.vimPlugins.nvim-colorizer-lua;
     plugin = pkgs.vimPlugins.nvim-colorizer-lua;
Line 229: Line 243:
       lua << END
       lua << END
         require 'colorizer'.setup {
         require 'colorizer'.setup {
           '*'; -- Highlight all files, but customize some others.
           '*'; <span lang="en" dir="ltr" class="mw-content-ltr">-- Highlight all files, but customize some others.</span>
           '!vim'; -- Exclude vim from highlighting.
           '!vim'; <span lang="en" dir="ltr" class="mw-content-ltr">-- Exclude vim from highlighting.</span>
         }
         }
       END
       END
Line 236: Line 250:
   }
   }


   # Example Plugin: nvim-treesitter with Lua config
   <div lang="en" dir="ltr" class="mw-content-ltr">
# Example Plugin: nvim-treesitter with Lua config
</div>
   {
   {
     plugin = pkgs.vimPlugins.nvim-treesitter;
     plugin = pkgs.vimPlugins.nvim-treesitter;
Line 244: Line 260:
         require'nvim-treesitter.configs'.setup {
         require'nvim-treesitter.configs'.setup {
           highlight = {
           highlight = {
             enable = true,              -- false will disable the whole extension
             enable = true,              <span lang="en" dir="ltr" class="mw-content-ltr">-- false will disable the whole extension</span>
             disable = {},              -- list of languages that will be disabled
             disable = {},              <span lang="en" dir="ltr" class="mw-content-ltr">-- list of languages that will be disabled</span>
           },
           },
           incremental_selection = {
           incremental_selection = {
Line 273: Line 289:
   }
   }


   # Installing grammars for tree-sitter
   <div lang="en" dir="ltr" class="mw-content-ltr">
# Installing grammars for tree-sitter
   # Option 1: Install all grammar packages
   # Option 1: Install all grammar packages
   pkgs.vimPlugins.nvim-treesitter.withAllGrammars
   pkgs.vimPlugins.nvim-treesitter.withAllGrammars
Line 279: Line 296:
   # Option 2: Install specific grammar packages
   # Option 2: Install specific grammar packages
   # (pkgs.vimPlugins.nvim-treesitter.withPlugins (p: [ p.c p.java ]))
   # (pkgs.vimPlugins.nvim-treesitter.withPlugins (p: [ p.c p.java ]))
</div>


   # Option 3: Installing grammars without Nix
   <div lang="en" dir="ltr" class="mw-content-ltr">
# Option 3: Installing grammars without Nix
   # Installing grammar packages through the built-in command can lead to errors.  
   # Installing grammar packages through the built-in command can lead to errors.  
   # The following Neovim command will install syntax highlighting for the C programming language: :TSInstall c
   # The following Neovim command will install syntax highlighting for the C programming language: :TSInstall c
</div>
];
];
</syntaxhighlight>
</syntaxhighlight>