[feat] Migrate from packer.nvim to lazy.nvim

This commit is contained in:
Uttarayan Mondal
2023-01-14 19:46:37 +05:30
parent 6474868aa5
commit 21e7ab7b27
5 changed files with 281 additions and 213 deletions

View File

@@ -8,3 +8,6 @@ export DYLD_FALLBACK_LIBRARY_PATH="/Library/Developer/CommandLineTools/usr/lib"
# export FZF_DEFAULT_COMMAND="fd --type f --hidden --exclude .git" # export FZF_DEFAULT_COMMAND="fd --type f --hidden --exclude .git"
export CARGO_TARGET_DIR="$HOME/.local/share/cargo-target" export CARGO_TARGET_DIR="$HOME/.local/share/cargo-target"
# The next line updates PATH for the Google Cloud SDK.
if [ -f '/Users/fs0c131y/Projects/gcloud/google-cloud-sdk/path.fish.inc' ]; . '/Users/fs0c131y/Projects/gcloud/google-cloud-sdk/path.fish.inc'; end

View File

@@ -1,12 +1,12 @@
-- Need to replace this once lua api has vim modes -- Need to replace this once lua api has vim modes
vim.api.nvim_exec([[ -- vim.api.nvim_exec([[
augroup Packer -- augroup Packer
autocmd! -- autocmd!
autocmd BufWritePost init.lua PackerCompile -- autocmd BufWritePost init.lua PackerCompile
autocmd BufWritePost keymaps.lua PackerCompile -- autocmd BufWritePost keymaps.lua PackerCompile
autocmd BufWritePost plugins.lua PackerCompile -- autocmd BufWritePost plugins.lua PackerCompile
augroup end -- augroup end
]], false) -- ]], false)
vim.api.nvim_exec([[ vim.api.nvim_exec([[
augroup AutoSaveGroup augroup AutoSaveGroup
@@ -102,8 +102,8 @@ vim.g.coq_settings = {
-- vim.g.rooter_manual_only = 1 -- vim.g.rooter_manual_only = 1
vim.g.copilot_node_command = "~/.local/share/nvm/v16.18.1/bin/node" vim.g.copilot_node_command = "~/.local/share/nvm/v16.18.1/bin/node"
require('plugins')
require('keymaps') require('keymaps')
require('plugins')
require 'nvim-treesitter.configs'.setup { require 'nvim-treesitter.configs'.setup {
-- ensure_installed = "all", -- ensure_installed = "all",

View File

@@ -0,0 +1,45 @@
{
"chadtree": { "branch": "chad", "commit": "6bdd731301e546e133c7c3e52bf31e7594394e27" },
"comfortable-motion.vim": { "branch": "master", "commit": "e20aeafb07c6184727b29f7674530150f7ab2036" },
"copilot.vim": { "branch": "release", "commit": "324ec9eb69e20971b58340d0096c3caac7bc2089" },
"coq.artifacts": { "branch": "artifacts", "commit": "53cac5a2cc6f64765b658114efb50d62d7497ff4" },
"coq.thirdparty": { "branch": "3p", "commit": "af94c7ad7ca379a68db0fef12622f8066248f2d3" },
"coq_nvim": { "branch": "coq", "commit": "8fe777d9ce4eb8519bef208f92e0843ddf2b2a1a" },
"crates.nvim": { "branch": "main", "commit": "e02eadc598b03d618c22200b0e7979048f6f96b1" },
"dashboard-nvim": { "branch": "master", "commit": "f7d623457d6621b25a1292b24e366fae40cb79ab" },
"diffview.nvim": { "branch": "main", "commit": "0987307b6e3488b14e07d1bd728b747122f10efd" },
"formatter.nvim": { "branch": "master", "commit": "8a4c961330cc4688087f23d18fa7d2f1af9a4902" },
"galaxyline.nvim": { "branch": "main", "commit": "4d4f5fc8e20a10824117e5beea7ec6e445466a8f" },
"glow.nvim": { "branch": "main", "commit": "4e4c6486110d9d9905d2efc5fd2d562212f0d212" },
"hop.nvim": { "branch": "v2", "commit": "90db1b2c61b820e230599a04fedcd2679e64bd07" },
"indent-blankline.nvim": { "branch": "master", "commit": "c4c203c3e8a595bc333abaf168fcb10c13ed5fb7" },
"lazy.nvim": { "branch": "main", "commit": "666ed7bf73eb5895253c1155bd29270b066cbdac" },
"lsp-status.nvim": { "branch": "master", "commit": "54f48eb5017632d81d0fd40112065f1d062d0629" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "43c7f402cb9822b61b5dc05bf0b385928df256a6" },
"mason.nvim": { "branch": "main", "commit": "8529daa38242091d579ed24f28b35c8b80928e8a" },
"nvim-colorizer.lua": { "branch": "master", "commit": "36c610a9717cc9ec426a07c8e6bf3b3abcb139d6" },
"nvim-dap": { "branch": "master", "commit": "0efe0eb17e21d0ff90027d2408fff7759cc95efd" },
"nvim-dap-ui": { "branch": "master", "commit": "b80227ea56a48177786904f6322abc8b2dc0bc36" },
"nvim-lspconfig": { "branch": "master", "commit": "ed88435764d8b00442e66d39ec3d9c360e560783" },
"nvim-treesitter": { "branch": "master", "commit": "d18851653e6edaeb6c0b381abf8def1305337942" },
"nvim-web-devicons": { "branch": "master", "commit": "6c38926351372ea87034dec26182b62c835ff3bc" },
"plenary.nvim": { "branch": "master", "commit": "1c7e3e6b0f4dd5a174fcea9fda8a4d7de593b826" },
"rust-tools.nvim": { "branch": "master", "commit": "df584e84393ef255f5b8cbd709677d6a3a5bf42f" },
"sonokai": { "branch": "master", "commit": "e2e89497f178bec568a0a43cda651f0429ec8ec1" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "fab3e2212e206f4f8b3bbaa656e129443c9b802e" },
"telescope-ui-select.nvim": { "branch": "master", "commit": "62ea5e58c7bbe191297b983a9e7e89420f581369" },
"telescope.nvim": { "branch": "master", "commit": "b69b33eded07341253bc1f0b4ae6bbc5c411a2ab" },
"toggleterm.nvim": { "branch": "main", "commit": "a54e6c471ce1cd8ef8357e34598a28a955297131" },
"trouble.nvim": { "branch": "main", "commit": "83ec606e7065adf134d17f4af6bae510e3c491c1" },
"vim-abolish": { "branch": "master", "commit": "aa3428b734ddbd0105615832843f619774a6871e" },
"vim-base64": { "branch": "master", "commit": "d15253105f6a329cd0632bf9dcbf2591fb5944b8" },
"vim-commentary": { "branch": "master", "commit": "e87cd90dc09c2a203e13af9704bd0ef79303d755" },
"vim-fugitive": { "branch": "master", "commit": "9c5f675db54139c18ed4a1a18989ea2da37d6cae" },
"vim-gh-line": { "branch": "master", "commit": "fbf368bdfad7e5478009a6dc62559e6b2c72d603" },
"vim-mergetool": { "branch": "master", "commit": "0275a85256ad173e3cde586d54f66566c01b607f" },
"vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" },
"vim-speeddating": { "branch": "master", "commit": "5a36fd29df63ea3f65562bd2bb837be48a5ec90b" },
"vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" },
"vim-vinegar": { "branch": "master", "commit": "bb1bcddf43cfebe05eb565a84ab069b357d0b3d6" },
"which-key.nvim": { "branch": "main", "commit": "e4fa445065a2bb0bbc3cca85346b67817f28e83e" }
}

View File

@@ -21,3 +21,16 @@ vim.o.completeopt = "menuone,noselect"
-- --
vim.api.nvim_buf_set_option(0, 'omnifunc', 'v:lua.vim.lsp.omnifunc') vim.api.nvim_buf_set_option(0, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
-- vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') -- vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
local lspconfig = require 'lspconfig'
local lspstatus = require 'lsp-status'
local coq = require 'coq'
require('mason-lspconfig').setup_handlers({
function(server_name)
lspconfig[server_name].setup({
on_attach = lspstatus.on_attach,
capabilities = coq.lsp_ensure_capabilities(lspstatus.capabilities),
})
end,
})

View File

@@ -1,204 +1,211 @@
local vim = vim local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
local execute = vim.api.nvim_command if not vim.loop.fs_stat(lazypath) then
local fn = vim.fn vim.fn.system({
local install_path = fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim' "git",
"clone",
if fn.empty(fn.glob(install_path)) > 0 then "--filter=blob:none",
fn.system({ 'git', 'clone', 'https://github.com/wbthomason/packer.nvim', install_path }) "https://github.com/folke/lazy.nvim.git",
execute 'packadd packer.nvim' "--branch=stable", -- latest stable release
end lazypath,
})
local use = require('packer').use end
vim.opt.rtp:prepend(lazypath)
return require('packer').startup(function() -- require("lazy").setup(plugins, opts)
-- Packer can manage itself -- if fn.empty(fn.glob(install_path)) > 0 then
use { 'wbthomason/packer.nvim' } -- fn.system({ 'git', 'clone', 'https://github.com/wbthomason/packer.nvim', install_path })
use { 'williamboman/mason.nvim', -- execute 'packadd packer.nvim'
config = function() -- end
require("mason").setup({
ui = { -- local use = require('packer').use
icons = {
package_installed = "", return require('lazy').setup({
package_pending = "", 'ellisonleao/glow.nvim',
package_uninstalled = "" 'samoshkin/vim-mergetool',
}
} 'mhartington/formatter.nvim',
}) 'christianrondeau/vim-base64',
end
} 'tpope/vim-commentary',
use { 'tpope/vim-fugitive',
"williamboman/mason-lspconfig.nvim", 'tpope/vim-repeat',
config = function() 'tpope/vim-speeddating',
require("mason-lspconfig").setup({ 'tpope/vim-surround',
ensure_installed = { "sumneko_lua", "rust_analyzer" }, 'tpope/vim-vinegar',
automatic_installation = true, 'tpope/vim-abolish',
})
end 'yuttie/comfortable-motion.vim',
} 'ruanyl/vim-gh-line',
use { 'mhartington/formatter.nvim' } { 'williamboman/mason.nvim',
config = function()
-- use 'imsnif/kdl.vim' require("mason").setup({
use 'christianrondeau/vim-base64' ui = {
use { icons = {
'NTBBloodbath/galaxyline.nvim', branch = 'main', package_installed = "",
config = function() require('statusline') end, package_pending = "",
requires = { 'kyazdani42/nvim-web-devicons' } package_uninstalled = ""
} }
use { 'sainnhe/sonokai', config = function() require('colorscheme') end } }
use { 'folke/which-key.nvim', config = function() require("which-key").setup() end } })
use { 'yuttie/comfortable-motion.vim' } end
use { 'ruanyl/vim-gh-line' } },
use { 'nvim-telescope/telescope.nvim', requires = { { 'nvim-lua/plenary.nvim' } } } {
use { "williamboman/mason-lspconfig.nvim",
'nvim-telescope/telescope-fzf-native.nvim', config = function()
run = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build', require("mason-lspconfig").setup({
config = function() ensure_installed = { "sumneko_lua", "rust_analyzer", "gopls" },
require('telescope').setup { automatic_installation = true,
defaults = { })
initial_mode = 'insert', end
}, },
extensions = {
fzf = { {
fuzzy = true, -- false will only do exact matching 'NTBBloodbath/galaxyline.nvim', branch = 'main',
override_generic_sorter = true, -- override the generic sorter config = function() require('statusline') end,
override_file_sorter = true, -- override the file sorter dependencies = { 'kyazdani42/nvim-web-devicons' }
case_mode = "smart_case", -- or "ignore_case" or "respect_case" },
} { 'sainnhe/sonokai', config = function() require('colorscheme') end },
} { 'folke/which-key.nvim', config = function() require("which-key").setup() end },
} { 'nvim-telescope/telescope.nvim', dependencies = { 'nvim-lua/plenary.nvim' } },
require('telescope').load_extension('fzf') {
end, 'nvim-telescope/telescope-fzf-native.nvim',
} build = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build',
config = function()
use { 'nvim-telescope/telescope-ui-select.nvim', require('telescope').setup {
config = function() defaults = {
require("telescope").load_extension("ui-select") initial_mode = 'insert',
end },
} extensions = {
fzf = {
fuzzy = true, -- false will only do exact matching
override_generic_sorter = true, -- override the generic sorter
use { override_file_sorter = true, -- override the file sorter
'tpope/vim-commentary', case_mode = "smart_case", -- or "ignore_case" or "respect_case"
'tpope/vim-fugitive', }
'tpope/vim-repeat', }
'tpope/vim-speeddating', }
'tpope/vim-surround', require('telescope').load_extension('fzf')
'tpope/vim-vinegar', end,
} },
use { 'norcalli/nvim-colorizer.lua', config = function() require 'colorizer'.setup() end, } { 'nvim-telescope/telescope-ui-select.nvim',
config = function()
-- lsp require("telescope").load_extension("ui-select")
-- use { 'onsails/lspkind-nvim', config = function() require'lspkind'.init() end, } end
use { },
'folke/trouble.nvim',
config = function()
-- local actions = require("telescope.actions") { 'norcalli/nvim-colorizer.lua', config = function() require 'colorizer'.setup() end, },
require("trouble").setup()
local trouble = require("trouble.providers.telescope") -- lsp
local telescope = require("telescope") -- use { 'onsails/lspkind-nvim', config = function() require'lspkind'.init() end, }
telescope.setup { {
defaults = { 'folke/trouble.nvim',
mappings = { config = function()
i = { ["<c-t>"] = trouble.open_with_trouble }, -- local actions = require("telescope.actions")
n = { ["<c-t>"] = trouble.open_with_trouble }, require("trouble").setup()
}, local trouble = require("trouble.providers.telescope")
}, local telescope = require("telescope")
} telescope.setup {
defaults = {
end, mappings = {
} i = { ["<c-t>"] = trouble.open_with_trouble },
n = { ["<c-t>"] = trouble.open_with_trouble },
use { 'neovim/nvim-lspconfig', config = function() require("lsp") end, } },
use { 'nvim-lua/lsp-status.nvim' } },
}
use { 'ms-jpq/coq_nvim', requires = { 'ms-jpq/coq.artifacts' }, run = ':COQdeps' }
use { 'ms-jpq/chadtree', run = ':CHADdeps' } end,
use { 'ms-jpq/coq.thirdparty', config = function() },
require("coq_3p")({
{ { 'neovim/nvim-lspconfig', config = function() require("lsp") end, },
src = "repl", { 'nvim-lua/lsp-status.nvim' },
sh = "sh",
shell = { p = "perl", n = "node" }, { 'ms-jpq/coq_nvim', dependencies = { 'ms-jpq/coq.artifacts' }, build = ':COQdeps' },
max_lines = 99, { 'ms-jpq/chadtree', build = ':CHADdeps' },
deadline = 500, { 'ms-jpq/coq.thirdparty', config = function()
unsafe = { "rm", "poweroff", "mv" } require("coq_3p")({
}, {
{ src = "bc", short_name = "MATH", precision = 6 }, src = "repl",
{ src = "copilot", short_name = "COP", accept_key = "<C-l>" }, sh = "sh",
{ src = "dap" } shell = { p = "perl", n = "node" },
}) max_lines = 99,
end deadline = 500,
} unsafe = { "rm", "poweroff", "mv" }
},
-- use 'airblade/vim-rooter' { src = "bc", short_name = "MATH", precision = 6 },
-- use({ { src = "copilot", short_name = "COP", accept_key = "<C-l>" },
-- "https://git.sr.ht/~whynothugo/lsp_lines.nvim", { src = "dap" }
-- config = function() })
-- require("lsp_lines").setup() end
-- end, },
-- })
-- use 'airblade/vim-rooter'
use { -- use({
'lukas-reineke/indent-blankline.nvim', -- "https://git.sr.ht/~whynothugo/lsp_lines.nvim",
config = function() -- config = function()
require("indent_blankline").setup { -- require("lsp_lines").setup()
show_end_of_line = true, -- end,
} -- })
end
} {
'lukas-reineke/indent-blankline.nvim',
use { 'sindrets/diffview.nvim', requires = 'nvim-lua/plenary.nvim' } config = function()
use { require("indent_blankline").setup {
'akinsho/toggleterm.nvim', show_end_of_line = true,
config = function() require 'setup.toggleterm' end, }
} end
},
use {
'glepnir/dashboard-nvim', { 'sindrets/diffview.nvim', dependencies = 'nvim-lua/plenary.nvim' },
config = function() require 'setup.dashboard' end, {
} 'akinsho/toggleterm.nvim',
use 'github/copilot.vim' config = function() require 'setup.toggleterm' end,
},
use {
'nvim-treesitter/nvim-treesitter', {
run = ':TSUpdate' 'glepnir/dashboard-nvim',
} config = function() require 'setup.dashboard' end,
},
use 'samoshkin/vim-mergetool' 'github/copilot.vim',
{
use { 'nvim-treesitter/nvim-treesitter',
'saecki/crates.nvim', build = ':TSUpdate'
tag = 'v0.2.1', },
requires = { 'nvim-lua/plenary.nvim' },
config = function()
require('crates').setup {
src = { {
coq = { 'saecki/crates.nvim',
enabled = true, tag = 'v0.2.1',
name = "crates.nvim", dependencies = { 'nvim-lua/plenary.nvim' },
}, config = function()
}, require('crates').setup {
} src = {
end, coq = {
} enabled = true,
use { 'simrat39/rust-tools.nvim', config = function() require 'setup.rust-tools' end } name = "crates.nvim",
},
use 'ellisonleao/glow.nvim' },
}
use { "rcarriga/nvim-dap-ui", requires = { "mfussenegger/nvim-dap" }, end,
config = function() require("dapui").setup() end } },
{ 'simrat39/rust-tools.nvim', config = function() require 'setup.rust-tools' end },
use {
'phaazon/hop.nvim',
branch = 'v2', -- optional but strongly recommended {
config = function() "rcarriga/nvim-dap-ui", dependencies = { "mfussenegger/nvim-dap" },
-- you can configure Hop the way you like here; see :h hop-config config = function() require("dapui").setup() end
require 'hop'.setup { keys = 'etovxqpdygfblzhckisuran' } },
end
} {
'phaazon/hop.nvim',
end); branch = 'v2', -- optional but strongly recommended
config = function()
-- you can configure Hop the way you like here; see :h hop-config
require 'hop'.setup { keys = 'etovxqpdygfblzhckisuran' }
end
},
});