Compare commits

...

1 Commits

Author SHA1 Message Date
christianchiarulli 54c2bb0782 add comments
3 years ago

@ -7,3 +7,4 @@ require "user.lsp"
require "user.telescope" require "user.telescope"
require "user.treesitter" require "user.treesitter"
require "user.autopairs" require "user.autopairs"
require "user.comment"

@ -0,0 +1,22 @@
local status_ok, comment = pcall(require, "Comment")
if not status_ok then
return
end
comment.setup {
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,
}

@ -45,6 +45,7 @@ return packer.startup(function(use)
use "nvim-lua/popup.nvim" -- An implementation of the Popup API from vim in Neovim use "nvim-lua/popup.nvim" -- An implementation of the Popup API from vim in Neovim
use "nvim-lua/plenary.nvim" -- Useful lua functions used ny lots of plugins use "nvim-lua/plenary.nvim" -- Useful lua functions used ny lots of plugins
use "windwp/nvim-autopairs" -- Autopairs, integrates with both cmp and treesitter use "windwp/nvim-autopairs" -- Autopairs, integrates with both cmp and treesitter
use "numToStr/Comment.nvim" -- Easily comment stuff
-- Colorschemes -- Colorschemes
-- use "lunarvim/colorschemes" -- A bunch of colorschemes you can try out -- use "lunarvim/colorschemes" -- A bunch of colorschemes you can try out
@ -75,6 +76,7 @@ return packer.startup(function(use)
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
run = ":TSUpdate", run = ":TSUpdate",
} }
use 'JoosepAlviste/nvim-ts-context-commentstring'
-- Automatically set up your configuration after cloning packer.nvim -- Automatically set up your configuration after cloning packer.nvim
-- Put this at the end after all plugins -- Put this at the end after all plugins

@ -16,4 +16,8 @@ configs.setup {
additional_vim_regex_highlighting = true, additional_vim_regex_highlighting = true,
}, },
indent = { enable = true, disable = { "yaml" } }, indent = { enable = true, disable = { "yaml" } },
context_commentstring = {
enable = true,
enable_autocmd = false,
},
} }

Loading…
Cancel
Save