commit 4d57e8d8b0434666a149155e63d13e3b5dcb9e27
parent a88dd80e3a75301fb40123f9000a7ab02f699206
Author: Thomas Vigouroux <thomas.vigouroux@protonmail.com>
Date: Fri, 26 May 2023 09:06:49 +0200
feat: move away from packer and use paq
Diffstat:
4 files changed, 98 insertions(+), 145 deletions(-)
diff --git a/init.lua b/init.lua
@@ -6,8 +6,6 @@ local ok, imp = pcall(require, 'impatient')
-- imp.enable_profile()
-- end
-require "plugins" -- Load all plugins
-
vim.g.python_host_prog = "/bin/python"
vim.g.oak_statusline = 1
@@ -18,6 +16,7 @@ elseif jit.os == "Darwin" then
end
local o = vim.opt
+o.debug = "msg"
o.number = true
o.relativenumber = true
o.hidden = true
@@ -96,6 +95,8 @@ o.suffixes:prepend {
vim.g.mapleader = " "
vim.g.maplocalleader = "$"
+require "plugins" -- Load all plugins
+
vim.api.nvim_create_autocmd("TextYankPost", {
callback = function()
pcall(vim.highlight.on_yank, { higroup = "Visual", timeout = 250 })
diff --git a/lua/azy_config.lua b/lua/azy_config.lua
@@ -0,0 +1,16 @@
+local M = {}
+
+require'azy'.setup {
+ -- preview = true,
+ -- debug = true,
+}
+local ab = require'azy.builtins'
+
+vim.keymap.set("n", "<Leader>e", ab.files(), {})
+vim.keymap.set("n", "<Leader>r", ab.files_contents(), {})
+vim.keymap.set('n', '<Leader>oc', ab.files { vim.fn.stdpath'config' }, {})
+vim.keymap.set('n', '<Leader>h', ab.help(), {})
+vim.keymap.set('n', '<Leader>b', ab.buffers(), {})
+vim.keymap.set('n', '<Leader>q', ab.quickfix(), {})
+
+return M
diff --git a/lua/plugins.lua b/lua/plugins.lua
@@ -1,133 +1,84 @@
-- vim: et
-local execute = vim.api.nvim_command
-
-local fn = vim.fn
-local install_path = fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim'
-local packer_bootstrap = false
-if fn.empty(fn.glob(install_path)) > 0 then
- packer_bootstrap = fn.system({ 'git', 'clone', '--depth', '1',
- 'https://github.com/wbthomason/packer.nvim',
- install_path })
-end
-local packer = require "packer"
-return packer.startup(function(use)
-
- local function localuse(spec)
- local function path_trans(path)
- return '~/src/plugins/' .. string.gsub(path, ".+/", "")
- end
-
- if type(spec) == "string" then
- use(path_trans(spec))
- else
- local path = spec[1]
- spec[1] = path_trans(path)
- use(spec)
- end
+-- In ~/.config/nvim/init.lua
+local function clone_paq()
+ local path = vim.fn.stdpath("data") .. "/site/pack/paqs/start/paq-nvim"
+ local is_installed = vim.fn.empty(vim.fn.glob(path)) == 0
+ if not is_installed then
+ vim.fn.system { "git", "clone", "--depth=1", "https://github.com/savq/paq-nvim.git", path }
+ return true
end
+end
- use { 'wbthomason/packer.nvim' }
-
- -- Basic
- localuse { 'vigoux/complementree.nvim',
- requires = { 'L3MON4D3/LuaSnip', 'nvim-treesitter/nvim-treesitter',
- { 'vigoux/fzy-lua-native', run = 'make' } } }
- localuse {
- 'vigoux/azy.nvim',
- config = function()
- require 'tele_config'
- end,
- }
-
- -- UI and things
- localuse {
- "vigoux/notifier.nvim",
- config = function()
- require "notifier".setup {
- component_name_recall = true,
- status_width = 50,
- notify = {
- clear_time = 5000
- },
- }
- end
- }
- use {
- "doums/suit.nvim",
- config = function()
- require('suit').setup({
- input = {
- border = 'single',
- },
- select = {
- border = 'single',
- },
- })
- end
- }
- use {
- 'brenoprata10/nvim-highlight-colors',
- config = function()
- require('nvim-highlight-colors').setup {}
- end
- }
-
- -- use { 'neovim/nvimdev.nvim', requires = {'neomake/neomake'}}
-
- -- tpope <3
- use 'tpope/vim-commentary'
- use 'tpope/vim-surround'
-
- -- LSP related
- use {
- "https://git.sr.ht/~whynothugo/lsp_lines.nvim",
- config = function()
- require("lsp_lines").setup()
- end,
- }
- use { "williamboman/mason.nvim", config = function()
- require "mason".setup {}
- end }
- localuse { 'vigoux/ltex-ls.nvim' }
-
- -- DAP related
- use { 'mfussenegger/nvim-dap', requires = { 'theHamsta/nvim-dap-virtual-text' }, config = function()
- require 'dap-config'
- end }
-
- -- Treesitter related
- use 'nvim-treesitter/nvim-treesitter'
- use { 'nvim-treesitter/playground', opt = true }
- localuse 'vigoux/architext.nvim'
-
- -- Mine
- use 'vigoux/templar.nvim'
-
- -- Misc
- localuse 'vim-conf-live/pres.vim'
- localuse { 'vigoux/ratatoskr.nvim', opt = true }
- use 'lewis6991/impatient.nvim'
-
- -- Git because git
- use { 'lewis6991/gitsigns.nvim', requires = { 'nvim-lua/plenary.nvim' } }
-
- -- One true colorscheme
- localuse 'vigoux/oak' -- Not sure it is that binary
- use 'romgrk/doom-one.vim'
-
- -- Byte update debugging help
- use { 'tjdevries/nsync.nvim', opt = true }
-
- -- sunjon <3
- use 'sunjon/extmark-toy.nvim'
-
- -- filetypes
- use 'rhysd/vim-llvm'
- use 'tamarin-prover/editors'
- localuse 'vigoux/infer.nvim'
-
- if packer_bootstrap then
- packer.sync()
+local function paq(packages)
+ local first_install = clone_paq()
+ vim.cmd.packadd("paq-nvim")
+ local paqmod = require("paq")
+ paqmod(packages)
+ if first_install then
+ vim.notify("Installing plugins... If prompted, hit Enter to continue.")
+ paqmod.install()
end
-end)
+end
+
+-- Call helper function
+paq {
+ "savq/paq-nvim",
+ -- List your packages
+
+ --local complementree.nvim
+ 'L3MON4D3/LuaSnip',
+ 'nvim-treesitter/nvim-treesitter',
+ { 'vigoux/fzy-lua-native', run = 'make' },
+
+ --local azy.nvim
+ 'vigoux/notifier.nvim',
+
+ -- TODO: replace these two
+ 'tpope/vim-commentary',
+ 'tpope/vim-surround',
+
+ -- LSP stuff
+ { url = "https://git.sr.ht/~whynothugo/lsp_lines.nvim" },
+ "williamboman/mason.nvim",
+ 'vigoux/ltex-ls.nvim',
+ { 'mfussenegger/nvim-dap', opt=true }, -- TODO load dap-config
+
+ --local architext.nvim
+ 'vigoux/templar.nvim',
+ --local ratatoskr in opt
+
+ 'lewis6991/impatient.nvim',
+
+ 'nvim-lua/plenary.nvim',
+ 'lewis6991/gitsigns.nvim',
+
+ --local oak
+ 'tamarin-prover/editors'
+}
+
+require "notifier".setup {
+ component_name_recall = true,
+ status_width = 50,
+ notify = {
+ clear_time = 5000
+ },
+}
+
+require("lsp_lines").setup()
+require "mason".setup {}
+
+require'azy_config'
+
+-- -- sunjon <3
+-- use 'sunjon/extmark-toy.nvim'
+
+-- -- filetypes
+-- use 'rhysd/vim-llvm'
+-- use 'tamarin-prover/editors'
+-- localuse 'vigoux/infer.nvim'
+
+-- if packer_bootstrap then
+-- packer.sync()
+-- end
+-- end)
diff --git a/lua/tele_config.lua b/lua/tele_config.lua
@@ -1,15 +0,0 @@
-local M = {}
-
-require'azy'.setup {
- debug = true,
-}
-local ab = require'azy.builtins'
-
-vim.keymap.set("n", "<Leader>e", ab.files(), {})
-vim.keymap.set("n", "<Leader>r", ab.files_contents(), {})
-vim.keymap.set('n', '<Leader>oc', ab.files { vim.fn.stdpath'config' }, {})
-vim.keymap.set('n', '<Leader>h', ab.help(), {})
-vim.keymap.set('n', '<Leader>b', ab.buffers(), {})
-vim.keymap.set('n', '<Leader>q', ab.quickfix(), {})
-
-return M