Skip to content

Commit

Permalink
feat: config de plugins de funcionalidades
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianmolinab committed May 3, 2023
1 parent e15f215 commit 3eaf06f
Show file tree
Hide file tree
Showing 5 changed files with 180 additions and 0 deletions.
85 changes: 85 additions & 0 deletions lua/plugins/config/autopairs.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
local mode = { "i", "c" }
local uifiletypes = {
"aerial",
"checkhealth",
"dap-repl",
"dapui_breakpoints",
"dapui_console",
"dapui_hover",
"dapui_scopes",
"dapui_stacks",
"dapui_watches",
"DressingInput",
"DressingSelect",
"neo-tree",
"lazy",
"lspinfo",
"mason",
"nerdterm",
"noice",
"null-ls-info",
"qf",
"spectre_panel",
"TelescopePrompt",
}

return {
{
"altermo/npairs-integrate-upair",
keys = {
{ "{", mode = mode },
{ "[", mode = mode },
{ "(", mode = mode },
{ '"', mode = mode },
{ "'", mode = mode },
{ "`", mode = mode },
{ "<CR>", mode = "i" },
{ "<BS>", mode = "i" },
{ "<A-e>", mode = "i" },
{ "<A-E>", mode = "i" },
{ "<A-]>", mode = "i" },
{ "<A-C-e>", mode = "i" },
{ "<Space>", mode = "i" },
},
dependencies = {
{ "windwp/nvim-autopairs", dependencies = "nvim-treesitter/nvim-treesitter" },
{ "altermo/ultimate-autopair.nvim", dependencies = "nvim-treesitter/nvim-treesitter" },
},
init = function()
vim.api.nvim_create_autocmd("InsertEnter", {
callback = function()
local ok, cmp = pcall(require, "cmp")

if ok then
if not package.loaded["npairs-int-upair"] then
require("lazy").load({ plugins = { "npairs-integrate-upair" } })
end

cmp.event:on("confirm_done", require("nvim-autopairs.completion.cmp").on_confirm_done())
end

return true
end,
once = true,
})
end,
config = function()
local ignored_file_types = {}
local disable = { disable = true }

for _, filetype in pairs(uifiletypes) do
ignored_file_types[filetype] = disable
end

require("npairs-int-upair").setup({
bs = "u",
npairs_conf = {
disable_filetype = uifiletypes,
check_ts = true,
fast_wrap = { highlight = "Question", highlight_grey = "Dimmed" },
},
upair_conf = { internal_pairs = { ft = ignored_file_types } },
})
end,
},
}
31 changes: 31 additions & 0 deletions lua/plugins/config/black-indent.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
local open_file_event = { "BufNewFile", "BufRead", "BufAdd", "SessionLoadPost" }
return {
"lukas-reineke/indent-blankline.nvim",
depedencies = "nvim-treesitter/nvim-treesitter",
event = open_file_event,
config = function()
--vim.cmd [[highlight IndentBlanklineIndent guifg=#22262F ]]
vim.opt.list = true
--vim.opt.listchars:append "trail:●"
--vim.opt.listchars:append "space:·"
--vim.opt.listchars:append "eol:↓"

require("indent_blankline").setup({
use_treesitter = true,
show_current_context = true,
show_current_context_start = true,
show_trailing_blankline_indent = false,
show_end_of_line = true,
space_char_blankline = " ",
buftype_exclude = {
"help",
"loclist",
"nofile",
"prompt",
"quickfix",
"terminal",
},
filetype_exclude = { "list" },
})
end
}
16 changes: 16 additions & 0 deletions lua/plugins/config/colorizer.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
--Plugin para colorear Hexadecimales

return {
"norcalli/nvim-colorizer.lua",

--El plugun solo carga con estos archivos
ft = { "html", "css", "js", "jsx", "ts", "tsx" },

config = function()
require 'colorizer'.setup({
'css',
'javascript',
html = { mode = 'background' },
}, { mode = 'foreground' })
end
}
5 changes: 5 additions & 0 deletions lua/plugins/config/comment.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-- Hay que crear los keys para inicio del plugin
return {
"scrooloose/nerdcommenter",
--lazy = true
}
43 changes: 43 additions & 0 deletions lua/plugins/config/todo-comments.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
return {
'folke/todo-comments.nvim',
dependencies = {
"nvim-telescope/telescope.nvim",
"nvim-lua/plenary.nvim",
{
"folke/trouble.nvim",
dependencies = "kyazdani42/nvim-web-devicons",
}
},
keys = {
{'<leader>td', ':TodoTelescope<CR>'}
},
config = function ()
require("todo-comments").setup {
signs = true, -- show icons in the signs column
keywords = {
FIX = {
icon = "",
color = "error",
alt = { "FIXME", "BUG", "FIXIT", "ISSUE" },
signs = false,
},
TODO = { icon = "", color = "info" },
HACK = { icon = "", color = "warning" },
WARN = { icon = "", color = "warning", alt = { "WARNING", "XXX" } },
PERF = { icon = "", alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } },
NOTE = { icon = "", color = "hint", alt = { "INFO" } },
TEST = { icon = "", color = "test", alt = { "TESTING", "PASSED", "FAILED" }},
},
colors = {
error = { "DiagnosticError", "ErrorMsg", "#DC2626" },
warning = { "DiagnosticWarning", "WarningMsg", "#FBBF24" },
info = { "DiagnosticInfo", "#2563EB" },
hint = { "DiagnosticHint", "#10B981" },
default = { "Identifier", "#7C3AED" },
test = { "Identifier", "#FF00FF" }
},
}
end
}


0 comments on commit 3eaf06f

Please sign in to comment.