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 ## File Structure
<pre> <pre>
~/.config/nvim ~/.config/nvim
├── lua ├── lua
└──  user    ├── config
├──  plugins    │   ├── autocmds.lua
│ ├──  lsp    │   ├── keymaps.lua
│ │ ├──  format.lua    │   ├── lazy.lua
│ │ ├──  init.lua    │   └── options.lua
│ │ ├──  keymaps.lua    └── plugins
│ │ └──  servers.lua    ├── lsp
│ ├──  api.lua    │   ├── format.lua
│ ├──  coding.lua    │   ├── init.lua
│ ├──  colorscheme.lua    │   ├── keymaps.lua
│ ├──  editor.lua    │   └── servers.lua
│ ├──  treesitter.lua    ├── api.lua
│ └──  ui.lua    ├── coding.lua
├──  autocmds.lua    ├── colorscheme.lua
├──  keymaps.lua    ├── editor.lua
├──  lazy.lua    ├── treesitter.lua
└──  options.lua    └── ui.lua
├── init.lua ├── init.lua
├── lazy-lock.json ├── lazy-lock.json
├── README.md ├── README.md
└── stylua.toml └── stylua.toml
</pre> </pre>
## Plugins ## Plugins

View file

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

View file

@ -10,7 +10,7 @@
"friendly-snippets": { "branch": "main", "commit": "1a6a02350568d6830bcfa167c72f9b6e75e454ae" }, "friendly-snippets": { "branch": "main", "commit": "1a6a02350568d6830bcfa167c72f9b6e75e454ae" },
"gitsigns.nvim": { "branch": "main", "commit": "bb808fc7376ed7bac0fbe8f47b83d4bf01738167" }, "gitsigns.nvim": { "branch": "main", "commit": "bb808fc7376ed7bac0fbe8f47b83d4bf01738167" },
"indent-blankline.nvim": { "branch": "master", "commit": "db7cbcb40cc00fc5d6074d7569fb37197705e7f6" }, "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" }, "lualine.nvim": { "branch": "master", "commit": "32a7382a75a52e8ad05f4cec7eeb8bbfbe80d461" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "aa25b4153d2f2636c3b3a8c8360349d2b29e7ae3" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "aa25b4153d2f2636c3b3a8c8360349d2b29e7ae3" },
"mason.nvim": { "branch": "main", "commit": "1592493e3406c271e9128b4d424731e25f1ff2a1" }, "mason.nvim": { "branch": "main", "commit": "1592493e3406c271e9128b4d424731e25f1ff2a1" },

View file

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

View file

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

View file

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