aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamjan 9000 <damjan.9000@gmail.com>2024-04-17 23:08:09 +0200
committerDamjan 9000 <damjan.9000@gmail.com>2024-04-17 23:08:09 +0200
commit3d2daa7965e931b75679e435e91a49424d5168c2 (patch)
treedaf3d5d2afb803920c364cbe3a22421e7e16f54e
parentb6b33e61a49b162c22af5355239bfeca368dee1c (diff)
parent5e258d276fef52cc45a17021dc83a95748a0bc7f (diff)
Merge 'upstream' Move plugin examples from README to optional plugin files
-rw-r--r--README.md65
-rw-r--r--lua/kickstart/plugins/autopairs.lua16
-rw-r--r--lua/kickstart/plugins/neo-tree.lua25
-rw-r--r--lua/lazy-plugins.lua2
4 files changed, 45 insertions, 63 deletions
diff --git a/README.md b/README.md
index d85c682..dbd925f 100644
--- a/README.md
+++ b/README.md
@@ -101,71 +101,10 @@ That's it! Lazy will install all the plugins you have. Use `:Lazy` to view
current plugin status. Hit `q` to close the window.
Read through the `init.lua` file in your configuration folder for more
-information about extending and exploring Neovim.
+information about extending and exploring Neovim. That includes also
+examples of adding popularly requested plugins.
-#### Examples of adding popularly requested plugins
-
-NOTE: You'll need to uncomment the line in the init.lua that turns on loading custom plugins.
-
-<details>
- <summary>Adding autopairs</summary>
-
-This will automatically install [windwp/nvim-autopairs](https://github.com/windwp/nvim-autopairs)
-and enable it on startup. For more information, see documentation for
-[lazy.nvim](https://github.com/folke/lazy.nvim).
-
-In the file: `lua/custom/plugins/autopairs.lua`, add:
-
-```lua
--- File: lua/custom/plugins/autopairs.lua
-
-return {
- "windwp/nvim-autopairs",
- -- Optional dependency
- dependencies = { 'hrsh7th/nvim-cmp' },
- config = function()
- require("nvim-autopairs").setup {}
- -- If you want to automatically add `(` after selecting a function or method
- local cmp_autopairs = require('nvim-autopairs.completion.cmp')
- local cmp = require('cmp')
- cmp.event:on(
- 'confirm_done',
- cmp_autopairs.on_confirm_done()
- )
- end,
-}
-```
-
-</details>
-<details>
- <summary>Adding a file tree plugin</summary>
-
-This will install the tree plugin and add the command `:Neotree` for you.
-For more information, see the documentation at
-[neo-tree.nvim](https://github.com/nvim-neo-tree/neo-tree.nvim).
-
-In the file: `lua/custom/plugins/filetree.lua`, add:
-
-```lua
--- File: lua/custom/plugins/filetree.lua
-
-return {
- "nvim-neo-tree/neo-tree.nvim",
- version = "*",
- dependencies = {
- "nvim-lua/plenary.nvim",
- "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
- "MunifTanjim/nui.nvim",
- },
- config = function ()
- require('neo-tree').setup {}
- end,
-}
-```
-
-</details>
-
### Getting Started
[The Only Video You Need to Get Started with Neovim](https://youtu.be/m8C0Cq9Uv9o)
diff --git a/lua/kickstart/plugins/autopairs.lua b/lua/kickstart/plugins/autopairs.lua
new file mode 100644
index 0000000..87a7e5f
--- /dev/null
+++ b/lua/kickstart/plugins/autopairs.lua
@@ -0,0 +1,16 @@
+-- autopairs
+-- https://github.com/windwp/nvim-autopairs
+
+return {
+ 'windwp/nvim-autopairs',
+ event = 'InsertEnter',
+ -- Optional dependency
+ dependencies = { 'hrsh7th/nvim-cmp' },
+ config = function()
+ require('nvim-autopairs').setup {}
+ -- If you want to automatically add `(` after selecting a function or method
+ local cmp_autopairs = require 'nvim-autopairs.completion.cmp'
+ local cmp = require 'cmp'
+ cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done())
+ end,
+}
diff --git a/lua/kickstart/plugins/neo-tree.lua b/lua/kickstart/plugins/neo-tree.lua
new file mode 100644
index 0000000..c793b88
--- /dev/null
+++ b/lua/kickstart/plugins/neo-tree.lua
@@ -0,0 +1,25 @@
+-- Neo-tree is a Neovim plugin to browse the file system
+-- https://github.com/nvim-neo-tree/neo-tree.nvim
+
+return {
+ 'nvim-neo-tree/neo-tree.nvim',
+ version = '*',
+ dependencies = {
+ 'nvim-lua/plenary.nvim',
+ 'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended
+ 'MunifTanjim/nui.nvim',
+ },
+ cmd = 'Neotree',
+ keys = {
+ { '\\', ':Neotree reveal<CR>', { desc = 'NeoTree reveal' } },
+ },
+ opts = {
+ filesystem = {
+ window = {
+ mappings = {
+ ['\\'] = 'close_window',
+ },
+ },
+ },
+ },
+}
diff --git a/lua/lazy-plugins.lua b/lua/lazy-plugins.lua
index 5cd5b24..e93e193 100644
--- a/lua/lazy-plugins.lua
+++ b/lua/lazy-plugins.lua
@@ -60,6 +60,8 @@ require('lazy').setup({
-- require 'kickstart.plugins.debug',
-- require 'kickstart.plugins.indent_line',
-- require 'kickstart.plugins.lint',
+ -- require 'kickstart.plugins.autopairs',
+ -- require 'kickstart.plugins.neo-tree',
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
-- This is the easiest way to modularize your config.