refactor: config.plugins -> plugins

This commit is contained in:
Folke Lemaitre 2022-12-31 10:54:42 +01:00
parent 8625b49288
commit 09c27b5e4d
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
17 changed files with 43 additions and 36 deletions

View file

@ -16,29 +16,29 @@ A starter template for Neovim using [lazy.nvim](https://github.com/folke/lazy.nv
## File Structure
<pre>
~/.config/nvim
├── lua
└──  user
├──  plugins
│ ├──  lsp
│ │ ├──  format.lua
│ │ ├──  init.lua
│ │ ├──  keymaps.lua
│ │ └──  servers.lua
│ ├──  api.lua
│ ├──  coding.lua
│ ├──  colorscheme.lua
│ ├──  editor.lua
│ ├──  treesitter.lua
│ └──  ui.lua
├──  autocmds.lua
├──  keymaps.lua
├──  lazy.lua
└──  options.lua
├── init.lua
├── lazy-lock.json
├── README.md
└── stylua.toml
~/.config/nvim
├── lua
   ├── config
   │   ├── autocmds.lua
   │   ├── keymaps.lua
   │   ├── lazy.lua
   │   └── options.lua
   └── plugins
   ├── lsp
   │   ├── format.lua
   │   ├── init.lua
   │   ├── keymaps.lua
   │   └── servers.lua
   ├── api.lua
   ├── coding.lua
   ├── colorscheme.lua
   ├── editor.lua
   ├── treesitter.lua
   └── ui.lua
├── init.lua
├── lazy-lock.json
├── README.md
└── stylua.toml
</pre>
## Plugins

View file

@ -1,4 +1,4 @@
require("user.options")
require("user.lazy")
require("user.autocmds")
require("user.keymaps")
require("config.options")
require("config.lazy")
require("config.autocmds")
require("config.keymaps")

View file

@ -10,7 +10,7 @@
"friendly-snippets": { "branch": "main", "commit": "1a6a02350568d6830bcfa167c72f9b6e75e454ae" },
"gitsigns.nvim": { "branch": "main", "commit": "bb808fc7376ed7bac0fbe8f47b83d4bf01738167" },
"indent-blankline.nvim": { "branch": "master", "commit": "db7cbcb40cc00fc5d6074d7569fb37197705e7f6" },
"lazy.nvim": { "branch": "main", "commit": "fb46cb586242392081f908b23470e5096a8406c3" },
"lazy.nvim": { "branch": "main", "commit": "cba99de3eb73437754984fcad02b3a0e05917e56" },
"lualine.nvim": { "branch": "master", "commit": "32a7382a75a52e8ad05f4cec7eeb8bbfbe80d461" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "aa25b4153d2f2636c3b3a8c8360349d2b29e7ae3" },
"mason.nvim": { "branch": "main", "commit": "1592493e3406c271e9128b4d424731e25f1ff2a1" },

View file

@ -1,11 +1,17 @@
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath })
vim.fn.system({ "git", "-C", lazypath, "checkout", "tags/stable" }) -- last stable release
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable",
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup("user.plugins", {
require("lazy").setup("plugins", {
defaults = { lazy = true, version = "*" },
install = { colorscheme = { "tokyonight", "habamax" } },
checker = { enabled = true },

View file

@ -1,8 +1,8 @@
local servers = require("user.plugins.lsp.servers")
local servers = require("plugins.lsp.servers")
local function on_attach(client, bufnr)
require("user.plugins.lsp.format").on_attach(client, bufnr)
require("user.plugins.lsp.keymaps").on_attach(client, bufnr)
require("plugins.lsp.format").on_attach(client, bufnr)
require("plugins.lsp.keymaps").on_attach(client, bufnr)
end
return {

View file

@ -20,12 +20,12 @@ function M.on_attach(client, buffer)
},
f = {
{
require("user.plugins.lsp.format").format,
require("plugins.lsp.format").format,
"Format Document",
cond = cap.documentFormatting,
},
{
require("user.plugins.lsp.format").format,
require("plugins.lsp.format").format,
"Format Range",
cond = cap.documentRangeFormatting,
mode = "v",

View file

@ -31,6 +31,7 @@ return {
config = {
options = {
globalstatus = true,
disabled_filetypes = { statusline = { "lazy", "alpha" } },
},
},
},