converted from packer to lazy
This commit is contained in:
parent
8c70ffcc1f
commit
7b6c664ceb
14 changed files with 137 additions and 96 deletions
|
@ -1,6 +1,6 @@
|
|||
require("user.options")
|
||||
require("user.keymaps")
|
||||
require("user.plugins")
|
||||
require("config.options")
|
||||
require("config.keymaps")
|
||||
require("config.lazy")
|
||||
--vim.cmd[[colorscheme Spacedust]]
|
||||
--vim.cmd([[colorscheme gruvbox]])
|
||||
vim.cmd[[colorscheme nord]]
|
||||
--vim.cmd[[colorscheme nord]]
|
||||
|
|
35
.config/nvim/lua/config/lazy.lua
Normal file
35
.config/nvim/lua/config/lazy.lua
Normal file
|
@ -0,0 +1,35 @@
|
|||
-- Bootstrap lazy.nvim
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
||||
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
|
||||
if vim.v.shell_error ~= 0 then
|
||||
vim.api.nvim_echo({
|
||||
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
||||
{ out, "WarningMsg" },
|
||||
{ "\nPress any key to exit..." },
|
||||
}, true, {})
|
||||
vim.fn.getchar()
|
||||
os.exit(1)
|
||||
end
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
-- Make sure to setup `mapleader` and `maplocalleader` before
|
||||
-- loading lazy.nvim so that mappings are correct.
|
||||
-- This is also a good place to setup other settings (vim.opt)
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = "\\"
|
||||
|
||||
-- Setup lazy.nvim
|
||||
require("lazy").setup({
|
||||
spec = {
|
||||
-- import your plugins
|
||||
{ import = "plugins" },
|
||||
},
|
||||
-- Configure any other settings here. See the documentation for more details.
|
||||
-- colorscheme that will be used when installing plugins.
|
||||
install = { colorscheme = { "habamax" } },
|
||||
-- automatically check for plugin updates
|
||||
checker = { enabled = true },
|
||||
})
|
8
.config/nvim/lua/plugins/comment.lua
Normal file
8
.config/nvim/lua/plugins/comment.lua
Normal file
|
@ -0,0 +1,8 @@
|
|||
return {
|
||||
'numToStr/Comment.nvim',
|
||||
-- opts = {}
|
||||
|
||||
config = function()
|
||||
require('Comment').setup()
|
||||
end,
|
||||
}
|
9
.config/nvim/lua/plugins/create-color-code.lua
Normal file
9
.config/nvim/lua/plugins/create-color-code.lua
Normal file
|
@ -0,0 +1,9 @@
|
|||
return {
|
||||
"uga-rosa/ccc.nvim",
|
||||
opts = {
|
||||
highlighter = {
|
||||
auto_enable = true,
|
||||
lsp = false,
|
||||
},
|
||||
}
|
||||
}
|
12
.config/nvim/lua/plugins/lualine.lua
Normal file
12
.config/nvim/lua/plugins/lualine.lua
Normal file
|
@ -0,0 +1,12 @@
|
|||
return {
|
||||
'nvim-lualine/lualine.nvim',
|
||||
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
||||
|
||||
config = function()
|
||||
require('lualine').setup({
|
||||
options = {
|
||||
theme = 'nord',
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
25
.config/nvim/lua/plugins/mason.lua
Normal file
25
.config/nvim/lua/plugins/mason.lua
Normal file
|
@ -0,0 +1,25 @@
|
|||
return {
|
||||
"neovim/nvim-lspconfig",
|
||||
|
||||
dependencies = {
|
||||
"williamboman/mason.nvim",
|
||||
},
|
||||
|
||||
config = function()
|
||||
local lspconfig = require("lspconfig")
|
||||
local mason = require("mason")
|
||||
|
||||
mason.setup({
|
||||
ui = {
|
||||
icons = {
|
||||
package_installed = "✓",
|
||||
package_pending = "➜",
|
||||
package_uninstalled = "✗"
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
lspconfig.rust_analyzer.setup({})
|
||||
|
||||
end,
|
||||
}
|
7
.config/nvim/lua/plugins/nvim-autopairs.lua
Normal file
7
.config/nvim/lua/plugins/nvim-autopairs.lua
Normal file
|
@ -0,0 +1,7 @@
|
|||
return {
|
||||
'windwp/nvim-autopairs',
|
||||
event = "InsertEnter",
|
||||
config = true
|
||||
-- use opts = {} for passing setup options
|
||||
-- this is equivalent to setup({}) function
|
||||
}
|
11
.config/nvim/lua/plugins/nvim-tree.lua
Normal file
11
.config/nvim/lua/plugins/nvim-tree.lua
Normal file
|
@ -0,0 +1,11 @@
|
|||
return {
|
||||
"nvim-tree/nvim-tree.lua",
|
||||
version = "*",
|
||||
lazy = false,
|
||||
dependencies = {
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
config = function()
|
||||
require("nvim-tree").setup {}
|
||||
end,
|
||||
}
|
5
.config/nvim/lua/plugins/telescope.lua
Normal file
5
.config/nvim/lua/plugins/telescope.lua
Normal file
|
@ -0,0 +1,5 @@
|
|||
return {
|
||||
'nvim-telescope/telescope.nvim', tag = '0.1.8',
|
||||
|
||||
dependencies = { 'nvim-lua/plenary.nvim' }
|
||||
}
|
14
.config/nvim/lua/plugins/theme.lua
Normal file
14
.config/nvim/lua/plugins/theme.lua
Normal file
|
@ -0,0 +1,14 @@
|
|||
return {
|
||||
-- the colorscheme should be available when starting neovim
|
||||
{
|
||||
--"folke/tokyonight.nvim",
|
||||
"shaunsingh/nord.nvim",
|
||||
lazy = false, -- make sure we load this during the startup if its your main colorscheme
|
||||
priority = 1000, -- make sure to load this before all the other start plugins
|
||||
config = function()
|
||||
-- load the colorscheme here
|
||||
--vim.cmd([[colorscheme tokyonight]])
|
||||
vim.cmd([[colorscheme nord]])
|
||||
end,
|
||||
}
|
||||
}
|
7
.config/nvim/lua/plugins/treesitter.lua
Normal file
7
.config/nvim/lua/plugins/treesitter.lua
Normal file
|
@ -0,0 +1,7 @@
|
|||
return {
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
|
||||
configure = function()
|
||||
require('nvim-treesitter').setup()
|
||||
end,
|
||||
}
|
|
@ -1,92 +0,0 @@
|
|||
local ensure_packer = function()
|
||||
local fn = vim.fn
|
||||
local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'
|
||||
if fn.empty(fn.glob(install_path)) > 0 then
|
||||
fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path})
|
||||
vim.cmd [[packadd packer.nvim]]
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
local packer_bootstrap = ensure_packer()
|
||||
|
||||
return require('packer').startup(function(use)
|
||||
use 'wbthomason/packer.nvim'
|
||||
use {
|
||||
'williamboman/mason.nvim',
|
||||
run = ':MasonUpdate' -- :MasonUpdate updates registry contents
|
||||
}
|
||||
-- use 'NvChad/nvim-colorizer.lua'
|
||||
use 'uga-rosa/ccc.nvim'
|
||||
use 'windwp/nvim-autopairs'
|
||||
use 'nvim-tree/nvim-tree.lua'
|
||||
use 'nvim-tree/nvim-web-devicons'
|
||||
use 'williamboman/mason-lspconfig.nvim'
|
||||
use 'neovim/nvim-lspconfig'
|
||||
use {'akinsho/bufferline.nvim', tag = "*", requires = 'nvim-tree/nvim-web-devicons'}
|
||||
-- use {'neoclide/coc.nvim', branch = 'release'}
|
||||
|
||||
-- Themes
|
||||
use 'folke/tokyonight.nvim'
|
||||
use 'shaunsingh/nord.nvim'
|
||||
use { "ellisonleao/gruvbox.nvim" }
|
||||
|
||||
use 'numToStr/Comment.nvim'
|
||||
|
||||
use 'mfussenegger/nvim-dap'
|
||||
use { "rcarriga/nvim-dap-ui", requires = {"mfussenegger/nvim-dap"}}
|
||||
use 'mfussenegger/nvim-lint'
|
||||
use 'mhartington/formatter.nvim'
|
||||
|
||||
use 'nvim-lua/plenary.nvim'
|
||||
use { 'nvim-telescope/telescope-fzf-native.nvim', run = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build' }
|
||||
use {
|
||||
'nvim-telescope/telescope.nvim', tag = '0.1.5',
|
||||
requires = { {'nvim-lua/plenary.nvim'} }
|
||||
}
|
||||
use {
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
run = ':TSUpdate',
|
||||
ensure_installed = 'all'
|
||||
}
|
||||
|
||||
-- Automatically set up your configuration after cloning packer.nvim
|
||||
-- Put this at the end after all plugins
|
||||
if packer_bootstrap then
|
||||
require('packer').sync()
|
||||
end
|
||||
|
||||
-- mason setup
|
||||
require 'mason'.setup()
|
||||
|
||||
-- colorizer setup
|
||||
-- require 'colorizer'.setup()
|
||||
|
||||
-- comment.nvim for toggling line comments
|
||||
require 'Comment'.setup()
|
||||
|
||||
-- ccc.nvim setup
|
||||
require 'ccc'.setup({
|
||||
highlighter = {
|
||||
auto_enable = true,
|
||||
lsp = false,
|
||||
},
|
||||
})
|
||||
|
||||
-- autopairs setup
|
||||
require 'nvim-autopairs'.setup()
|
||||
|
||||
-- nvim-tree setup
|
||||
require 'nvim-tree'.setup()
|
||||
|
||||
-- lspconfig
|
||||
require 'mason-lspconfig'.setup()
|
||||
require 'lspconfig'.cssls.setup{}
|
||||
require 'lspconfig'.jsonls.setup{}
|
||||
|
||||
-- bufferline setup
|
||||
require 'bufferline'.setup()
|
||||
|
||||
|
||||
end)
|
Loading…
Add table
Reference in a new issue