enc: lua format custem

This commit is contained in:
asep.komarudin 2024-06-14 08:40:35 +07:00
parent 65857a4226
commit 384c0b5768
68 changed files with 1450 additions and 1450 deletions

View file

@ -1,6 +1,6 @@
local opts, _ = pcall(require, "user.options")
if opts then
require "user.options"
require("user.options")
end
-- local key, _ = pcall(require, "user.keymaps")
-- if key then
@ -8,11 +8,11 @@ end
-- end
local cmd, _ = pcall(require, "user.autocommands")
if cmd then
require "user.autocommands"
require("user.autocommands")
end
local onsave, _ = pcall(require, "user.format_onsave")
if onsave then
require "user.format_onsave"
require("user.format_onsave")
end
vim.g.pcode_icons = require "user.icons"
vim.g.pcode_icons = require("user.icons")
return {}

View file

@ -5,7 +5,7 @@ return {
lazy = true,
event = "VimEnter",
config = function()
require "user.alpha"
require("user.alpha")
end,
},
}

View file

@ -4,7 +4,7 @@ return {
dependencies = "neovim/nvim-lspconfig",
event = "InsertEnter",
config = function()
require "user.breadcrumb"
require "user.winbar"
require("user.breadcrumb")
require("user.winbar")
end,
}

View file

@ -38,7 +38,7 @@ return {
vim.opt.termguicolors = true
bufferline.setup {
bufferline.setup({
options = {
color_icons = true,
numbers = "none", -- | "ordinal" | "buffer_id" | "both" | function({ ordinal, id, lower, raise }): string,
@ -174,6 +174,6 @@ return {
bg = { attribute = "bg", highlight = "Normal" },
},
},
}
})
end,
}

View file

