refactor(config): update plugin configurations for consistency
This commit is contained in:
2 files changed
+139
-140
No files matched your search
+73
-74
@@ -2,10 +2,10 @@ return {
|
||||
|
||||
-- completion
|
||||
{
|
||||
"saghen/blink.cmp",
|
||||
version = "*",
|
||||
'saghen/blink.cmp',
|
||||
version = '*',
|
||||
config = function()
|
||||
require("blink.cmp").setup({
|
||||
require('blink.cmp').setup({
|
||||
completion = {
|
||||
list = {
|
||||
selection = {
|
||||
@@ -14,27 +14,27 @@ return {
|
||||
},
|
||||
},
|
||||
documentation = {
|
||||
window = { border = "rounded" },
|
||||
window = { border = 'rounded' },
|
||||
auto_show = true,
|
||||
auto_show_delay_ms = 50,
|
||||
},
|
||||
menu = {
|
||||
border = "rounded",
|
||||
border = 'rounded',
|
||||
draw = {
|
||||
components = {
|
||||
kind_icon = {
|
||||
text = function(ctx)
|
||||
local kind_icon, _, _ = require("mini.icons").get("lsp", ctx.kind)
|
||||
local kind_icon, _, _ = require('mini.icons').get('lsp', ctx.kind)
|
||||
return kind_icon
|
||||
end,
|
||||
highlight = function(ctx)
|
||||
local _, hl, _ = require("mini.icons").get("lsp", ctx.kind)
|
||||
local _, hl, _ = require('mini.icons').get('lsp', ctx.kind)
|
||||
return hl
|
||||
end,
|
||||
},
|
||||
kind = {
|
||||
highlight = function(ctx)
|
||||
local _, hl, _ = require("mini.icons").get("lsp", ctx.kind)
|
||||
local _, hl, _ = require('mini.icons').get('lsp', ctx.kind)
|
||||
return hl
|
||||
end,
|
||||
},
|
||||
@@ -43,22 +43,22 @@ return {
|
||||
},
|
||||
},
|
||||
signature = {
|
||||
window = { border = "rounded" },
|
||||
window = { border = 'rounded' },
|
||||
},
|
||||
snippets = { preset = "luasnip" },
|
||||
snippets = { preset = 'luasnip' },
|
||||
sources = {
|
||||
default = { "lsp", "path", "snippets", "buffer" },
|
||||
default = { 'lsp', 'path', 'snippets', 'buffer' },
|
||||
providers = {},
|
||||
},
|
||||
keymap = {
|
||||
preset = "none",
|
||||
["<S-Tab>"] = { "select_prev", "snippet_backward", "fallback" },
|
||||
["<Tab>"] = { "select_next", "snippet_forward", "fallback" },
|
||||
["<CR>"] = { "accept", "fallback" },
|
||||
["<C-space>"] = { "hide", "show" },
|
||||
["<C-y>"] = { "show", "show_documentation", "hide_documentation" },
|
||||
["<C-u>"] = { "scroll_documentation_up", "fallback" },
|
||||
["<C-d>"] = { "scroll_documentation_down", "fallback" },
|
||||
preset = 'none',
|
||||
['<S-Tab>'] = { 'select_prev', 'snippet_backward', 'fallback' },
|
||||
['<Tab>'] = { 'select_next', 'snippet_forward', 'fallback' },
|
||||
['<CR>'] = { 'accept', 'fallback' },
|
||||
['<C-space>'] = { 'hide', 'show' },
|
||||
['<C-y>'] = { 'show', 'show_documentation', 'hide_documentation' },
|
||||
['<C-u>'] = { 'scroll_documentation_up', 'fallback' },
|
||||
['<C-d>'] = { 'scroll_documentation_down', 'fallback' },
|
||||
},
|
||||
})
|
||||
end,
|
||||
@@ -66,80 +66,79 @@ return {
|
||||
|
||||
-- snippets
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
version = "*",
|
||||
dependencies = { "rafamadriz/friendly-snippets" },
|
||||
'L3MON4D3/LuaSnip',
|
||||
version = '*',
|
||||
dependencies = { 'rafamadriz/friendly-snippets' },
|
||||
config = function()
|
||||
local luasnip = require("luasnip")
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
require("luasnip.loaders.from_vscode").lazy_load({
|
||||
paths = { vim.fn.stdpath("config") .. "/snippets" },
|
||||
local luasnip = require('luasnip')
|
||||
require('luasnip.loaders.from_vscode').lazy_load()
|
||||
require('luasnip.loaders.from_vscode').lazy_load({
|
||||
paths = { vim.fn.stdpath('config') .. '/snippets' },
|
||||
})
|
||||
|
||||
luasnip.filetype_extend("mdx", { "markdown" })
|
||||
luasnip.filetype_extend('mdx', { 'markdown' })
|
||||
end,
|
||||
},
|
||||
|
||||
-- auto pairs
|
||||
{
|
||||
"windwp/nvim-autopairs",
|
||||
event = "InsertEnter",
|
||||
'windwp/nvim-autopairs',
|
||||
event = 'InsertEnter',
|
||||
config = function()
|
||||
local npairs = require("nvim-autopairs")
|
||||
local Rule = require("nvim-autopairs.rule")
|
||||
local conds = require("nvim-autopairs.conds")
|
||||
local npairs = require('nvim-autopairs')
|
||||
local Rule = require('nvim-autopairs.rule')
|
||||
local conds = require('nvim-autopairs.conds')
|
||||
|
||||
npairs.setup()
|
||||
|
||||
-- Autoclosing angle-brackets.
|
||||
npairs.add_rule(Rule("<", ">", {
|
||||
npairs.add_rule(Rule('<', '>', {
|
||||
-- Avoid conflicts with nvim-ts-autotag.
|
||||
"-html",
|
||||
"-javascriptreact",
|
||||
"-typescriptreact",
|
||||
}):with_pair(conds.before_regex("%a+:?:?$", 3)):with_move(function(opts)
|
||||
return opts.char == ">"
|
||||
'-html',
|
||||
'-javascriptreact',
|
||||
'-typescriptreact',
|
||||
}):with_pair(conds.before_regex('%a+:?:?$', 3)):with_move(function(opts)
|
||||
return opts.char == '>'
|
||||
end))
|
||||
end,
|
||||
},
|
||||
|
||||
-- auto tag
|
||||
{
|
||||
"windwp/nvim-ts-autotag",
|
||||
'windwp/nvim-ts-autotag',
|
||||
ft = {
|
||||
"html",
|
||||
"xml",
|
||||
"javascript",
|
||||
"typescript",
|
||||
"javascriptreact",
|
||||
"typescriptreact",
|
||||
"jsx",
|
||||
"tsx",
|
||||
"vue",
|
||||
"svelte",
|
||||
"markdown",
|
||||
"htmldjango",
|
||||
'html',
|
||||
'xml',
|
||||
'javascript',
|
||||
'typescript',
|
||||
'javascriptreact',
|
||||
'typescriptreact',
|
||||
'jsx',
|
||||
'tsx',
|
||||
'vue',
|
||||
'svelte',
|
||||
'markdown',
|
||||
'htmldjango',
|
||||
},
|
||||
event = "InsertEnter",
|
||||
event = 'InsertEnter',
|
||||
lazy = true,
|
||||
config = function()
|
||||
require("nvim-ts-autotag").setup({
|
||||
enable_close = true,
|
||||
enable_rename = true,
|
||||
enable_close_on_slash = true,
|
||||
})
|
||||
end,
|
||||
opts = {
|
||||
-- Defaults
|
||||
enable_close = true, -- Auto close tags
|
||||
enable_rename = true, -- Auto rename pairs of tags
|
||||
enable_close_on_slash = false, -- Auto close on trailing </
|
||||
},
|
||||
},
|
||||
|
||||
-- comment
|
||||
{
|
||||
"numToStr/Comment.nvim",
|
||||
'numToStr/Comment.nvim',
|
||||
dependencies = {
|
||||
"JoosepAlviste/nvim-ts-context-commentstring",
|
||||
'JoosepAlviste/nvim-ts-context-commentstring',
|
||||
},
|
||||
config = function()
|
||||
require("Comment").setup({
|
||||
pre_hook = require("ts_context_commentstring.integrations.comment_nvim").create_pre_hook(),
|
||||
require('Comment').setup({
|
||||
pre_hook = require('ts_context_commentstring.integrations.comment_nvim').create_pre_hook(),
|
||||
mappings = {
|
||||
basic = true,
|
||||
extra = true,
|
||||
@@ -147,23 +146,23 @@ return {
|
||||
})
|
||||
end,
|
||||
keys = {
|
||||
{ "gcc", mode = "n", desc = "Toggle comment line" },
|
||||
{ "gc", mode = { "n", "o" }, desc = "Toggle comment linewise" },
|
||||
{ "gc", mode = "x", desc = "Toggle comment linewise (visual)" },
|
||||
{ "gbc", mode = "n", desc = "Toggle comment block" },
|
||||
{ "gb", mode = { "n", "o" }, desc = "Toggle comment blockwise" },
|
||||
{ "gb", mode = "x", desc = "Toggle comment blockwise (visual)" },
|
||||
{ 'gcc', mode = 'n', desc = 'Toggle comment line' },
|
||||
{ 'gc', mode = { 'n', 'o' }, desc = 'Toggle comment linewise' },
|
||||
{ 'gc', mode = 'x', desc = 'Toggle comment linewise (visual)' },
|
||||
{ 'gbc', mode = 'n', desc = 'Toggle comment block' },
|
||||
{ 'gb', mode = { 'n', 'o' }, desc = 'Toggle comment blockwise' },
|
||||
{ 'gb', mode = 'x', desc = 'Toggle comment blockwise (visual)' },
|
||||
},
|
||||
},
|
||||
|
||||
-- treesitter
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
event = { "BufReadPost", "BufNewFile" },
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
build = ':TSUpdate',
|
||||
event = { 'BufReadPost', 'BufNewFile' },
|
||||
config = function()
|
||||
require("nvim-treesitter.configs").setup({
|
||||
ensure_installed = require("config.extensions").ts_parsers,
|
||||
require('nvim-treesitter.configs').setup({
|
||||
ensure_installed = require('config.extensions').ts_parsers,
|
||||
auto_install = true,
|
||||
highlight = {
|
||||
enable = true,
|
||||
|
||||
Reference in new issue
Block a user