From 6518e6e448c6a999d971338549affac8273b89ed Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Sat, 13 Aug 2022 01:58:52 -0700 Subject: [PATCH] nvim: fix packer --- .config/nvim/lua/blake/plugins.lua | 50 ++++++++++-------------------- 1 file changed, 17 insertions(+), 33 deletions(-) diff --git a/.config/nvim/lua/blake/plugins.lua b/.config/nvim/lua/blake/plugins.lua index bae533a..314b0df 100644 --- a/.config/nvim/lua/blake/plugins.lua +++ b/.config/nvim/lua/blake/plugins.lua @@ -3,8 +3,8 @@ local fn = vim.fn local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim' if fn.empty(fn.glob(install_path)) > 0 then - PackerBootstrap = fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path}) - vim.cmd 'packadd packer.nvim' + packer_bootstrap = fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path}) + vim.cmd [[packadd packer.nvim]] end -- }} @@ -22,15 +22,13 @@ return require('packer').startup({function() } -- Packer + -- use 'wbthomason/packer.nvim', use { -- packer: plugin manager 'wbthomason/packer.nvim', config = function() -- Map :PS to :PackerSync vim.cmd 'command! PS PackerSync' - require("packer").init({ - autoremove = true, - }) - end + end, } -- Colors (decorations) @@ -214,7 +212,7 @@ return require('packer').startup({function() require('blake.dap').nvim_dap() end } - -- use { -- dap-buddy: DAP adapter installer + -- use { -- dap-buddy: DAP adapter installer - DBInstall -- 'Pocco81/dap-buddy.nvim', -- config = function() -- require('blake.dap').dap_buddy() @@ -228,6 +226,7 @@ return require('packer').startup({function() } use { -- nvim-dap-ui: a UI for nvim-dap 'rcarriga/nvim-dap-ui', + requires = {"mfussenegger/nvim-dap"}, config = function() require('blake.dap').dap_ui() end, @@ -389,31 +388,16 @@ return require('packer').startup({function() 'RRethy/nvim-align', } use { -- comment.nvim: toggle comments - gb and gc - 'numToStr/Comment.nvim', - config = function() - require('Comment').setup { - pre_hook = function(ctx) - -- Only calculate commentstring for tsx filetypes - if vim.bo.filetype == 'typescriptreact' then - local U = require('Comment.utils') - -- Detemine whether to use linewise or blockwise commentstring - local type = ctx.ctype == U.ctype.line and '__default' or '__multiline' - -- Determine the location where to calculate commentstring from - local location = nil - if ctx.ctype == U.ctype.block then - location = require('ts_context_commentstring.utils').get_cursor_location() - elseif ctx.cmotion == U.cmotion.v or ctx.cmotion == U.cmotion.V then - location = require('ts_context_commentstring.utils').get_visual_start_location() - end - return require('ts_context_commentstring.internal').calculate_commentstring({ - key = type, - location = location, - }) - end - end, - } - end - } + 'numToStr/Comment.nvim', + config = function() + require('Comment').setup { + mappings = { + extra = true, + extended = true, + } + } + end + } use { -- vim-illuminate: highlight other occurrences of the word under cursor 'RRethy/vim-illuminate', } @@ -495,7 +479,7 @@ return require('packer').startup({function() -- Bootstrap packer if needed { - if (PackerBootstrap) then + if (packer_bootstrap) then require('packer').sync() end -- }