Nvim: change package manager from packer to lazy
This commit is contained in:
parent
884e29d6f2
commit
409ae40b9e
5 changed files with 102 additions and 129 deletions
|
@ -1,5 +1,4 @@
|
||||||
[actions]
|
[actions]
|
||||||
nvim-packer-sync = "nvim -c 'autocmd User PackerComplete quitall' -c 'PackerSync'"
|
|
||||||
dconf-load = "dconf load / < ~/.config/dconf.ini"
|
dconf-load = "dconf load / < ~/.config/dconf.ini"
|
||||||
|
|
||||||
[config]
|
[config]
|
||||||
|
@ -32,7 +31,6 @@ dst = "~/.config/imapnotify"
|
||||||
src = ".config/imapnotify"
|
src = ".config/imapnotify"
|
||||||
|
|
||||||
[dotfiles.d_nvim]
|
[dotfiles.d_nvim]
|
||||||
actions = ["nvim-packer-sync"]
|
|
||||||
dst = "~/.config/nvim"
|
dst = "~/.config/nvim"
|
||||||
src = ".config/nvim"
|
src = ".config/nvim"
|
||||||
|
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
vim.g.firenvim_config = {
|
|
||||||
localSettings = {
|
|
||||||
[".*"] = {
|
|
||||||
takeOver = "never",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
|
@ -1,229 +1,202 @@
|
||||||
local fn = vim.fn
|
-- Install lazy if it's not yet installed
|
||||||
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||||
-- Install packer if it's not yet installed
|
if not vim.loop.fs_stat(lazypath) then
|
||||||
local install_path = fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim"
|
vim.fn.system({
|
||||||
if fn.empty(fn.glob(install_path)) > 0 then
|
|
||||||
print("Installing Packer")
|
|
||||||
Packer_bootstrap = fn.system({
|
|
||||||
"git",
|
"git",
|
||||||
"clone",
|
"clone",
|
||||||
"--depth",
|
"--filter=blob:none",
|
||||||
"1",
|
"https://github.com/folke/lazy.nvim.git",
|
||||||
"https://github.com/wbthomason/packer.nvim",
|
"--branch=stable", -- latest stable release
|
||||||
install_path,
|
lazypath,
|
||||||
})
|
})
|
||||||
vim.cmd([[packadd packer.nvim]])
|
|
||||||
print("Installed Packer")
|
|
||||||
end
|
end
|
||||||
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
|
||||||
-- Configure packer
|
-- Configure lazy
|
||||||
require("packer").startup(function()
|
local plugins = {
|
||||||
local use = require("packer").use
|
|
||||||
|
|
||||||
-- The plugin manager itself
|
|
||||||
use({ "wbthomason/packer.nvim" })
|
|
||||||
|
|
||||||
-- Colorscheme
|
-- Colorscheme
|
||||||
use({
|
{
|
||||||
"rebelot/kanagawa.nvim",
|
"rebelot/kanagawa.nvim",
|
||||||
config = function()
|
config = function()
|
||||||
vim.cmd("colorscheme kanagawa")
|
vim.cmd("colorscheme kanagawa")
|
||||||
end,
|
end,
|
||||||
})
|
},
|
||||||
|
|
||||||
-- Statusline
|
-- Statusline
|
||||||
use({
|
{
|
||||||
"nvim-lualine/lualine.nvim",
|
"nvim-lualine/lualine.nvim",
|
||||||
requires = { "kyazdani42/nvim-web-devicons", opt = true },
|
dependencies = { "kyazdani42/nvim-web-devicons" },
|
||||||
config = require("plugins.lualine"),
|
config = require("plugins.lualine"),
|
||||||
})
|
},
|
||||||
|
|
||||||
-- Startup screen/dashboard
|
|
||||||
--use 'glepnir/dashboard-nvim'
|
|
||||||
|
|
||||||
-- Git status in signcolumn
|
-- Git status in signcolumn
|
||||||
use({
|
{
|
||||||
"lewis6991/gitsigns.nvim",
|
"lewis6991/gitsigns.nvim",
|
||||||
config = function()
|
config = true,
|
||||||
require("gitsigns").setup()
|
},
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Tabline/bufferline
|
-- Tabline/bufferline
|
||||||
use({
|
{
|
||||||
"akinsho/nvim-bufferline.lua",
|
"akinsho/bufferline.nvim",
|
||||||
tag = "*",
|
version = "v3.*",
|
||||||
requires = "kyazdani42/nvim-web-devicons",
|
dependencies = { "kyazdani42/nvim-web-devicons" },
|
||||||
config = function()
|
config = true,
|
||||||
require("bufferline").setup({})
|
},
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Git commands
|
-- Git commands
|
||||||
use("tpope/vim-fugitive")
|
"tpope/vim-fugitive",
|
||||||
|
|
||||||
-- Indent characters
|
-- Indent characters
|
||||||
use({
|
{
|
||||||
"lukas-reineke/indent-blankline.nvim",
|
"lukas-reineke/indent-blankline.nvim",
|
||||||
config = require("plugins.indent-blankline"),
|
config = require("plugins.indent-blankline"),
|
||||||
})
|
},
|
||||||
|
|
||||||
-- Tree explorer
|
-- Tree explorer
|
||||||
use({
|
{
|
||||||
"kyazdani42/nvim-tree.lua",
|
"kyazdani42/nvim-tree.lua",
|
||||||
requires = "kyazdani42/nvim-web-devicons",
|
dependencies = { "kyazdani42/nvim-web-devicons" },
|
||||||
config = require("plugins.nvim-tree"),
|
config = require("plugins.nvim-tree"),
|
||||||
})
|
},
|
||||||
|
|
||||||
-- Telescope
|
-- Telescope
|
||||||
use({
|
{
|
||||||
"nvim-telescope/telescope.nvim",
|
"nvim-telescope/telescope.nvim",
|
||||||
config = require("plugins.telescope"),
|
config = require("plugins.telescope"),
|
||||||
requires = {
|
dependencies = {
|
||||||
{ "nvim-lua/plenary.nvim" }, -- Internal dep for telescope
|
"nvim-lua/plenary.nvim", -- Internal dep for telescope
|
||||||
{ "nvim-telescope/telescope-fzf-native.nvim", run = "make" }, -- Use fzf for fuzzy finder
|
-- Use fzf for fuzzy finder
|
||||||
{ "nvim-telescope/telescope-ui-select.nvim" }, -- Replace vim built in select with telescope
|
{
|
||||||
{ "zane-/cder.nvim" }, -- cd plugin for telescope
|
"nvim-telescope/telescope-fzf-native.nvim",
|
||||||
|
build = "make",
|
||||||
|
},
|
||||||
|
"nvim-telescope/telescope-ui-select.nvim", -- Replace vim built in select with telescope
|
||||||
|
"zane-/cder.nvim", -- cd plugin for telescope
|
||||||
},
|
},
|
||||||
})
|
},
|
||||||
|
|
||||||
-- Do stuff as sudo
|
-- Do stuff as sudo
|
||||||
use("lambdalisue/suda.vim")
|
"lambdalisue/suda.vim",
|
||||||
|
|
||||||
-- Display possible keybinds
|
-- Display possible keybinds
|
||||||
use({ "folke/which-key.nvim", config = require("plugins.which-key") })
|
{ "folke/which-key.nvim", config = require("plugins.which-key") },
|
||||||
|
|
||||||
-- Read editorconfig settings
|
-- Read editorconfig settings
|
||||||
use("editorconfig/editorconfig-vim")
|
"editorconfig/editorconfig-vim",
|
||||||
|
|
||||||
-- Package manager for LSP servers, DAP servers etc.
|
-- Package manager for LSP servers, DAP servers etc.
|
||||||
use({ "williamboman/mason.nvim", config = require("plugins.mason").setup })
|
{ "williamboman/mason.nvim", config = require("plugins.mason").setup },
|
||||||
|
|
||||||
-- Install LSP server executables with Mason
|
-- Install LSP server executables with Mason
|
||||||
use({
|
{
|
||||||
"williamboman/mason-lspconfig.nvim",
|
"williamboman/mason-lspconfig.nvim",
|
||||||
config = require("plugins.mason").lspconfig_setup,
|
config = require("plugins.mason").lspconfig_setup,
|
||||||
})
|
},
|
||||||
|
|
||||||
-- Configs for built-in LSP
|
-- Configs for built-in LSP
|
||||||
use({ "neovim/nvim-lspconfig", config = require("plugins.lspconfig").setup })
|
{ "neovim/nvim-lspconfig", config = require("plugins.lspconfig").setup },
|
||||||
|
|
||||||
-- Additional LSP features for Java
|
-- Additional LSP features for Java
|
||||||
use("mfussenegger/nvim-jdtls")
|
"mfussenegger/nvim-jdtls",
|
||||||
|
|
||||||
-- Display function signature
|
-- Display function signature
|
||||||
use("ray-x/lsp_signature.nvim")
|
"ray-x/lsp_signature.nvim",
|
||||||
|
|
||||||
-- Snippets plugin
|
-- Snippets plugin
|
||||||
use({
|
{
|
||||||
"L3MON4D3/LuaSnip",
|
"L3MON4D3/LuaSnip",
|
||||||
requires = { "rafamadriz/friendly-snippets" }, -- Snippets collection
|
dependencies = { "rafamadriz/friendly-snippets" }, -- Snippets collection
|
||||||
config = require("plugins.luasnip"),
|
config = require("plugins.luasnip"),
|
||||||
})
|
},
|
||||||
|
|
||||||
-- vim api documentation for lua lsp
|
-- vim api documentation for lua lsp
|
||||||
use({ "ii14/emmylua-nvim" })
|
{ "ii14/emmylua-nvim" },
|
||||||
|
|
||||||
-- Completion
|
-- Completion
|
||||||
use({
|
{
|
||||||
"hrsh7th/nvim-cmp",
|
"hrsh7th/nvim-cmp",
|
||||||
requires = {
|
dependencies = {
|
||||||
{ "hrsh7th/cmp-buffer" }, -- Buffer source
|
"hrsh7th/cmp-buffer", -- Buffer source
|
||||||
{ "petertriho/cmp-git", requires = "nvim-lua/plenary.nvim" }, -- Git source
|
{ "petertriho/cmp-git", dependencies = { "nvim-lua/plenary.nvim" } }, -- Git source
|
||||||
{ "hrsh7th/cmp-nvim-lsp" }, -- LSP source
|
"hrsh7th/cmp-nvim-lsp", -- LSP source
|
||||||
{ "hrsh7th/cmp-nvim-lua" }, -- Neovim Lua API documentation source
|
"hrsh7th/cmp-nvim-lua", -- Neovim Lua API documentation source
|
||||||
{ "hrsh7th/cmp-path" }, -- Path source
|
"hrsh7th/cmp-path", -- Path source
|
||||||
{ "hrsh7th/cmp-cmdline" }, -- cmdline source
|
"hrsh7th/cmp-cmdline", -- cmdline source
|
||||||
{ "saadparwaiz1/cmp_luasnip" }, -- Snippets source
|
"saadparwaiz1/cmp_luasnip", -- Snippets source
|
||||||
{ "f3fora/cmp-spell" }, -- Spell check source
|
"f3fora/cmp-spell", -- Spell check source
|
||||||
},
|
},
|
||||||
config = require("plugins.cmp"),
|
config = require("plugins.cmp"),
|
||||||
})
|
},
|
||||||
|
|
||||||
-- Automatic brackets
|
-- Automatic brackets
|
||||||
use({
|
{
|
||||||
"windwp/nvim-autopairs",
|
"windwp/nvim-autopairs",
|
||||||
config = function()
|
config = true,
|
||||||
require("nvim-autopairs").setup({})
|
},
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
||||||
-- treesitter
|
-- treesitter
|
||||||
use({
|
{
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
run = function()
|
build = function()
|
||||||
require("nvim-treesitter.install").update({ with_sync = true })
|
require("nvim-treesitter.install").update({ with_sync = true })
|
||||||
end,
|
end,
|
||||||
config = require("plugins.treesitter"),
|
config = require("plugins.treesitter"),
|
||||||
})
|
},
|
||||||
|
|
||||||
-- treesitter plugin for commentstring
|
-- treesitter plugin for commentstring
|
||||||
use("JoosepAlviste/nvim-ts-context-commentstring")
|
"JoosepAlviste/nvim-ts-context-commentstring",
|
||||||
|
|
||||||
-- Additional plugins for formats not supported
|
-- Additional plugins for formats not supported
|
||||||
-- by treesitter
|
-- by treesitter
|
||||||
use("jamespeapen/swayconfig.vim")
|
"jamespeapen/swayconfig.vim",
|
||||||
|
|
||||||
-- mappings for commenting in code
|
-- mappings for commenting in code
|
||||||
use("tpope/vim-commentary")
|
"tpope/vim-commentary",
|
||||||
|
|
||||||
-- we all know this one
|
-- we all know this one
|
||||||
use("tpope/vim-surround")
|
"tpope/vim-surround",
|
||||||
|
|
||||||
-- Formatter plugin
|
-- Formatter plugin
|
||||||
use("sbdchd/neoformat")
|
"sbdchd/neoformat",
|
||||||
|
|
||||||
-- Make editing passwords safer
|
-- Make editing passwords safer
|
||||||
use({
|
{
|
||||||
"https://git.zx2c4.com/password-store",
|
"https://git.zx2c4.com/password-store",
|
||||||
rtp = "contrib/vim/redact_pass.vim",
|
rtp = "contrib/vim/redact_pass.vim",
|
||||||
})
|
},
|
||||||
|
|
||||||
-- Neovim inside Firefox
|
-- Neovim inside Firefox
|
||||||
use({
|
{
|
||||||
"glacambre/firenvim",
|
"glacambre/firenvim",
|
||||||
run = function()
|
build = function()
|
||||||
vim.fn["firenvim#install"](0)
|
vim.fn["firenvim#install"](0)
|
||||||
end,
|
end,
|
||||||
setup = function()
|
},
|
||||||
require("plugins/firenvim")
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Vim <3 Asciidoctor
|
-- Vim <3 Asciidoctor
|
||||||
use("habamax/vim-asciidoctor")
|
"habamax/vim-asciidoctor",
|
||||||
|
|
||||||
-- Markdown preview
|
-- Markdown preview
|
||||||
use({
|
{
|
||||||
"iamcco/markdown-preview.nvim",
|
"iamcco/markdown-preview.nvim",
|
||||||
run = "cd app && npm install",
|
build = "cd app && npm install",
|
||||||
setup = function()
|
setup = function()
|
||||||
vim.g.mkdp_filetypes = { "markdown" }
|
vim.g.mkdp_filetypes = { "markdown" }
|
||||||
end,
|
end,
|
||||||
ft = { "markdown" },
|
ft = { "markdown" },
|
||||||
})
|
},
|
||||||
|
|
||||||
-- Edit GPG encrypted files transparently
|
-- Edit GPG encrypted files transparently
|
||||||
use("jamessan/vim-gnupg")
|
"jamessan/vim-gnupg",
|
||||||
|
|
||||||
-- High performance color highlighter
|
-- High performance color highlighter
|
||||||
use({
|
{
|
||||||
"norcalli/nvim-colorizer.lua",
|
"norcalli/nvim-colorizer.lua",
|
||||||
config = function()
|
config = function()
|
||||||
require("colorizer").setup()
|
require("colorizer").setup()
|
||||||
end,
|
end,
|
||||||
})
|
},
|
||||||
|
}
|
||||||
|
|
||||||
-- If Packer was just installed,
|
local lazy_opts = {}
|
||||||
-- sync plugins
|
|
||||||
if Packer_bootstrap then
|
|
||||||
require("packer").sync()
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
|
|
||||||
-- Sync plugins if Packer was just
|
require("lazy").setup(plugins, lazy_opts)
|
||||||
-- installed
|
|
||||||
if Packer_bootstrap then
|
|
||||||
print("Syncing plugins")
|
|
||||||
require("packer").sync()
|
|
||||||
end
|
|
||||||
|
|
|
@ -56,3 +56,12 @@ g.mapleader = " "
|
||||||
o.tabstop = 4
|
o.tabstop = 4
|
||||||
o.shiftwidth = 4
|
o.shiftwidth = 4
|
||||||
o.smartindent = true
|
o.smartindent = true
|
||||||
|
|
||||||
|
-- Firenvim settings
|
||||||
|
vim.g.firenvim_config = {
|
||||||
|
localSettings = {
|
||||||
|
[".*"] = {
|
||||||
|
takeOver = "never",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
|
@ -164,7 +164,7 @@ update() {
|
||||||
|
|
||||||
plugins() {
|
plugins() {
|
||||||
echo "Updating NeoVim plugins"
|
echo "Updating NeoVim plugins"
|
||||||
nvim --headless -c 'autocmd User PackerComplete quitall' -c 'PackerSync'
|
nvim --headless "+Lazy! sync" +qa
|
||||||
echo "Updating NeoVim TreeSitter"
|
echo "Updating NeoVim TreeSitter"
|
||||||
nvim --headless +TSUpdateSync +qa
|
nvim --headless +TSUpdateSync +qa
|
||||||
zinit self-update
|
zinit self-update
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue