~tristan957/dotfiles

053565133774bcc2e536bd03f345b00b3ee295e0 — Tristan Partin 4 months ago 34e3563
Use Comment.nvim instead of vim-commentary from tpope
M nvim/.config/nvim/lua/plugins.lua => nvim/.config/nvim/lua/plugins.lua +9 -2
@@ 98,6 98,14 @@ require("packer").startup(function(use)
		end,
	})

	use({
		"numToStr/Comment.nvim",
		config = function()
			require("tristan957.comment")
		end,
		requires = { "JoosepAlviste/nvim-ts-context-commentstring" },
	})

	use({ "nvim-lua/lsp-status.nvim" })

	use({ "nvim-lua/popup.nvim" })


@@ 135,6 143,7 @@ require("packer").startup(function(use)
	use({
		"nvim-treesitter/nvim-treesitter",
		run = ":TSUpdate",
		requires = { "JoosepAlviste/nvim-ts-context-commentstring" },
	})

	use({


@@ 188,8 197,6 @@ require("packer").startup(function(use)

	use({ "tmux-plugins/vim-tmux", ft = "tmux" })

	use({ "tpope/vim-commentary" })

	use({ "tpope/vim-fugitive" })

	use({ "tpope/vim-obsession" })

A nvim/.config/nvim/lua/tristan957/comment.lua => nvim/.config/nvim/lua/tristan957/comment.lua +20 -0
@@ 0,0 1,20 @@
require("Comment").setup({
	mappings = {
		extended = true,
	},
	pre_hook = function(ctx)
		local U = require("Comment.utils")

		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 = ctx.ctype == U.ctype.line and "__default" or "__multiline",
			location = location,
		})
	end,
})

M nvim/.config/nvim/lua/tristan957/tree-sitter.lua => nvim/.config/nvim/lua/tristan957/tree-sitter.lua +1 -0
@@ 1,6 1,7 @@
require("nvim-treesitter.configs").setup({
	context_commentstring = {
		enable = true,
		enable_autocmd = false,
	},
	ensure_installed = require("nvim-treesitter.parsers").maintained_parsers(),
	highlight = {