Migrate to lazy.nvim from packer

main
Ensar Sarajčić 2023-08-27 11:24:13 +02:00
parent d389030109
commit 4a6fc5d358
10 changed files with 119 additions and 144 deletions

View File

@ -339,14 +339,14 @@ install_exercism: check_os
install_vim: check_os link_vim
@echo "Vim package installation is no longer done automatically!"
@echo "Start Vim or NeoVim and run:"
@echo "For NeoVim: :PackerInstall"
@echo "For NeoVim: :Lazy install"
@echo "For Vim: :PlugInstall"
.PHONY: check_neovim
check_neovim: check_os
@echo "This expects that packer is already installed"
@echo "Installing packer packages"
@nvim --headless -c 'autocmd User PackerComplete quitall' -c 'PackerInstall'
@echo "This expects that lazy is already installed"
@echo "Installing lazy packages"
@nvim --headless -c 'Lazy! sync' -c 'quitall'
@echo "Doing a basic neovim startup and quit"
@nvim --headless -c 'set display-=msgsep' -c 'quitall'
@echo "Running plenary tests"

View File

@ -63,7 +63,7 @@ fi
if [ "${RUN[nvim]}" = "1" ]
then
nvim --headless -c 'autocmd User PackerComplete quitall' -c 'PackerSync'
nvim --headless -c 'Lazy! sync' -c 'quitall'
fi
if [ "${RUN[vim]}" = "1" ]

View File

@ -1,2 +1,3 @@
undo/
*.class
lazy-lock.json

View File

@ -3,6 +3,4 @@ globals = {
"vim",
}
exclude_files = {
"plugin/packer_compiled.lua",
}
exclude_files = {}

View File

@ -1,6 +1,4 @@
if require("esensar.init.first_load")() then
return
end
require("esensar.init.first_load")
-- Allow `require('impatient')` to fail, in case plugins are not yet installed
local _ = pcall(require, "impatient")

View File

@ -1,30 +1,12 @@
-- Adopted from https://github.com/tjdevries/config_manager/blob/master/xdg_config/nvim/lua/tj/first_load.lua
local download_packer = function()
if vim.fn.input("Download Packer? (y for yes)") ~= "y" then
return
end
local directory = string.format("%s/site/pack/packer/start/", vim.fn.stdpath("data"))
vim.fn.mkdir(directory, "p")
local out = vim.fn.system(
string.format("git clone %s %s", "https://github.com/wbthomason/packer.nvim", directory .. "/packer.nvim")
)
print(out)
print("Downloading packer.nvim...")
vim.api.nvim_command("PackerCompile")
vim.api.nvim_command("PackerInstall")
print("( You'll need to restart now )")
end
return function()
if not pcall(require, "packer") then
download_packer()
return true
end
return false
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",
"--branch=stable", -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)

View File