@ -18,12 +18,12 @@ return {
version = false, -- last release is way too old
event = "InsertEnter",
opts = function()
local cmp = require "cmp"
local luasnip = require "luasnip"
local cmp = require("cmp")
local luasnip = require("luasnip")
local check_backspace = function()
local col = vim.fn.col "." - 1
return col == 0 or vim.fn.getline("."):sub(col, col):match "%s"
local col = vim.fn.col(".") - 1
return col == 0 or vim.fn.getline("."):sub(col, col):match("%s")
end
return {
@ -35,12 +35,12 @@ return {
require("luasnip").lsp_expand(args.body)
end,
},
mapping = cmp.mapping.preset.insert {
mapping = cmp.mapping.preset.insert({
["<C-b>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.abort(),
["<CR>"] = cmp.mapping.confirm { select = true }, -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
["<CR>"] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
@ -69,14 +69,14 @@ return {
"i",
"s",
}),
},
sources = cmp.config.sources {
}),
sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "luasnip" },
{ name = "buffer" },
{ name = "path" },
{ name = "nvim_lua" },
},
}),
formatting = {
fields = { "kind", "abbr", "menu" },
format = function(entry, vim_item)

View file

@ -1,152 +1,152 @@
return {
-- for auto complate commond mode
-- {
-- "gelguy/wilder.nvim",
-- lazy = true,
-- event = "VeryLazy",
-- config = function()
-- local wilder = require("wilder")
-- wilder.setup({ modes = { ":", "/", "?" } })
-- wilder.set_option(
-- "renderer",
-- wilder.popupmenu_renderer({
-- highlighter = wilder.basic_highlighter(),
-- left = { " ", wilder.popupmenu_devicons() },
-- right = { " ", wilder.popupmenu_scrollbar() },
-- })
-- )
-- end,
-- },
{
"folke/noice.nvim",
lazy = true,
enabled = true,
dependencies = {
{ "MunifTanjim/nui.nvim" },
},
-- event = "BufWinEnter",
event = "VeryLazy",
opts = {
messages = {
enabled = false,
},
notify = {
enabled = false,
},
lsp = {
progress = {
enabled = false,
},
hover = {
enabled = false,
},
signature = {
enabled = false,
},
},
},
keys = {
{
"<S-Enter>",
function()
require("noice").redirect(vim.fn.getcmdline())
end,
mode = "c",
desc = "Redirect Cmdline",
},
{
"<leader>snl",
function()
require("noice").cmd("last")
end,
desc = "Noice Last Message",
},
{
"<leader>snh",
function()
require("noice").cmd("history")
end,
desc = "Noice History",
},
{
"<leader>sna",
function()
require("noice").cmd("all")
end,
desc = "Noice All",
},
{
"<c-f>",
function()
if not require("noice.lsp").scroll(4) then
return "<c-f>"
end
end,
silent = true,
expr = true,
desc = "Scroll forward",
mode = { "i", "n", "s" },
},
{
"<c-b>",
function()
if not require("noice.lsp").scroll(-4) then
return "<c-b>"
end
end,
silent = true,
expr = true,
desc = "Scroll backward",
mode = { "i", "n", "s" },
},
},
},
{
"hrsh7th/cmp-cmdline",
event = "VeryLazy",
config = function()
local cmp = require("cmp")
local mapping = {
["<CR>"] = cmp.mapping.confirm({ select = true }),
["<Up>"] = cmp.mapping(cmp.mapping.select_prev_item(), { "i", "c" }),
["<S-Tab>"] = cmp.mapping(cmp.mapping.select_prev_item(), { "i", "c" }),
["<Down>"] = cmp.mapping(cmp.mapping.select_next_item(), { "i", "c" }),
["<Tab>"] = cmp.mapping(cmp.mapping.select_next_item(), { "i", "c" }),
}
-- for auto complate commond mode
-- {
-- "gelguy/wilder.nvim",
-- lazy = true,
-- event = "VeryLazy",
-- config = function()
-- local wilder = require("wilder")
-- wilder.setup({ modes = { ":", "/", "?" } })
-- wilder.set_option(
-- "renderer",
-- wilder.popupmenu_renderer({
-- highlighter = wilder.basic_highlighter(),
-- left = { " ", wilder.popupmenu_devicons() },
-- right = { " ", wilder.popupmenu_scrollbar() },
-- })
-- )
-- end,
-- },
{
"folke/noice.nvim",
lazy = true,
enabled = true,
dependencies = {
{ "MunifTanjim/nui.nvim" },
},
-- event = "BufWinEnter",
event = "VeryLazy",
opts = {
messages = {
enabled = false,
},
notify = {
enabled = false,
},
lsp = {
progress = {
enabled = false,
},
hover = {
enabled = false,
},
signature = {
enabled = false,
},
},
},
keys = {
{
"<S-Enter>",
function()
require("noice").redirect(vim.fn.getcmdline())
end,
mode = "c",
desc = "Redirect Cmdline",
},
{
"<leader>snl",
function()
require("noice").cmd("last")
end,
desc = "Noice Last Message",
},
{
"<leader>snh",
function()
require("noice").cmd("history")
end,
desc = "Noice History",
},
{
"<leader>sna",
function()
require("noice").cmd("all")
end,
desc = "Noice All",
},
{
"<c-f>",
function()
if not require("noice.lsp").scroll(4) then
return "<c-f>"
end
end,
silent = true,
expr = true,
desc = "Scroll forward",
mode = { "i", "n", "s" },
},
{
"<c-b>",
function()
if not require("noice.lsp").scroll(-4) then
return "<c-b>"
end
end,
silent = true,
expr = true,
desc = "Scroll backward",
mode = { "i", "n", "s" },
},
},
},
{
"hrsh7th/cmp-cmdline",
event = "VeryLazy",
config = function()
local cmp = require("cmp")
local mapping = {
["<CR>"] = cmp.mapping.confirm({ select = true }),
["<Up>"] = cmp.mapping(cmp.mapping.select_prev_item(), { "i", "c" }),
["<S-Tab>"] = cmp.mapping(cmp.mapping.select_prev_item(), { "i", "c" }),
["<Down>"] = cmp.mapping(cmp.mapping.select_next_item(), { "i", "c" }),
["<Tab>"] = cmp.mapping(cmp.mapping.select_next_item(), { "i", "c" }),
}
-- Use buffer source for `/`.
cmp.setup.cmdline("/", {
preselect = "none",
completion = {
completeopt = "menu,preview,menuone,noselect",
},
mapping = mapping,
sources = {
{ name = "buffer" },
},
experimental = {
ghost_text = true,
native_menu = false,
},
})
-- Use buffer source for `/`.
cmp.setup.cmdline("/", {
preselect = "none",
completion = {
completeopt = "menu,preview,menuone,noselect",
},
mapping = mapping,
sources = {
{ name = "buffer" },
},
experimental = {
ghost_text = true,
native_menu = false,
},
})
-- Use cmdline & path source for ':'.
cmp.setup.cmdline(":", {
preselect = "none",
completion = {
completeopt = "menu,preview,menuone,noselect",
},
mapping = mapping,
sources = cmp.config.sources({
{ name = "path" },
}, {
{ name = "cmdline" },
}),
experimental = {
ghost_text = true,
native_menu = false,
},
})
end,
},
-- Use cmdline & path source for ':'.
cmp.setup.cmdline(":", {
preselect = "none",
completion = {
completeopt = "menu,preview,menuone,noselect",
},
mapping = mapping,
sources = cmp.config.sources({
{ name = "path" },
}, {
{ name = "cmdline" },
}),
experimental = {
ghost_text = true,
native_menu = false,
},
})
end,
},
}

View file

@ -1,54 +1,54 @@
--typescript = "deno run",
-- cpp="gcc $fileName -lstdc++ -o $fileNameWithoutExt && $fileNameWithoutExt"
local rfile = {
java = "cd $dir && javac $fileName && java $fileNameWithoutExt",
python = "python3 -u",
typescript = "ts-node $dir/$fileName",
rust = "cd $dir && rustc $fileName && $dir/$fileNameWithoutExt",
cpp = "cd $dir && g++ $fileName -o $fileNameWithoutExt && $dir/$fileNameWithoutExt",
scss = "sass $dir/$fileName $dir/$fileNameWithoutExt.css",
javascript = 'node "$dir/$fileName"',
java = "cd $dir && javac $fileName && java $fileNameWithoutExt",
python = "python3 -u",
typescript = "ts-node $dir/$fileName",
rust = "cd $dir && rustc $fileName && $dir/$fileNameWithoutExt",
cpp = "cd $dir && g++ $fileName -o $fileNameWithoutExt && $dir/$fileNameWithoutExt",
scss = "sass $dir/$fileName $dir/$fileNameWithoutExt.css",
javascript = 'node "$dir/$fileName"',
}
local runscript = pcode.coderunner or {}
rfile = vim.tbl_deep_extend("force", runscript, rfile)
return {
"CRAG666/code_runner.nvim",
lazy = true,
cmd = { "RunCode", "RunFile", "RunProject", "RunClose" },
opts = {
-- put here the commands by filetype
filetype = rfile,
-- mode = "term",
mode = "float",
focus = true,
startinsert = true,
term = {
--position = "vert",
position = "bot",
size = 50,
},
float = {
-- Key that close the code_runner floating window
close_key = "<ESC>",
-- Window border (see ':h nvim_open_win')
border = "rounded",
"CRAG666/code_runner.nvim",
lazy = true,
cmd = { "RunCode", "RunFile", "RunProject", "RunClose" },
opts = {
-- put here the commands by filetype
filetype = rfile,
-- mode = "term",
mode = "float",
focus = true,
startinsert = true,
term = {
--position = "vert",
position = "bot",
size = 50,
},
float = {
-- Key that close the code_runner floating window
close_key = "<ESC>",
-- Window border (see ':h nvim_open_win')
border = "rounded",
-- Num from `0 - 1` for measurements
height = 0.8,
width = 0.8,
x = 0.5,
y = 0.5,
-- Num from `0 - 1` for measurements
height = 0.8,
width = 0.8,
x = 0.5,
y = 0.5,
-- Highlight group for floating window/border (see ':h winhl')
border_hl = "FloatBorder",
float_hl = "Normal",
-- Highlight group for floating window/border (see ':h winhl')
border_hl = "FloatBorder",
float_hl = "Normal",
-- Transparency (see ':h winblend')
blend = 0,
},
},
config = function(_, opts)
require("code_runner").setup(opts)
end,
-- Transparency (see ':h winblend')
blend = 0,
},
},
config = function(_, opts)
require("code_runner").setup(opts)
end,
}

View file

@ -1,25 +1,25 @@
return {
"NvChad/nvim-colorizer.lua",
lazy = true,
event = { "BufRead", "InsertEnter", "BufNewFile" },
opts = {
user_default_options = {
RGB = true, -- #RGB hex codes
RRGGBB = true, -- #RRGGBB hex codes
names = true, -- "Name" codes like Blue
RRGGBBAA = true, -- #RRGGBBAA hex codes
rgb_fn = true, -- CSS rgb() and rgba() functions
hsl_fn = true, -- CSS hsl() and hsla() functions
css = true, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB
css_fn = true, -- Enable all CSS *functions*: rgb_fn, hsl_fn
-- Available modes: foreground, background
mode = "background", -- Set the display mode.
tailwind = true,
},
filetypes = {
"*", -- Highlight all files, but customize some others.
css = { rgb_fn = true }, -- Enable parsing rgb(...) functions in css.
html = { names = false }, -- Disable parsing "names" like Blue or Gray
},
},
"NvChad/nvim-colorizer.lua",
lazy = true,
event = { "BufRead", "InsertEnter", "BufNewFile" },
opts = {
user_default_options = {
RGB = true, -- #RGB hex codes
RRGGBB = true, -- #RRGGBB hex codes
names = true, -- "Name" codes like Blue
RRGGBBAA = true, -- #RRGGBBAA hex codes
rgb_fn = true, -- CSS rgb() and rgba() functions
hsl_fn = true, -- CSS hsl() and hsla() functions
css = true, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB
css_fn = true, -- Enable all CSS *functions*: rgb_fn, hsl_fn
-- Available modes: foreground, background
mode = "background", -- Set the display mode.
tailwind = true,
},
filetypes = {
"*", -- Highlight all files, but customize some others.
css = { rgb_fn = true }, -- Enable parsing rgb(...) functions in css.
html = { names = false }, -- Disable parsing "names" like Blue or Gray
},
},
}

View file

@ -1,12 +1,12 @@
return {
"numToStr/Comment.nvim",
lazy = true,
opts = function()
return {
pre_hook = require("ts_context_commentstring.integrations.comment_nvim").create_pre_hook(),
}
end,
config = function(_, opts)
require("Comment").setup(opts)
end,
"numToStr/Comment.nvim",
lazy = true,
opts = function()
return {
pre_hook = require("ts_context_commentstring.integrations.comment_nvim").create_pre_hook(),
}
end,
config = function(_, opts)
require("Comment").setup(opts)
end,
}

View file

@ -1,22 +1,22 @@
return {
{
"rcarriga/nvim-dap-ui",
lazy = true,
event = "BufRead",
dependencies = "mfussenegger/nvim-dap",
enabled = vim.fn.has("win32") == 0,
config = function()
require("user.dapui")
end,
},
{
"jay-babu/mason-nvim-dap.nvim",
lazy = true,
event = "BufRead",
dependencies = { "williamboman/mason.nvim", "mfussenegger/nvim-dap" },
enabled = vim.fn.has("win32") == 0,
config = function()
require("user.mason_dap")
end,
},
{
"rcarriga/nvim-dap-ui",
lazy = true,
event = "BufRead",
dependencies = "mfussenegger/nvim-dap",
enabled = vim.fn.has("win32") == 0,
config = function()
require("user.dapui")
end,
},
{
"jay-babu/mason-nvim-dap.nvim",
lazy = true,
event = "BufRead",
dependencies = { "williamboman/mason.nvim", "mfussenegger/nvim-dap" },
enabled = vim.fn.has("win32") == 0,
config = function()
require("user.mason_dap")
end,
},
}

View file

@ -14,11 +14,11 @@ if pcode.database then
end,
config = function()
local function db_completion()
require("cmp").setup.buffer {
require("cmp").setup.buffer({
sources = { { name = "vim-dadbod-completion" } },
}
})
end
vim.g.db_ui_save_location = vim.fn.stdpath "config" .. require("plenary.path").path.sep .. "db_ui"
vim.g.db_ui_save_location = vim.fn.stdpath("config") .. require("plenary.path").path.sep .. "db_ui"
vim.api.nvim_create_autocmd("FileType", {
pattern = {

View file

@ -1,34 +1,34 @@
return {
"stevearc/dressing.nvim",
lazy = true,
init = function()
---@diagnostic disable-next-line: duplicate-set-field
vim.ui.select = function(...)
require("lazy").load({ plugins = { "dressing.nvim" } })
return vim.ui.select(...)
end
---@diagnostic disable-next-line: duplicate-set-field
vim.ui.input = function(...)
require("lazy").load({ plugins = { "dressing.nvim" } })
return vim.ui.input(...)
end
end,
opts = {
input = {
title_pos = "center",
relative = "editor",
default_prompt = "",
win_options = { winhighlight = "Normal:Normal,NormalNC:Normal" },
prefer_width = 30,
max_width = { 140, 0.9 },
min_width = { 50, 0.2 },
},
select = {
backend = { "telescope", "builtin" },
builtin = { win_options = { winhighlight = "Normal:Normal,NormalNC:Normal" } },
},
},
config = function(_, opts)
require("dressing").setup(opts)
end,
"stevearc/dressing.nvim",
lazy = true,
init = function()
---@diagnostic disable-next-line: duplicate-set-field
vim.ui.select = function(...)
require("lazy").load({ plugins = { "dressing.nvim" } })
return vim.ui.select(...)
end
---@diagnostic disable-next-line: duplicate-set-field
vim.ui.input = function(...)
require("lazy").load({ plugins = { "dressing.nvim" } })
return vim.ui.input(...)
end
end,
opts = {
input = {
title_pos = "center",
relative = "editor",
default_prompt = "",
win_options = { winhighlight = "Normal:Normal,NormalNC:Normal" },
prefer_width = 30,
max_width = { 140, 0.9 },
min_width = { 50, 0.2 },
},
select = {
backend = { "telescope", "builtin" },
builtin = { win_options = { winhighlight = "Normal:Normal,NormalNC:Normal" } },
},
},
config = function(_, opts)
require("dressing").setup(opts)
end,
}

View file

@ -1,75 +1,75 @@
local icons = vim.g.pcode_icons
return {
"lewis6991/gitsigns.nvim",
lazy = true,
enabled = vim.fn.executable("git") == 1,
ft = "gitcommit",
event = "BufRead",
opts = {
signs = {
add = {
hl = "GitSignsAdd",
text = icons.ui.BoldLineLeft,
numhl = "GitSignsAddNr",
linehl = "GitSignsAddLn",
},
change = {
hl = "GitSignsChange",
text = icons.ui.BoldLineLeft,
numhl = "GitSignsChangeNr",
linehl = "GitSignsChangeLn",
},
delete = {
hl = "GitSignsDelete",
text = icons.ui.Triangle,
numhl = "GitSignsDeleteNr",
linehl = "GitSignsDeleteLn",
},
topdelete = {
hl = "GitSignsDelete",
text = icons.ui.Triangle,
numhl = "GitSignsDeleteNr",
linehl = "GitSignsDeleteLn",
},
changedelete = {
hl = "GitSignsChange",
text = icons.ui.BoldLineLeft,
numhl = "GitSignsChangeNr",
linehl = "GitSignsChangeLn",
},
},
signcolumn = true,
numhl = false,
linehl = false,
word_diff = false,
watch_gitdir = {
interval = 1000,
follow_files = true,
},
attach_to_untracked = true,
current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
current_line_blame_opts = {
virt_text = true,
virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align'
delay = 1000,
ignore_whitespace = false,
},
current_line_blame_formatter = "<author>, <author_time:%Y-%m-%d> - <summary>",
sign_priority = 6,
status_formatter = nil, -- Use default
update_debounce = 200,
max_file_length = 40000,
preview_config = {
-- Options passed to nvim_open_win
border = "rounded",
style = "minimal",
relative = "cursor",
row = 0,
col = 1,
},
yadm = { enable = false },
},
config = function(_, opts)
require("gitsigns").setup(opts)
end,
"lewis6991/gitsigns.nvim",
lazy = true,
enabled = vim.fn.executable("git") == 1,
ft = "gitcommit",
event = "BufRead",
opts = {
signs = {
add = {
hl = "GitSignsAdd",
text = icons.ui.BoldLineLeft,
numhl = "GitSignsAddNr",
linehl = "GitSignsAddLn",
},
change = {
hl = "GitSignsChange",
text = icons.ui.BoldLineLeft,
numhl = "GitSignsChangeNr",
linehl = "GitSignsChangeLn",
},
delete = {
hl = "GitSignsDelete",
text = icons.ui.Triangle,
numhl = "GitSignsDeleteNr",
linehl = "GitSignsDeleteLn",
},
topdelete = {
hl = "GitSignsDelete",
text = icons.ui.Triangle,
numhl = "GitSignsDeleteNr",
linehl = "GitSignsDeleteLn",
},
changedelete = {
hl = "GitSignsChange",
text = icons.ui.BoldLineLeft,
numhl = "GitSignsChangeNr",
linehl = "GitSignsChangeLn",
},
},
signcolumn = true,
numhl = false,
linehl = false,
word_diff = false,
watch_gitdir = {
interval = 1000,
follow_files = true,
},
attach_to_untracked = true,
current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
current_line_blame_opts = {
virt_text = true,
virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align'
delay = 1000,
ignore_whitespace = false,
},
current_line_blame_formatter = "<author>, <author_time:%Y-%m-%d> - <summary>",
sign_priority = 6,
status_formatter = nil, -- Use default
update_debounce = 200,
max_file_length = 40000,
preview_config = {
-- Options passed to nvim_open_win
border = "rounded",
style = "minimal",
relative = "cursor",
row = 0,
col = 1,
},
yadm = { enable = false },
},
config = function(_, opts)
require("gitsigns").setup(opts)
end,
}

View file

@ -1,39 +1,39 @@
return {
"lukas-reineke/indent-blankline.nvim",
-- version = "3.5.4",
event = { "BufRead", "InsertEnter", "BufNewFile" },
lazy = true,
opts = {
indent = {
char = "",
tab_char = "",
},
scope = { enabled = false },
exclude = {
buftypes = {
"nofile",
"prompt",
"quickfix",
"terminal",
},
filetypes = {
"help",
"alpha",
"dashboard",
"neo-tree",
"Trouble",
"trouble",
"lazy",
"mason",
"notify",
"toggleterm",
"lazyterm",
"NvimTree",
"aerial",
"neogitstatus",
"startify",
},
},
},
main = "ibl",
"lukas-reineke/indent-blankline.nvim",
-- version = "3.5.4",
event = { "BufRead", "InsertEnter", "BufNewFile" },
lazy = true,
opts = {
indent = {
char = "",
tab_char = "",
},
scope = { enabled = false },
exclude = {
buftypes = {
"nofile",
"prompt",
"quickfix",
"terminal",
},
filetypes = {
"help",
"alpha",
"dashboard",
"neo-tree",
"Trouble",
"trouble",
"lazy",
"mason",
"notify",
"toggleterm",
"lazyterm",
"NvimTree",
"aerial",
"neogitstatus",
"startify",
},
},
},
main = "ibl",
}

View file

@ -1,48 +1,48 @@
return {
{
"neovim/nvim-lspconfig",
lazy = true,
event = "BufRead",
cmd = {
"LspInfo",
"LspInstall",
"LspUninstall",
},
config = function()
require("lspconfig.ui.windows").default_options.border = "rounded"
end,
},
{
"williamboman/mason.nvim",
lazy = true,
dependencies = { "williamboman/mason-lspconfig.nvim" },
cmd = {
"Mason",
"MasonInstall",
"MasonUninstall",
"MasonUninstallAll",
"MasonLog",
},
config = function()
require("user.lsp")
end,
},
{
"jayp0521/mason-null-ls.nvim",
lazy = true,
dependencies = {
"nvimtools/none-ls.nvim",
dependencies = {
"nvimtools/none-ls-extras.nvim",
lazy = true,
},
config = function()
require("user.lsp.null-lscfg")
end,
},
event = "InsertEnter",
opts = function()
require("user.mason-null-ls")
end,
},
{
"neovim/nvim-lspconfig",
lazy = true,
event = "BufRead",
cmd = {
"LspInfo",
"LspInstall",
"LspUninstall",
},
config = function()
require("lspconfig.ui.windows").default_options.border = "rounded"
end,
},
{
"williamboman/mason.nvim",
lazy = true,
dependencies = { "williamboman/mason-lspconfig.nvim" },
cmd = {
"Mason",
"MasonInstall",
"MasonUninstall",
"MasonUninstallAll",
"MasonLog",
},
config = function()
require("user.lsp")
end,
},
{
"jayp0521/mason-null-ls.nvim",
lazy = true,
dependencies = {
"nvimtools/none-ls.nvim",
dependencies = {
"nvimtools/none-ls-extras.nvim",
lazy = true,
},
config = function()
require("user.lsp.null-lscfg")
end,
},
event = "InsertEnter",
opts = function()
require("user.mason-null-ls")
end,
},
}

View file

@ -41,12 +41,12 @@ if fidget then
tag = "legacy",
event = "BufRead",
config = function()
require("fidget").setup {
require("fidget").setup({
window = {
blend = 0,
relative = "editor",
},
}
})
end,
}
elseif lualine then
@ -57,7 +57,7 @@ elseif lualine then
branch = "main",
event = { "BufRead" },
config = function()
require("lsp-progress").setup {
require("lsp-progress").setup({
client_format = function(client_name, spinner, series_messages)
return #series_messages > 0
and (spinner .. " " .. ambilKataDariKiri(table.concat(series_messages, ", "), 4) .. "...")
@ -69,7 +69,7 @@ elseif lualine then
and (sign .. " " .. ambilKataDariKiri(table.concat(client_messages, " "), 4) .. "...")
or sign
end,
}
})
end,
}
else

View file

@ -3,7 +3,7 @@ return {
"nvim-lualine/lualine.nvim",
event = { "InsertEnter", "BufRead", "BufNewFile" },
config = function()
local component = require "user.utils.lualine_component"
local component = require("user.utils.lualine_component")
local colors = component.colors
-- check config for theme
@ -43,7 +43,7 @@ return {
bubbles_theme = vim.fn.fnamemodify("auto", ":t")
end
local gettheme = require "user.utils.lualine_template"
local gettheme = require("user.utils.lualine_template")
local theme_option = pcode.lualinetheme or "rounded"
local theme = gettheme.rounded(bubbles_theme)
if theme_option == "rounded" then
@ -61,13 +61,13 @@ return {
elseif theme_option == "default" then
theme = {}
end
require("lualine").setup {
require("lualine").setup({
options = theme.options,
sections = theme.sections,
inactive_sections = theme.inactive_sections,
tabline = theme.tabline,
extensions = theme.extensions,
}
})
end,
},
}

View file

@ -8,7 +8,7 @@ if not vim.g.neovide and pcode.minianimate and true or false then
opts = function()
-- don't use animate when scrolling with the mouse
local mouse_scrolled = false
for _, scroll in ipairs { "Up", "Down" } do
for _, scroll in ipairs({ "Up", "Down" }) do
local key = "<ScrollWheel" .. scroll .. ">"
vim.keymap.set({ "", "i" }, key, function()
mouse_scrolled = true
@ -16,14 +16,14 @@ if not vim.g.neovide and pcode.minianimate and true or false then
end, { expr = true })
end
local animate = require "mini.animate"
local animate = require("mini.animate")
return {
resize = {
timing = animate.gen_timing.linear { duration = 100, unit = "total" },
timing = animate.gen_timing.linear({ duration = 100, unit = "total" }),
},
scroll = {
timing = animate.gen_timing.linear { duration = 150, unit = "total" },
subscroll = animate.gen_subscroll.equal {
timing = animate.gen_timing.linear({ duration = 150, unit = "total" }),
subscroll = animate.gen_subscroll.equal({
predicate = function(total_scroll)
if mouse_scrolled then
mouse_scrolled = false
@ -31,7 +31,7 @@ if not vim.g.neovide and pcode.minianimate and true or false then
end
return total_scroll > 1
end,
},
}),
},
}
end,

View file

@ -3,6 +3,6 @@ return {
event = "VeryLazy",
lazy = true,
config = function()
require("neoscroll").setup {}
require("neoscroll").setup({})
end,
}

View file

@ -6,7 +6,7 @@ return {
{
"<leader>un",
function()
require("notify").dismiss { silent = true, pending = true }
require("notify").dismiss({ silent = true, pending = true })
end,
desc = "Delete all Notifications",
},
@ -22,10 +22,10 @@ return {
},
-- event = "BufWinEnter",
config = function()
local notify = require "notify"
local notify = require("notify")
-- this for transparency
-- notify.setup { background_colour = "#000000", render = "compact" }
notify.setup { render = "compact" }
notify.setup({ render = "compact" })
-- this overwrites the vim notify function
vim.notify = notify.notify
end,

View file

@ -210,7 +210,7 @@ return {
},
config = function(_, opts)
require("nvim-tree").setup(opts)
local api = require "nvim-tree.api"
local api = require("nvim-tree.api")
api.events.subscribe(api.events.Event.FileCreated, function(file)
vim.cmd("edit " .. file.fname)
end)

View file

@ -20,8 +20,8 @@ if pcode.nvimufo then
{
"luukvbaal/statuscol.nvim",
config = function()
local builtin = require "statuscol.builtin"
require("statuscol").setup {
local builtin = require("statuscol.builtin")
require("statuscol").setup({
setopt = true,
relculright = true,
segments = {
@ -33,7 +33,7 @@ if pcode.nvimufo then
},
{ text = { builtin.lnumfunc, " " }, click = "v:lua.ScLa" },
},
}
})
end,
},
},
@ -65,7 +65,7 @@ if pcode.nvimufo then
-- these are "extra", change them as you like
vim.keymap.set("n", "zR", require("ufo").openAllFolds)
vim.keymap.set("n", "zM", require("ufo").closeAllFolds)
vim.cmd("highlight FoldColumn guifg=" .. vim.fn.synIDattr(vim.fn.synIDtrans(vim.fn.hlID "Comment"), "fg"))
vim.cmd("highlight FoldColumn guifg=" .. vim.fn.synIDattr(vim.fn.synIDtrans(vim.fn.hlID("Comment")), "fg"))
-- start ini bagian code support comment dan import
local ftMap = {
vim = "indent",
@ -75,7 +75,7 @@ if pcode.nvimufo then
local function customizeSelector(bufnr)
local function handleFallbackException(err, providerName)
if type(err) == "string" and err:match "UfoFallbackException" then
if type(err) == "string" and err:match("UfoFallbackException") then
return require("ufo").getFolds(bufnr, providerName)
else
return require("promise").reject(err)
@ -92,7 +92,7 @@ if pcode.nvimufo then
end)
end
require("ufo").setup {
require("ufo").setup({
open_fold_hl_timeout = 150,
close_fold_kinds_for_ft = {
-- default = { "imports", "comment" },
@ -127,21 +127,21 @@ if pcode.nvimufo then
-- Memeriksa apakah baris awal dari fold adalah komentar
local start_line = vim.api.nvim_buf_get_lines(0, lnum - 1, lnum, false)[1]
-- cari comentar dengan awalan /* untuk generaal comment
if start_line:find "^%s*%/%*" then
if start_line:find("^%s*%/%*") then
is_comment = true
-- cara commentar dengan awalan <!-- untuk html
elseif start_line:find "^%s*<!--" then
elseif start_line:find("^%s*<!--") then
is_comment = true
-- cari comentar dengan awalan -- untuk lua
elseif start_line:find "^%s*%-%-" then
elseif start_line:find("^%s*%-%-") then
is_comment = true
end
-- cek fold yang berawalan import
if start_line:find "^%s*import" then
if start_line:find("^%s*import") then
is_import = true
end
-- cek fold dengan akhiran {
if start_line:find "%s*{%s*$" then
if start_line:find("%s*{%s*$") then
is_bracket = true
end
if is_comment then
@ -221,7 +221,7 @@ if pcode.nvimufo then
end
return result
end,
}
})
-- end bagian code support comment dan import
vim.api.nvim_create_autocmd("FileType", {
pattern = {

View file

@ -1,4 +1,4 @@
return {
"nvim-lua/plenary.nvim",
lazy = true,
"nvim-lua/plenary.nvim",
lazy = true,
}

View file

@ -4,7 +4,7 @@ return {
event = "BufRead",
config = function()
-- Modul ini berisi beberapa definisi default
local rainbow_delimiters = require "rainbow-delimiters"
local rainbow_delimiters = require("rainbow-delimiters")
vim.g.rainbow_delimiters = {
strategy = {
[""] = rainbow_delimiters.strategy["global"],

View file

@ -1,13 +1,13 @@
return {
"dstein64/nvim-scrollview",
lazy = true,
event = { "BufRead", "InsertEnter", "BufNewFile" },
opts = {
bg = "LightCyan",
ctermbg = 160,
},
config = function(_, opts)
require("scrollview").setup(opts)
vim.g.scrollview_excluded_filetypes = { "NvimTree", "vista_kind", "Outline", "neo-tree" }
end,
"dstein64/nvim-scrollview",
lazy = true,
event = { "BufRead", "InsertEnter", "BufNewFile" },
opts = {
bg = "LightCyan",
ctermbg = 160,
},
config = function(_, opts)
require("scrollview").setup(opts)
vim.g.scrollview_excluded_filetypes = { "NvimTree", "vista_kind", "Outline", "neo-tree" }
end,
}

View file

@ -1,21 +1,21 @@
return {
"mrjones2014/smart-splits.nvim",
lazy = true,
event = { "BufRead", "InsertEnter", "BufNewFile" },
opts = {
ignored_filetypes = {
"nofile",
"quickfix",
"qf",
"prompt",
},
ignored_buftypes = { "nofile" },
},
config = function(_, opts)
require("smart-splits").setup(opts)
vim.keymap.set("n", "<C-Left>", require("smart-splits").resize_left)
vim.keymap.set("n", "<C-Down>", require("smart-splits").resize_down)
vim.keymap.set("n", "<C-Up", require("smart-splits").resize_up)
vim.keymap.set("n", "<C-Right>", require("smart-splits").resize_right)
end,
"mrjones2014/smart-splits.nvim",
lazy = true,
event = { "BufRead", "InsertEnter", "BufNewFile" },
opts = {
ignored_filetypes = {
"nofile",
"quickfix",
"qf",
"prompt",
},
ignored_buftypes = { "nofile" },
},
config = function(_, opts)
require("smart-splits").setup(opts)
vim.keymap.set("n", "<C-Left>", require("smart-splits").resize_left)
vim.keymap.set("n", "<C-Down>", require("smart-splits").resize_down)
vim.keymap.set("n", "<C-Up", require("smart-splits").resize_up)
vim.keymap.set("n", "<C-Right>", require("smart-splits").resize_right)
end,
}

View file

@ -1,25 +1,25 @@
return {
{
"rafamadriz/friendly-snippets",
event = "InsertEnter",
lazy = true,
config = function()
require("luasnip.loaders.from_vscode").lazy_load()
require("user.snippets")
require("user.snip")
end,
},
{
"L3MON4D3/LuaSnip",
lazy = true,
opts = {
history = true,
delete_check_events = "TextChanged",
},
{
"rafamadriz/friendly-snippets",
event = "InsertEnter",
lazy = true,
config = function()
require("luasnip.loaders.from_vscode").lazy_load()
require("user.snippets")
require("user.snip")
end,
},
{
"L3MON4D3/LuaSnip",
lazy = true,
opts = {
history = true,
delete_check_events = "TextChanged",
},
-- stylua: ignore
keys = {
{ "<tab>", function() require("luasnip").jump(1) end, mode = "s" },
{ "<s-tab>", function() require("luasnip").jump(-1) end, mode = { "i", "s" } },
},
},
},
}

View file

@ -22,7 +22,7 @@ return {
only_sort_text = true,
}
end
local actions = require "telescope.actions"
local actions = require("telescope.actions")
vim.g.theme_switcher_loaded = true
return {
defaults = {

View file

@ -1,49 +1,49 @@
return {
"akinsho/toggleterm.nvim",
lazy = true,
cmd = {
"ToggleTerm",
"TermExec",
"ToggleTermToggleAll",
"ToggleTermSendCurrentLine",
"ToggleTermSendVisualLines",
"ToggleTermSendVisualSelection",
},
branch = "main",
enabled = true,
opts = {
size = 20,
open_mapping = [[<c-\>]],
hide_numbers = true,
shade_filetypes = {},
shade_terminals = true,
shading_factor = 2,
start_in_insert = true,
insert_mappings = true,
persist_size = true,
direction = "float",
close_on_exit = true,
shell = vim.o.shell,
float_opts = {
border = "curved",
winblend = 0,
highlights = {
border = "Normal",
background = "Normal",
},
},
},
config = function(_, opts)
require("toggleterm").setup(opts)
function _G.set_terminal_keymaps()
local optsn = { noremap = true }
vim.api.nvim_buf_set_keymap(0, "t", "<esc>", [[<C-\><C-n>]], optsn)
vim.api.nvim_buf_set_keymap(0, "t", "jk", [[<C-\><C-n>]], optsn)
vim.api.nvim_buf_set_keymap(0, "t", "<C-h>", [[<C-\><C-n><C-W>h]], optsn)
vim.api.nvim_buf_set_keymap(0, "t", "<C-j>", [[<C-\><C-n><C-W>j]], optsn)
vim.api.nvim_buf_set_keymap(0, "t", "<C-k>", [[<C-\><C-n><C-W>k]], optsn)
vim.api.nvim_buf_set_keymap(0, "t", "<C-l>", [[<C-\><C-n><C-W>l]], optsn)
end
vim.cmd("autocmd! TermOpen term://* lua set_terminal_keymaps()")
end,
"akinsho/toggleterm.nvim",
lazy = true,
cmd = {
"ToggleTerm",
"TermExec",
"ToggleTermToggleAll",
"ToggleTermSendCurrentLine",
"ToggleTermSendVisualLines",
"ToggleTermSendVisualSelection",
},
branch = "main",
enabled = true,
opts = {
size = 20,
open_mapping = [[<c-\>]],
hide_numbers = true,
shade_filetypes = {},
shade_terminals = true,
shading_factor = 2,
start_in_insert = true,
insert_mappings = true,
persist_size = true,
direction = "float",
close_on_exit = true,
shell = vim.o.shell,
float_opts = {
border = "curved",
winblend = 0,
highlights = {
border = "Normal",
background = "Normal",
},
},
},
config = function(_, opts)
require("toggleterm").setup(opts)
function _G.set_terminal_keymaps()
local optsn = { noremap = true }
vim.api.nvim_buf_set_keymap(0, "t", "<esc>", [[<C-\><C-n>]], optsn)
vim.api.nvim_buf_set_keymap(0, "t", "jk", [[<C-\><C-n>]], optsn)
vim.api.nvim_buf_set_keymap(0, "t", "<C-h>", [[<C-\><C-n><C-W>h]], optsn)
vim.api.nvim_buf_set_keymap(0, "t", "<C-j>", [[<C-\><C-n><C-W>j]], optsn)
vim.api.nvim_buf_set_keymap(0, "t", "<C-k>", [[<C-\><C-n><C-W>k]], optsn)
vim.api.nvim_buf_set_keymap(0, "t", "<C-l>", [[<C-\><C-n><C-W>l]], optsn)
end
vim.cmd("autocmd! TermOpen term://* lua set_terminal_keymaps()")
end,
}

View file

@ -25,7 +25,7 @@ if transparent then
event = "BufWinEnter",
cmd = { "TransparentToggle", "TransparentEnable", "TransparentDisable" },
config = function()
require("transparent").setup {
require("transparent").setup({
extra_groups = {
"Normal",
"NormalNC",
@ -53,25 +53,25 @@ if transparent then
-- disable lualine background color
"LualineNormal",
},
}
require("transparent").clear_prefix "BufferLine"
})
require("transparent").clear_prefix("BufferLine")
-- clear prefix for which-key
require("transparent").clear_prefix "WhichKey"
require("transparent").clear_prefix("WhichKey")
-- clear prefix for lazy.nvim
require("transparent").clear_prefix "Lazy"
require("transparent").clear_prefix("Lazy")
-- clear prefix for NvimTree
require("transparent").clear_prefix "NvimTree"
require("transparent").clear_prefix("NvimTree")
-- clear prefix for NeoTree
require("transparent").clear_prefix "NeoTree"
require("transparent").clear_prefix("NeoTree")
-- clear prefix for Telescope
require("transparent").clear_prefix "Telescope"
require("transparent").clear_prefix "mason"
require("transparent").clear_prefix("Telescope")
require("transparent").clear_prefix("mason")
if clear_lualine then
-- clear prefix for Lualine
require("transparent").clear_prefix "Lualine"
require("transparent").clear_prefix("Lualine")
-- create auto command to set transparent
vim.cmd "TransparentDisable"
vim.cmd "TransparentEnable"
vim.cmd("TransparentDisable")
vim.cmd("TransparentEnable")
end
end,
},

View file

@ -1,189 +1,189 @@
return {
{
"nvim-treesitter/nvim-treesitter",
dependencies = {
{
"JoosepAlviste/nvim-ts-context-commentstring",
lazy = true,
config = function()
require("ts_context_commentstring").setup({
enable_autocmd = false,
})
end,
},
{
"windwp/nvim-autopairs",
lazy = true,
dependencies = "hrsh7th/nvim-cmp",
event = "InsertEnter",
opts = {
check_ts = true,
ts_config = {
lua = { "string", "source" },
javascript = { "string", "template_string" },
java = false,
},
disable_filetype = { "TelescopePrompt", "spectre_panel" },
fast_wrap = {
map = "<M-e>",
chars = { "{", "[", "(", '"', "'", "`" },
pattern = string.gsub([[ [%'%"%)%>%]%)%}%,] ]], "%s+", ""),
offset = 0, -- Offset from pattern match
end_key = "$",
keys = "qwertyuiopzxcvbnmasdfghjkl",
check_comma = true,
highlight = "PmenuSel",
highlight_grey = "LineNr",
},
},
config = function(_, opts)
require("nvim-autopairs").setup(opts)
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
local cmp_status_ok, cmp = pcall(require, "cmp")
if not cmp_status_ok then
return
end
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done({ map_char = { tex = "" } }))
end,
},
},
version = false, -- last release is way too old and doesn't work on Windows
build = ":TSUpdate",
-- event = { "LazyFile", "VeryLazy" },
lazy = true,
cmd = {
"TSInstall",
"TSUninstall",
"TSUpdate",
"TSUpdateSync",
"TSInstallInfo",
"TSInstallSync",
"TSInstallFromGrammar",
},
event = { "BufRead", "VeryLazy" },
opts = function()
return {
highlight = { enable = true },
indent = { enable = true },
ensure_installed = {
"lua",
"vim",
"vimdoc",
},
incremental_selection = {
enable = true,
},
autopairs = {
enable = true,
},
}
end,
config = function(_, opts)
if type(opts.ensure_installed) == "table" then
---@type table<string, boolean>
local added = {}
opts.ensure_installed = vim.tbl_filter(function(lang)
if added[lang] then
return false
end
added[lang] = true
return true
end, opts.ensure_installed)
end
require("nvim-treesitter.configs").setup(opts)
vim.schedule(function()
require("lazy").load({ plugins = { "nvim-treesitter-textobjects" } })
end)
end,
},
{
"nvim-treesitter/nvim-treesitter-textobjects",
lazy = true,
config = function()
-- When in diff mode, we want to use the default
-- vim text objects c & C instead of the treesitter ones.
local move = require("nvim-treesitter.textobjects.move") ---@type table<string,fun(...)>
local configs = require("nvim-treesitter.configs")
for name, fn in pairs(move) do
if name:find("goto") == 1 then
move[name] = function(q, ...)
if vim.wo.diff then
local config = configs.get_module("textobjects.move")[name] ---@type table<string,string>
for key, query in pairs(config or {}) do
if q == query and key:find("[%]%[][cC]") then
vim.cmd("normal! " .. key)
return
end
end
end
return fn(q, ...)
end
end
end
end,
},
-- Automatically add closing tags for HTML and JSX
{
"windwp/nvim-ts-autotag",
lazy = true,
event = "BufRead",
opts = {},
},
{
"nvim-treesitter/nvim-treesitter",
dependencies = {
{
"JoosepAlviste/nvim-ts-context-commentstring",
lazy = true,
config = function()
require("ts_context_commentstring").setup({
enable_autocmd = false,
})
end,
},
{
"windwp/nvim-autopairs",
lazy = true,
dependencies = "hrsh7th/nvim-cmp",
event = "InsertEnter",
opts = {
check_ts = true,
ts_config = {
lua = { "string", "source" },
javascript = { "string", "template_string" },
java = false,
},
disable_filetype = { "TelescopePrompt", "spectre_panel" },
fast_wrap = {
map = "<M-e>",
chars = { "{", "[", "(", '"', "'", "`" },
pattern = string.gsub([[ [%'%"%)%>%]%)%}%,] ]], "%s+", ""),
offset = 0, -- Offset from pattern match
end_key = "$",
keys = "qwertyuiopzxcvbnmasdfghjkl",
check_comma = true,
highlight = "PmenuSel",
highlight_grey = "LineNr",
},
},
config = function(_, opts)
require("nvim-autopairs").setup(opts)
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
local cmp_status_ok, cmp = pcall(require, "cmp")
if not cmp_status_ok then
return
end
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done({ map_char = { tex = "" } }))
end,
},
},
version = false, -- last release is way too old and doesn't work on Windows
build = ":TSUpdate",
-- event = { "LazyFile", "VeryLazy" },
lazy = true,
cmd = {
"TSInstall",
"TSUninstall",
"TSUpdate",
"TSUpdateSync",
"TSInstallInfo",
"TSInstallSync",
"TSInstallFromGrammar",
},
event = { "BufRead", "VeryLazy" },
opts = function()
return {
highlight = { enable = true },
indent = { enable = true },
ensure_installed = {
"lua",
"vim",
"vimdoc",
},
incremental_selection = {
enable = true,
},
autopairs = {
enable = true,
},
}
end,
config = function(_, opts)
if type(opts.ensure_installed) == "table" then
---@type table<string, boolean>
local added = {}
opts.ensure_installed = vim.tbl_filter(function(lang)
if added[lang] then
return false
end
added[lang] = true
return true
end, opts.ensure_installed)
end
require("nvim-treesitter.configs").setup(opts)
vim.schedule(function()
require("lazy").load({ plugins = { "nvim-treesitter-textobjects" } })
end)
end,
},
{
"nvim-treesitter/nvim-treesitter-textobjects",
lazy = true,
config = function()
-- When in diff mode, we want to use the default
-- vim text objects c & C instead of the treesitter ones.
local move = require("nvim-treesitter.textobjects.move") ---@type table<string,fun(...)>
local configs = require("nvim-treesitter.configs")
for name, fn in pairs(move) do
if name:find("goto") == 1 then
move[name] = function(q, ...)
if vim.wo.diff then
local config = configs.get_module("textobjects.move")[name] ---@type table<string,string>
for key, query in pairs(config or {}) do
if q == query and key:find("[%]%[][cC]") then
vim.cmd("normal! " .. key)
return
end
end
end
return fn(q, ...)
end
end
end
end,
},
-- Automatically add closing tags for HTML and JSX
{
"windwp/nvim-ts-autotag",
lazy = true,
event = "BufRead",
opts = {},
},
{
"RRethy/vim-illuminate",
lazy = true,
event = "BufRead",
opts = {
options = {
-- providers: provider used to get references in the buffer, ordered by priority
providers = {
"lsp",
"treesitter",
"regex",
},
-- delay: delay in milliseconds
delay = 120,
-- filetype_overrides: filetype specific overrides.
-- The keys are strings to represent the filetype while the values are tables that
-- supports the same keys passed to .configure except for filetypes_denylist and filetypes_allowlist
filetype_overrides = {},
-- filetypes_denylist: filetypes to not illuminate, this overrides filetypes_allowlist
filetypes_denylist = {
"dirvish",
"fugitive",
"alpha",
"NvimTree",
"lazy",
"neogitstatus",
"Trouble",
"lir",
"Outline",
"spectre_panel",
"toggleterm",
"DressingSelect",
"TelescopePrompt",
},
-- filetypes_allowlist: filetypes to illuminate, this is overridden by filetypes_denylist
filetypes_allowlist = {},
-- modes_denylist: modes to not illuminate, this overrides modes_allowlist
modes_denylist = {},
-- modes_allowlist: modes to illuminate, this is overridden by modes_denylist
modes_allowlist = {},
-- providers_regex_syntax_denylist: syntax to not illuminate, this overrides providers_regex_syntax_allowlist
-- Only applies to the 'regex' provider
-- Use :echom synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name')
providers_regex_syntax_denylist = {},
-- providers_regex_syntax_allowlist: syntax to illuminate, this is overridden by providers_regex_syntax_denylist
-- Only applies to the 'regex' provider
-- Use :echom synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name')
providers_regex_syntax_allowlist = {},
-- under_cursor: whether or not to illuminate under the cursor
under_cursor = true,
},
},
config = function(_, opts)
require("illuminate").configure(opts)
end,
},
{
"RRethy/vim-illuminate",
lazy = true,
event = "BufRead",
opts = {
options = {
-- providers: provider used to get references in the buffer, ordered by priority
providers = {
"lsp",
"treesitter",
"regex",
},
-- delay: delay in milliseconds
delay = 120,
-- filetype_overrides: filetype specific overrides.
-- The keys are strings to represent the filetype while the values are tables that
-- supports the same keys passed to .configure except for filetypes_denylist and filetypes_allowlist
filetype_overrides = {},
-- filetypes_denylist: filetypes to not illuminate, this overrides filetypes_allowlist
filetypes_denylist = {
"dirvish",
"fugitive",
"alpha",
"NvimTree",
"lazy",
"neogitstatus",
"Trouble",
"lir",
"Outline",
"spectre_panel",
"toggleterm",
"DressingSelect",
"TelescopePrompt",
},
-- filetypes_allowlist: filetypes to illuminate, this is overridden by filetypes_denylist
filetypes_allowlist = {},
-- modes_denylist: modes to not illuminate, this overrides modes_allowlist
modes_denylist = {},
-- modes_allowlist: modes to illuminate, this is overridden by modes_denylist
modes_allowlist = {},
-- providers_regex_syntax_denylist: syntax to not illuminate, this overrides providers_regex_syntax_allowlist
-- Only applies to the 'regex' provider
-- Use :echom synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name')
providers_regex_syntax_denylist = {},
-- providers_regex_syntax_allowlist: syntax to illuminate, this is overridden by providers_regex_syntax_denylist
-- Only applies to the 'regex' provider
-- Use :echom synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name')
providers_regex_syntax_allowlist = {},
-- under_cursor: whether or not to illuminate under the cursor
under_cursor = true,
},
},
config = function(_, opts)
require("illuminate").configure(opts)
end,
},
}

View file

@ -7,12 +7,12 @@ if pcode.columnline then
opts = {},
config = function()
local icons = vim.g.pcode_icons
require("virt-column").overwrite {
require("virt-column").overwrite({
exclude = {
filetypes = { "help", "text", "markdown" },
},
char = icons.ui.LineMiddle,
}
})
-- Mengatur colum color max 80 caracter
vim.api.nvim_create_autocmd("BufWinEnter", {
pattern = "*",

View file

@ -1,21 +1,21 @@
return {
"kyazdani42/nvim-web-devicons",
lazy = true,
dependencies = "pojokcodeid/nvim-material-icon",
opts = function()
local material_icon_ok, material_icon = pcall(require, "nvim-material-icon")
if not material_icon_ok then
return
end
material_icon.setup({
override = {},
})
return {
override = material_icon.get_icons(),
override_by_filename = {},
}
end,
config = function(_, opts)
require("nvim-web-devicons").setup(opts)
end,
"kyazdani42/nvim-web-devicons",
lazy = true,
dependencies = "pojokcodeid/nvim-material-icon",
opts = function()
local material_icon_ok, material_icon = pcall(require, "nvim-material-icon")
if not material_icon_ok then
return
end
material_icon.setup({
override = {},
})
return {
override = material_icon.get_icons(),
override_by_filename = {},
}
end,
config = function(_, opts)
require("nvim-web-devicons").setup(opts)
end,
}

View file

@ -1,105 +1,105 @@
return {
"folke/which-key.nvim",
lazy = true,
keys = { "<leader>", '"', "'", "`", "c", "v" },
event = "VeryLazy",
opts = function()
local icons = vim.g.pcode_icons
return {
plugins = {
marks = false, -- shows a list of your marks on ' and `
registers = false, -- shows your registers on " in NORMAL or <C-r> in INSERT mode
spelling = {
enabled = true,
suggestions = 20,
}, -- use which-key for spelling hints
-- the presets plugin, adds help for a bunch of default keybindings in Neovim
-- No actual key bindings are created
presets = {
operators = false, -- adds help for operators like d, y, ...
motions = false, -- adds help for motions
text_objects = false, -- help for text objects triggered after entering an operator
windows = false, -- default bindings on <c-w>
nav = false, -- misc bindings to work with windows
z = false, -- bindings for folds, spelling and others prefixed with z
g = false, -- bindings for prefixed with g
},
}, -- add operators that will trigger motion and text object completion
-- to enable all native operators, set the preset / operators plugin above
-- operators = { gc = "Comments" },
key_labels = {
-- override the label used to display some keys. It doesn't effect WK in any other way.
-- For example:
-- ["<space>"] = "SPC",
-- ["<cr>"] = "RET",
-- ["<tab>"] = "TAB",
},
icons = {
breadcrumb = icons.ui.DoubleChevronRight, -- symbol used in the command line area that shows your active key combo
separator = icons.ui.BoldArrowRight, -- symbol used between a key and it's label
group = icons.ui.Plus, -- symbol prepended to a group
},
popup_mappings = {
scroll_down = "<c-d>", -- binding to scroll down inside the popup
scroll_up = "<c-u>", -- binding to scroll up inside the popup
},
window = {
border = "rounded", -- none, single, double, shadow
position = "bottom", -- bottom, top
margin = { 1, 1, 1, 1 }, -- extra window margin [top, right, bottom, left]
padding = { 2, 2, 2, 2 }, -- extra window padding [top, right, bottom, left]
winblend = 0,
},
layout = {
height = { min = 4, max = 25 }, -- min and max height of the columns
width = { min = 20, max = 50 }, -- min and max width of the columns
spacing = 3, -- spacing between columns
align = "left", -- align columns left, center or right
},
ignore_missing = true, -- enable this to hide mappings for which you didn't specify a label
hidden = { "<silent>", "<cmd>", "<Cmd>", "<CR>", "call", "lua", "^:", "^ " }, -- hide mapping boilerplate
show_help = true, -- show help message on the command line when the popup is visible
show_keys = true, -- show the currently pressed key and its label as a message in the command line
triggers = "auto", -- automatically setup triggers
-- triggers = {"<leader>"} -- or specify a list manually
triggers_blacklist = {
-- list of mode / prefixes that should never be hooked by WhichKey
-- this is mostly relevant for key maps that start with a native binding
-- most people should not need to change this
i = { "j", "k" },
v = { "j", "k" },
},
-- Disabled by default for Telescope
disable = {
buftypes = {},
filetypes = { "TelescopePrompt" },
},
}
end,
config = function(_, opts)
local opt = {
mode = "n", -- NORMAL mode
prefix = "<leader>",
buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings
silent = true, -- use `silent` when creating keymaps
noremap = true, -- use `noremap` when creating keymaps
nowait = true, -- use `nowait` when creating keymaps
}
"folke/which-key.nvim",
lazy = true,
keys = { "<leader>", '"', "'", "`", "c", "v" },
event = "VeryLazy",
opts = function()
local icons = vim.g.pcode_icons
return {
plugins = {
marks = false, -- shows a list of your marks on ' and `
registers = false, -- shows your registers on " in NORMAL or <C-r> in INSERT mode
spelling = {
enabled = true,
suggestions = 20,
}, -- use which-key for spelling hints
-- the presets plugin, adds help for a bunch of default keybindings in Neovim
-- No actual key bindings are created
presets = {
operators = false, -- adds help for operators like d, y, ...
motions = false, -- adds help for motions
text_objects = false, -- help for text objects triggered after entering an operator
windows = false, -- default bindings on <c-w>
nav = false, -- misc bindings to work with windows
z = false, -- bindings for folds, spelling and others prefixed with z
g = false, -- bindings for prefixed with g
},
}, -- add operators that will trigger motion and text object completion
-- to enable all native operators, set the preset / operators plugin above
-- operators = { gc = "Comments" },
key_labels = {
-- override the label used to display some keys. It doesn't effect WK in any other way.
-- For example:
-- ["<space>"] = "SPC",
-- ["<cr>"] = "RET",
-- ["<tab>"] = "TAB",
},
icons = {
breadcrumb = icons.ui.DoubleChevronRight, -- symbol used in the command line area that shows your active key combo
separator = icons.ui.BoldArrowRight, -- symbol used between a key and it's label
group = icons.ui.Plus, -- symbol prepended to a group
},
popup_mappings = {
scroll_down = "<c-d>", -- binding to scroll down inside the popup
scroll_up = "<c-u>", -- binding to scroll up inside the popup
},
window = {
border = "rounded", -- none, single, double, shadow
position = "bottom", -- bottom, top
margin = { 1, 1, 1, 1 }, -- extra window margin [top, right, bottom, left]
padding = { 2, 2, 2, 2 }, -- extra window padding [top, right, bottom, left]
winblend = 0,
},
layout = {
height = { min = 4, max = 25 }, -- min and max height of the columns
width = { min = 20, max = 50 }, -- min and max width of the columns
spacing = 3, -- spacing between columns
align = "left", -- align columns left, center or right
},
ignore_missing = true, -- enable this to hide mappings for which you didn't specify a label
hidden = { "<silent>", "<cmd>", "<Cmd>", "<CR>", "call", "lua", "^:", "^ " }, -- hide mapping boilerplate
show_help = true, -- show help message on the command line when the popup is visible
show_keys = true, -- show the currently pressed key and its label as a message in the command line
triggers = "auto", -- automatically setup triggers
-- triggers = {"<leader>"} -- or specify a list manually
triggers_blacklist = {
-- list of mode / prefixes that should never be hooked by WhichKey
-- this is mostly relevant for key maps that start with a native binding
-- most people should not need to change this
i = { "j", "k" },
v = { "j", "k" },
},
-- Disabled by default for Telescope
disable = {
buftypes = {},
filetypes = { "TelescopePrompt" },
},
}
end,
config = function(_, opts)
local opt = {
mode = "n", -- NORMAL mode
prefix = "<leader>",
buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings
silent = true, -- use `silent` when creating keymaps
noremap = true, -- use `noremap` when creating keymaps
nowait = true, -- use `nowait` when creating keymaps
}
local opt2 = {
mode = "v", -- NORMAL mode
prefix = "<leader>",
buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings
silent = true, -- use `silent` when creating keymaps
noremap = true, -- use `noremap` when creating keymaps
nowait = true, -- use `nowait` when creating keymaps
}
local opt2 = {
mode = "v", -- NORMAL mode
prefix = "<leader>",
buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings
silent = true, -- use `silent` when creating keymaps
noremap = true, -- use `noremap` when creating keymaps
nowait = true, -- use `nowait` when creating keymaps
}
local wkey = pcode.whichkey or {}
local which_key = require("which-key")
which_key.setup(opts)
which_key.register(require("user.utils.whichkey").mappings, opt)
which_key.register(wkey, opt)
which_key.register(require("user.utils.whichkey").mappings2, opt2)
end,
local wkey = pcode.whichkey or {}
local which_key = require("which-key")
which_key.setup(opts)
which_key.register(require("user.utils.whichkey").mappings, opt)
which_key.register(wkey, opt)
which_key.register(require("user.utils.whichkey").mappings2, opt2)
end,
}

View file

@ -1,19 +1,19 @@
return {
"gbprod/yanky.nvim",
event = "BufReadPre",
opts = {
ring = {
history_length = 50,
storage = "memory",
},
preserve_cursor_position = {
enabled = false,
},
},
config = function(_, opts)
require("yanky").setup(opts)
-- cycle through the yank history, only work after paste
vim.keymap.set("n", "[y", "<Plug>(YankyCycleForward)")
vim.keymap.set("n", "]y", "<Plug>(YankyCycleBackward)")
end,
"gbprod/yanky.nvim",
event = "BufReadPre",
opts = {
ring = {
history_length = 50,
storage = "memory",
},
preserve_cursor_position = {
enabled = false,
},
},
config = function(_, opts)
require("yanky").setup(opts)
-- cycle through the yank history, only work after paste
vim.keymap.set("n", "[y", "<Plug>(YankyCycleForward)")
vim.keymap.set("n", "]y", "<Plug>(YankyCycleBackward)")
end,
}