config/.config/nvim/lua/lazyvim/plugins/utility.lua
2023-01-09 09:34:46 +10:30

294 lines
7.9 KiB
Lua

return {
{
"nvim-lua/plenary.nvim",
},
{
"RRethy/vim-illuminate",
event = "BufReadPost",
config = function()
require("illuminate").configure({ delay = 200 })
end,
-- stylua: ignore
keys = {
{ "]]", function() require("illuminate").goto_next_reference(false) end, desc = "Next Reference", },
{ "[[", function() require("illuminate").goto_prev_reference(false) end, desc = "Prev Reference" },
},
},
{
"nvim-lua/popup.nvim",
},
{
"folke/neodev.nvim",
},
{
"rcarriga/nvim-notify",
config = function()
local icons = require("lazyvim.config.icons")
require("notify").setup({
-- Animation style (see below for details)
stages = "fade_in_slide_out",
-- Render function for notifications. See notify-render()
render = "default",
-- Default timeout for notifications
timeout = 2000,
-- For stages that change opacity this is treated as the highlight behind the window
-- Set this to either a highlight group or an RGB hex value e.g. "#000000"
background_colour = "Normal",
-- Minimum width for notification windows
minimum_width = 10,
-- Icons for the different levels
icons = {
ERROR = icons.diagnostics.Error,
WARN = icons.diagnostics.Warning,
INFO = icons.diagnostics.Information,
DEBUG = icons.ui.Bug,
TRACE = icons.ui.Pencil,
},
})
end,
},
{
"moll/vim-bbye",
},
{
"lewis6991/impatient.nvim",
config = function()
require("impatient").enable_profile()
end,
},
{
"ghillb/cybu.nvim",
cmd = { "CybuNext", "CybuPrev" },
config = function()
require("cybu").setup({
position = {
relative_to = "win", -- win, editor, cursor
anchor = "topright", -- topleft, topcenter, topright,
-- centerleft, center, centerright,
-- bottomleft, bottomcenter, bottomright
-- vertical_offset = 10, -- vertical offset from anchor in lines
-- horizontal_offset = 0, -- vertical offset from anchor in columns
-- max_win_height = 5, -- height of cybu window in lines
-- max_win_width = 0.5, -- integer for absolute in columns
-- float for relative to win/editor width
},
display_time = 1750, -- time the cybu window is displayed
style = {
separator = " ", -- string used as separator
prefix = "", -- string used as prefix for truncated paths
padding = 1, -- left & right padding in number of spaces
hide_buffer_id = true,
devicons = {
enabled = true, -- enable or disable web dev icons
colored = true, -- enable color for web dev icons
},
},
})
end,
},
{
"mbbill/undotree",
},
{
"MunifTanjim/nui.nvim",
},
{
"kyazdani42/nvim-web-devicons",
},
{
"lukas-reineke/indent-blankline.nvim",
config = function()
vim.g.indent_blankline_buftype_exclude = { "terminal", "nofile" }
vim.g.indent_blankline_filetype_exclude = {
"help",
"startify",
"dashboard",
"packer",
"neogitstatus",
"NvimTree",
"Trouble",
"text",
}
vim.g.indentLine_enabled = 1
vim.g.indent_blankline_char = ""
vim.g.indent_blankline_show_trailing_blankline_indent = false
vim.g.indent_blankline_show_first_indent_level = true
vim.g.indent_blankline_use_treesitter = false
vim.g.indent_blankline_show_current_context = true
require("indent_blankline").setup({
show_current_context = true,
})
end,
},
{
"windwp/nvim-autopairs",
config = function()
require("nvim-autopairs").setup({
disable_filetype = { "TelescopePrompt", "spectre_panel" },
ignore_next_char = "[%w%.*]", -- don't place pair when cursor sits in front of any char
})
end,
},
{
"preservim/vim-markdown",
},
{
"nacro90/numb.nvim",
config = function()
require("numb").setup({
show_numbers = true, -- enable 'number' for the window while peeking
show_cursorline = true, -- enable 'cursorline' for window wdile peeking
})
end,
},
{
"andymass/vim-matchup",
},
{
"junegunn/vim-slash",
},
{
"folke/zen-mode.nvim",
config = function()
require("zen-mode").setup({
window = {
backdrop = 1,
height = 0.9,
width = 80,
options = {
signcolumn = "no",
number = false,
relativenumber = false,
cursorline = true,
cursorcolumn = false, -- disable cursor column
},
},
plugins = {
gitsigns = { enabled = false },
tmux = { enabled = false },
twilight = { enabled = false },
},
on_open = function()
vim.g.cmp_active = false
vim.cmd([[LspStop]])
local status_ok, _ = pcall(vim.api.nvim_set_option_value, "winbar", nil, { scope = "local" })
if not status_ok then
return
end
if vim.fn.exists("#" .. "_winbar") == 1 then
vim.cmd("au! " .. "_winbar")
end
end,
on_close = function()
vim.g.cmp_active = true
vim.cmd([[LspStart]])
require("winbar").create_winbar()
end,
})
end,
},
{
"tpope/vim-surround",
},
{
"danymat/neogen",
config = function()
require("neogen").setup({
enabled = true,
input_after_comment = true,
})
end,
},
{
"monaqa/dial.nvim",
config = function()
local dial_config = require("dial.config")
local y = "2024/05/29"
local augend = require("dial.augend")
dial_config.augends:register_group({
default = {
augend.integer.alias.decimal,
augend.integer.alias.hex,
augend.date.alias["%Y/%m/%d"],
},
typescript = {
augend.integer.alias.decimal,
augend.integer.alias.hex,
augend.constant.new({ elements = { "let", "const" } }),
},
visual = {
augend.integer.alias.decimal,
augend.integer.alias.hex,
augend.date.alias["%Y/%m/%d"],
augend.constant.alias.alpha,
augend.constant.alias.Alpha,
},
mygroup = {
augend.constant.new({
elements = { "and", "or" },
word = true, -- if false, "sand" is incremented into "sor", "doctor" into "doctand", etc.
cyclic = true, -- "or" is incremented into "and".
}),
augend.constant.new({
elements = { "True", "False" },
word = true,
cyclic = true,
}),
augend.constant.new({
elements = { "public", "private" },
word = true,
cyclic = true,
}),
augend.constant.new({
elements = { "&&", "||" },
word = false,
cyclic = true,
}),
augend.date.alias["%d/%m/%Y"], -- date (02/19/2022, etc.)
augend.constant.alias.bool, -- boolean value (true <-> false)
augend.integer.alias.decimal,
augend.integer.alias.hex,
augend.semver.alias.semver,
},
})
local map = require("dial.map")
-- change augends in VISUAL mode
vim.api.nvim_set_keymap("n", "<C-a>", map.inc_normal("mygroup"), { noremap = true })
vim.api.nvim_set_keymap("n", "<C-x>", map.dec_normal("mygroup"), { noremap = true })
vim.api.nvim_set_keymap("v", "<C-a>", map.inc_normal("visual"), { noremap = true })
vim.api.nvim_set_keymap("v", "<C-x>", map.dec_normal("visual"), { noremap = true })
vim.cmd([[
" enable only for specific FileType
autocmd FileType typescript,javascript lua vim.api.nvim_buf_set_keymap(0, "n", "<C-a>", require("dial.map").inc_normal("typescript"), {noremap = true})
]])
end,
},
{
"ThePrimeagen/harpoon",
keys = {
{ "mm", '<cmd>lua require("harpoon.mark").add_file()<cr>', desc = "Harpoon" },
{ "ml", '<cmd>lua require("harpoon.ui").nav_next()<cr>', desc = "Harpoon Next" },
{ "mh", '<cmd>lua require("harpoon.ui").nav_prev()<cr>', desc = "Harpoon Prev" },
{ "ms", "<cmd>Telescope harpoon marks<cr>", desc = "Search Files" },
{ "mu", '<cmd>lua require("harpoon.ui").toggle_quick_menu()<cr>', desc = "Harpoon UI" },
{ "m1", '<cmd> lua require("harpoon.ui").nav_file(1)<cr>', desc = "Goto 1" },
{ "m2", '<cmd> lua require("harpoon.ui").nav_file(2)<cr>', desc = "Goto 2" },
{ "m3", '<cmd> lua require("harpoon.ui").nav_file(3)<cr>', desc = "Goto 3" },
{ "m4", '<cmd> lua require("harpoon.ui").nav_file(4)<cr>', desc = "Goto 4" },
},
},
}