@ -1,111 +1,107 @@
return require("packer").startup({
function(use)
use("wbthomason/packer.nvim")
return require("lazy").setup({
-- Tpope general improvements
"tpope/vim-sensible", -- Sane defaults,
"tpope/vim-endwise", -- Add closing statements automatically for if, function etc
"tpope/vim-surround", -- Surround with ', ", etc
"tpope/vim-fugitive", -- Git integration
"tpope/vim-vinegar", -- Netrw improvements
{ "tpope/vim-obsession", cmd = "Obsession" }, -- Session.vim management
{
"kristijanhusak/vim-dadbod-ui",
cmd = "DBUI",
dependencies = "tpope/vim-dadbod", -- database access
}, -- UI For Dadbod
"kristijanhusak/vim-dadbod-completion", -- Dadbod completion
"tpope/vim-speeddating", -- <C-A> and <C-X> for dates
"tpope/vim-dispatch", -- Dispatch command
"tpope/vim-projectionist", -- Project config file!
"tpope/vim-unimpaired", -- Additional [ and ] mappings
"tpope/vim-repeat", -- Better . repeat
"tpope/vim-commentary", -- Commenting motion
"tpope/vim-sleuth", -- Intendation heuristics
"tpope/vim-eunuch", -- UNIX helpers
-- Tpope general improvements
use("tpope/vim-sensible") -- Sane defaults
use("tpope/vim-endwise") -- Add closing statements automatically for if, function etc
use("tpope/vim-surround") -- Surround with ', ", etc
use("tpope/vim-fugitive") -- Git integration
use("tpope/vim-vinegar") -- Netrw improvements
use({ "tpope/vim-obsession", cmd = "Obsession" }) -- Session.vim management
use({
"kristijanhusak/vim-dadbod-ui",
cmd = "DBUI",
requires = "tpope/vim-dadbod", -- database access
}) -- UI For Dadbod
use("kristijanhusak/vim-dadbod-completion") -- Dadbod completion
use("tpope/vim-speeddating") -- <C-A> and <C-X> for dates
use("tpope/vim-dispatch") -- Dispatch command
use("tpope/vim-projectionist") -- Project config file!
use("tpope/vim-unimpaired") -- Additional [ and ] mappings
use("tpope/vim-repeat") -- Better . repeat
use("tpope/vim-commentary") -- Commenting motion
use("tpope/vim-sleuth") -- Intendation heuristics
use("tpope/vim-eunuch") -- UNIX helpers
-- General improvements
"lewis6991/gitsigns.nvim", -- Git signs
{ "godlygeek/tabular", cmd = "Tabularize" }, -- Tabular command for alignment
"vim-scripts/utl.vim", -- Universal text linking
{ "mbbill/undotree", cmd = "UndotreeToggle" }, -- Undos in a tree for easy access
"mhinz/vim-grepper", -- Grepper command - improved grepping throughout project
"radenling/vim-dispatch-neovim", -- vim-dispatch for neovim - uses terminal
"wellle/targets.vim", -- Additional targets for inside and around motions
"flazz/vim-colorschemes", -- All popular colorschemes
"romainl/vim-qf", -- Quickfix list upgrades
{ "romainl/vim-devdocs", cmd = "DD" }, -- Quick DevDocs.io search using :DD
"gpanders/editorconfig.nvim", -- .editorconfig support
"lewis6991/impatient.nvim", -- Caching lua modules for faster startup
"rcarriga/nvim-notify", -- notifications UI
"MunifTanjim/nui.nvim", -- General UI
"jiangmiao/auto-pairs", -- Autoclosing of brackets and quotes
-- General improvements
use("lewis6991/gitsigns.nvim") -- Git signs
use({ "godlygeek/tabular", cmd = "Tabularize" }) -- Tabular command for alignment
use("vim-scripts/utl.vim") -- Universal text linking
use({ "mbbill/undotree", cmd = "UndotreeToggle" }) -- Undos in a tree for easy access
use("mhinz/vim-grepper") -- Grepper command - improved grepping throughout project
use("radenling/vim-dispatch-neovim") -- vim-dispatch for neovim - uses terminal
use("wellle/targets.vim") -- Additional targets for inside and around motions
use("flazz/vim-colorschemes") -- All popular colorschemes
use("romainl/vim-qf") -- Quickfix list upgrades
use({ "romainl/vim-devdocs", cmd = "DD" }) -- Quick DevDocs.io search using :DD
use("gpanders/editorconfig.nvim") -- .editorconfig support
use("lewis6991/impatient.nvim") -- Caching lua modules for faster startup
use("rcarriga/nvim-notify") -- notifications UI
use("MunifTanjim/nui.nvim") -- General UI
use("jiangmiao/auto-pairs") -- Autoclosing of brackets and quotes
-- Tools
"direnv/direnv.vim", -- Integration with Direnv
"nvim-neotest/neotest", -- Running tests from NeoVim
"nvim-neotest/neotest-plenary",
"rouge8/neotest-rust",
"nvim-neotest/neotest-vim-test", -- vim-test plugin for neotest
"vim-test/vim-test", -- Running tests from vim
"mfussenegger/nvim-dap", -- Debug Adapter Protocol
"rcarriga/nvim-dap-ui", -- UI components for DAP
"theHamsta/nvim-dap-virtual-text", -- Virtual text display for DAP
"diepm/vim-rest-console", -- REST console for vim
"https://codeberg.org/esensar/nvim-dev-container", -- devcontainer.json support
"jbyuki/one-small-step-for-vimkind", -- Debugger for Nvim-Lua
"https://codeberg.org/neovim-java/neovim-java-plugin-host", -- Host for Java plugins
-- Tools
use("direnv/direnv.vim") -- Integration with Direnv
use("nvim-neotest/neotest") -- Running tests from NeoVim
use("nvim-neotest/neotest-plenary")
use("rouge8/neotest-rust")
use("nvim-neotest/neotest-vim-test") -- vim-test plugin for neotest
use("vim-test/vim-test") -- Running tests from vim
use("mfussenegger/nvim-dap") -- Debug Adapter Protocol
use("rcarriga/nvim-dap-ui") -- UI components for DAP
use("theHamsta/nvim-dap-virtual-text") -- Virtual text display for DAP
use("diepm/vim-rest-console") -- REST console for vim
use("https://codeberg.org/esensar/nvim-dev-container") -- devcontainer.json support
use("jbyuki/one-small-step-for-vimkind") -- Debugger for Nvim-Lua
use("https://codeberg.org/neovim-java/neovim-java-plugin-host") -- Host for Java plugins
-- Snippets
"L3MON4D3/LuaSnip", -- snippets support
"rafamadriz/friendly-snippets", -- Collection of snippets
"saadparwaiz1/cmp_luasnip", -- cmp snippets support
-- Snippets
use("L3MON4D3/LuaSnip") -- snippets support
use("rafamadriz/friendly-snippets") -- Collection of snippets
use("saadparwaiz1/cmp_luasnip") -- cmp snippets support
-- Language support
{ "tpope/vim-rails", ft = "ruby" }, -- Enables all rails command through vim and integrates with projectionist
{ "c-brenn/phoenix.vim", ft = "elixir" }, -- Similar to vim-rails, but for phoenix
"Olical/conjure", -- Lisp languages REPL integration
"Olical/aniseed", -- Fennel nvim support
"vimwiki/vimwiki", -- Vimwiki - personal wiki in vim
"https://codeberg.org/vimwiki-reviews/vimwiki-reviews-lua", -- Vimwiki extension for periodic reviews
{ "ledger/vim-ledger", ft = "ledger" }, -- Support for ledger-cli format
{ "tandrewnichols/vim-docile", ft = "help" }, -- Support for vim doc.txt format
{ "habamax/vim-godot", ft = "gdscript" }, -- Godot engine (and script) support
"guns/vim-sexp", -- Precision editing for S-expressions
"tpope/vim-sexp-mappings-for-regular-people", -- Simpler keymaps for vim-sexp
{ "tridactyl/vim-tridactyl", ft = "tridactyl" }, -- Tridactyl config file support
{ "aklt/plantuml-syntax", ft = "plantuml" }, -- PlantUML support
{ "cdelledonne/vim-cmake", ft = "cmake" }, -- CMake integration
-- Language support
use({ "tpope/vim-rails", ft = "ruby" }) -- Enables all rails command through vim and integrates with projectionist
use({ "c-brenn/phoenix.vim", ft = "elixir" }) -- Similar to vim-rails, but for phoenix
use("Olical/conjure") -- Lisp languages REPL integration
use("Olical/aniseed") -- Fennel nvim support
use("vimwiki/vimwiki") -- Vimwiki - personal wiki in vim
use("https://codeberg.org/vimwiki-reviews/vimwiki-reviews-lua") -- Vimwiki extension for periodic reviews
use({ "ledger/vim-ledger", ft = "ledger" }) -- Support for ledger-cli format
use({ "tandrewnichols/vim-docile", ft = "help" }) -- Support for vim doc.txt format
use({ "habamax/vim-godot", ft = "gdscript" }) -- Godot engine (and script) support
use("guns/vim-sexp") -- Precision editing for S-expressions
use("tpope/vim-sexp-mappings-for-regular-people") -- Simpler keymaps for vim-sexp
use({ "tridactyl/vim-tridactyl", ft = "tridactyl" }) -- Tridactyl config file support
use({ "aklt/plantuml-syntax", ft = "plantuml" }) -- PlantUML support
use({ "cdelledonne/vim-cmake", ft = "cmake" }) -- CMake integration
-- Treesitter
{ "nvim-treesitter/nvim-treesitter", build = ":TSUpdate" }, -- Treesitter integration
"nvim-treesitter/playground", -- TSPlaygroundToggle - access treesitter data
-- Treesitter
use({ "nvim-treesitter/nvim-treesitter", run = ":TSUpdate" }) -- Treesitter integration
use("nvim-treesitter/playground") -- TSPlaygroundToggle - access treesitter data
-- LSP
"neovim/nvim-lspconfig", -- Easy LSP Config
"williamboman/mason.nvim", -- Easy tool install
"williamboman/mason-lspconfig.nvim", -- Lspconfig support for mason
"hrsh7th/cmp-nvim-lsp", -- LSP source for cmp
"hrsh7th/cmp-buffer", -- Buffer source for nvim-cmp
"hrsh7th/cmp-path", -- Path source for nvim-cmp
"hrsh7th/cmp-nvim-lua", -- Nvim-Lua source for nvim-cmp
"hrsh7th/cmp-omni", -- omnifunc source for nvim-cmp
"hrsh7th/nvim-cmp", -- completion integration
"jose-elias-alvarez/null-ls.nvim", -- Linting and formatting
-- LSP
use("neovim/nvim-lspconfig") -- Easy LSP Config
use("williamboman/mason.nvim") -- Easy tool install
use("williamboman/mason-lspconfig.nvim") -- Lspconfig support for mason
use("hrsh7th/cmp-nvim-lsp") -- LSP source for cmp
use("hrsh7th/cmp-buffer") -- Buffer source for nvim-cmp
use("hrsh7th/cmp-path") -- Path source for nvim-cmp
use("hrsh7th/cmp-nvim-lua") -- Nvim-Lua source for nvim-cmp
use("hrsh7th/cmp-omni") -- omnifunc source for nvim-cmp
use("hrsh7th/nvim-cmp") -- completion integration
use("jose-elias-alvarez/null-ls.nvim") -- Linting and formatting
-- LSP language specific
"folke/neodev.nvim", -- Built-in Lua integration with LSP
"akinsho/flutter-tools.nvim", -- Additional flutter integrations
"simrat39/rust-tools.nvim", -- Additional rust integrations
{ "mfussenegger/nvim-jdtls", ft = "java" }, -- Additional java integrations
-- LSP language specific
use("folke/neodev.nvim") -- Built-in Lua integration with LSP
use("akinsho/flutter-tools.nvim") -- Additional flutter integrations
use("simrat39/rust-tools.nvim") -- Additional rust integrations
use({ "mfussenegger/nvim-jdtls", ft = "java" }) -- Additional java integrations
-- Lua support
"nvim-lua/popup.nvim", -- Popup API integration - needed for some plugins
"nvim-lua/plenary.nvim", -- Lua helpers
-- Lua support
use("nvim-lua/popup.nvim") -- Popup API integration - needed for some plugins
use("nvim-lua/plenary.nvim") -- Lua helpers
-- Telescope
use("nvim-telescope/telescope.nvim") -- Fuzzy searcher
use("nvim-telescope/telescope-dap.nvim") -- DAP integration for Telescope
use("nvim-telescope/telescope-ui-select.nvim") -- UI select for Telescope
end,
-- Telescope
"nvim-telescope/telescope.nvim", -- Fuzzy searcher
"nvim-telescope/telescope-dap.nvim", -- DAP integration for Telescope
"nvim-telescope/telescope-ui-select.nvim", -- UI select for Telescope
})

View File

@ -6,7 +6,7 @@ local lspconfig = require("lspconfig")
require("mason").setup()
require("mason-lspconfig").setup()
require("neodev").setup({
library = { plugins = { "neotest" }, types = true },
library = { plugins = { "neotest", "plenary.nvim" }, types = true },
})
local common_config = require("esensar.lsp.server_config")

View File

@ -187,7 +187,8 @@ local statuslines = {
end
status = status
.. " %4*"
.. "["
.. (build_status_last.build_title or "")
.. " ["
.. (build_status_last.current_step or "")
.. "/"
.. (build_status_last.step_count or "")

View File

@ -1 +0,0 @@
packer_compiled.lua