nvim-config

Log | Files | Refs | Submodules | README

commit eaa2a98546ed555bed82eff65f7a22267cde22f9
parent a500135074559e2b1e821f6d89c3c5325eaed047
Author: Thomas Vigouroux <me@vigoux.eu>
Date:   Wed,  6 Mar 2024 08:01:17 +0100

chore: switch to mini for dependency management

Diffstat:
Dafter/plugin/config/nvim-treesitter.vim | 10----------
Minit.lua | 1-
Mlua/plugins.lua | 214++++++++++++++++++++++++++++++++++++++-----------------------------------------
3 files changed, 102 insertions(+), 123 deletions(-)

diff --git a/after/plugin/config/nvim-treesitter.vim b/after/plugin/config/nvim-treesitter.vim @@ -1,10 +0,0 @@ -" Last Change: 2021 Apr 12 - -if !exists('g:loaded_nvim_treesitter') - finish -endif - -lua require'ts_config' - -hi! link TSStrong Type -hi! link TSEmphasis markdownBold diff --git a/init.lua b/init.lua @@ -105,7 +105,6 @@ vim.api.nvim_create_autocmd("TextYankPost", { }) vim.cmd [[language en_US.utf8]] vim.cmd [[language time POSIX]] -vim.cmd.colorscheme "dracula" -- Now load plugins and such require "mappings" diff --git a/lua/plugins.lua b/lua/plugins.lua @@ -1,129 +1,119 @@ -- vim: et --- 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 +-- Clone 'mini.nvim' manually in a way that it gets managed by 'mini.deps' +local path_package = vim.fn.stdpath('data') .. '/site/' +local mini_path = path_package .. 'pack/deps/start/mini.nvim' +if not vim.loop.fs_stat(mini_path) then + vim.cmd('echo "Installing `mini.nvim`" | redraw') + local clone_cmd = { + 'git', 'clone', '--filter=blob:none', + 'https://github.com/echasnovski/mini.nvim', mini_path + } + vim.fn.system(clone_cmd) + vim.cmd('packadd mini.nvim | helptags ALL') + vim.cmd('echo "Installed `mini.nvim`" | redraw') end -local function paq(packages) - local first_install = clone_paq() - vim.cmd.packadd("paq-nvim") - local paqmod = require("paq") - paqmod(packages) +-- Set up 'mini.deps' (customize to your liking) +require('mini.deps').setup { + path = { package = path_package }, + job = { + n_threads = 4, + } +} - -- Now go over the packages, and for packages with a `config` key, run the associated function - for _, pack in ipairs(packages) do - if type(pack) == 'table' and type(pack.config) == 'function' then - pack.config() - end - end +local add = MiniDeps.add - if first_install then - vim.notify("Installing plugins... If prompted, hit Enter to continue.") - paqmod.install() - end -end +add 'mini.nvim' -paq { - "savq/paq-nvim", - -- List your packages - - --local complementree.nvim - -- 'dcampos/nvim-snippy', - -- 'honza/vim-snippets', - { 'nvim-treesitter/nvim-treesitter', build = ":TSUpdate" }, - "Mofiqul/dracula.nvim", - - --local azy.nvim - 'mfussenegger/nvim-qwahl', - --local notifier - - -- LSP stuff - { - "williamboman/mason.nvim", - config = function() - require "mason".setup {} - end +require 'mini.comment'.setup() +require 'mini.pairs'.setup { + modes = { insert = true } +} +require 'mini.colors'.setup() +require 'mini.surround'.setup { + mappings = { + add = 'sa', + delete = 'sd', + find = 'sf', + find_left = 'sF', + highlight = 'sh', + replace = 'sr', + update_n_lines = '', + }, +} + +local hipatterns = require('mini.hipatterns') +hipatterns.setup({ + highlighters = { + -- Highlight standalone 'FIXME', 'HACK', 'TODO', 'NOTE' + fixme = { pattern = '%f[%w]()FIXME()%f[%W]', group = 'MiniHipatternsFixme' }, + hack = { pattern = '%f[%w]()HACK()%f[%W]', group = 'MiniHipatternsHack' }, + todo = { pattern = '%f[%w]()TODO()%f[%W]', group = 'MiniHipatternsTodo' }, + note = { pattern = '%f[%w]()NOTE()%f[%W]', group = 'MiniHipatternsNote' }, + + -- Highlight hex color strings (`#rrggbb`) using that color + hex_color = hipatterns.gen_highlighter.hex_color(), }, - 'vigoux/ltex-ls.nvim', - { 'mfussenegger/nvim-dap', opt = true }, -- TODO load dap-config - - --local architext.nvim - -- 'vigoux/templar.nvim', - --local ratatoskr in opt - - 'nvim-lua/plenary.nvim', - 'lewis6991/gitsigns.nvim', - - { 'github/copilot.vim', opt = true }, - - --local oak - 'tamarin-prover/editors', - 'dubek/vim-mal', - - { - 'echasnovski/mini.nvim', - config = function() - require 'mini.comment'.setup() - require 'mini.pairs'.setup { - modes = { insert = true } - } - require 'mini.colors'.setup() - require 'mini.surround'.setup { - mappings = { - add = 'sa', - delete = 'sd', - find = 'sf', - find_left = 'sF', - highlight = 'sh', - replace = 'sr', - update_n_lines = '', - }, - } - - local hipatterns = require('mini.hipatterns') - hipatterns.setup({ - highlighters = { - -- Highlight standalone 'FIXME', 'HACK', 'TODO', 'NOTE' - fixme = { pattern = '%f[%w]()FIXME()%f[%W]', group = 'MiniHipatternsFixme' }, - hack = { pattern = '%f[%w]()HACK()%f[%W]', group = 'MiniHipatternsHack' }, - todo = { pattern = '%f[%w]()TODO()%f[%W]', group = 'MiniHipatternsTodo' }, - note = { pattern = '%f[%w]()NOTE()%f[%W]', group = 'MiniHipatternsNote' }, - - -- Highlight hex color strings (`#rrggbb`) using that color - hex_color = hipatterns.gen_highlighter.hex_color(), - }, - }) - - require('mini.ai').setup {} +}) + +require('mini.ai').setup {} + +add 'Mofiqul/dracula.nvim' +vim.cmd.colorscheme "dracula" + +add { + source = "nvim-treesitter/nvim-treesitter", + hooks = { + post_checkout = function() + vim.cmd "TSUpdate" end } } -require 'azy_config' - -require "notifier".setup { - component_name_recall = true, - status_width = 100, - notify = { - clear_time = 5000 +require 'nvim-treesitter.configs'.setup { + highlight = { + enable = true, + disable = {}, }, + ensure_installed = { 'c', 'lua', 'query', 'fennel', 'python', 'vim', 'bash', 'latex' } } --- -- sunjon <3 --- use 'sunjon/extmark-toy.nvim' +-- LSP stuff +add "williamboman/mason.nvim" +require "mason".setup {} + +add "vigoux/ltex-ls.nvim" + +-- My stuff +add { source = 'https://git.sr.ht/~vigoux/complementree.nvim' } +add { source = 'https://git.sr.ht/~vigoux/architext.nvim' } + +function azy_build_lib(data) + local finished = false + vim.system({ "make", "lib" }, { + cwd = data.path, + }, function() + finished = true + end) + vim.wait(10000, function() + return finished + end) +end --- -- filetypes --- use 'rhysd/vim-llvm' --- use 'tamarin-prover/editors' --- localuse 'vigoux/infer.nvim' +add { + source = 'https://git.sr.ht/~vigoux/azy.nvim', + hooks = { + post_checkout = azy_build_lib, + post_install = azy_build_lib, + } +} +require 'azy_config' + +add 'vigoux/notifier.nvim' +require 'notifier'.setup { + component_name_recall = true, +} --- if packer_bootstrap then --- packer.sync() --- end --- end) +add 'mfussenegger/nvim-qwahl' +add 'lewis6991/gitsigns.nvim'