nvim: fix packer

This commit is contained in:
PowerUser64 2022-08-13 01:58:52 -07:00
parent 61a1d8ce3b
commit 6518e6e448

View file

@ -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
-- }