add: update config

This commit is contained in:
asep.komarudin 2024-04-18 07:17:54 +07:00
parent c651a8ca42
commit a81806cab8
15 changed files with 363 additions and 407 deletions

View file

@ -110,27 +110,28 @@ function _CLOSE_ALL_BUFFER()
end
end
local icons = require("user.icons")
local setup = {
plugins = {
marks = true, -- shows a list of your marks on ' and `
registers = true, -- shows your registers on " in NORMAL or <C-r> in INSERT mode
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, -- enabling this will show WhichKey when pressing z= to select spelling suggestions
suggestions = 20, -- how many suggestions should be shown in the list?
},
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, ... and registers them for motion / text object completion
motions = true, -- adds help for motions
text_objects = true, -- help for text objects triggered after entering an operator
windows = true, -- default bindings on <c-w>
nav = true, -- misc bindings to work with windows
z = true, -- bindings for folds, spelling and others prefixed with z
g = true, -- bindings for prefixed with g
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
}, -- 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 = {
@ -141,9 +142,9 @@ local setup = {
-- ["<tab>"] = "TAB",
},
icons = {
breadcrumb = "»", -- symbol used in the command line area that shows your active key combo
separator = "", -- symbol used between a key and it's label
group = "+", -- symbol prepended to a group
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
@ -151,9 +152,8 @@ local setup = {
},
window = {
border = "rounded", -- none, single, double, shadow
-- border = "none", -- none, single, double, shadow
position = "bottom", -- bottom, top
margin = { 1, 0, 1, 0 }, -- extra window margin [top, right, bottom, left]
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,
},
@ -166,6 +166,7 @@ local setup = {
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 = {
@ -175,6 +176,12 @@ local setup = {
i = { "j", "k" },
v = { "j", "k" },
},
-- disable the WhichKey popup for certain buf types and file types.
-- Disabled by default for Telescope
disable = {
buftypes = {},
filetypes = { "TelescopePrompt" },
},
}
local opts = {
@ -236,7 +243,7 @@ local mappings = {
-- ["c"] = trasparant,
["a"] = { "<cmd>Alpha<cr>", "󰕮 Alpha" },
--["e"] = { "<cmd>NvimTreeToggle<cr>", "Explorer" },
["e"] = { "<cmd>NvimTreeToggle<cr>", "󰙅 Explorer" },
["e"] = { "<cmd>NvimTreeToggle<cr><cr>", "󰙅 Explorer" },
["w"] = { "<cmd>w!<CR>", "󰆓 Save" },
["q"] = { "<cmd>q!<CR>", "󰿅 Quit" },
-- ["c"] = { "<cmd>Bdelete!<CR>", "󰅗 Close Buffer" },
@ -273,7 +280,7 @@ local mappings = {
-- },
b = {
name = " Buffers",
name = "  Buffers",
-- show all buffers with telescope
b = {
"<cmd>lua require('telescope.builtin').buffers(require('telescope.themes').get_dropdown{previewer = false})<cr>",
@ -304,7 +311,7 @@ local mappings = {
},
g = {
name = " Git",
name = " Git",
g = { "<cmd>lua _LAZYGIT_TOGGLE()<CR>", "Lazygit" },
j = { "<cmd>lua require 'gitsigns'.next_hunk()<cr>", "Next Hunk" },
k = { "<cmd>lua require 'gitsigns'.prev_hunk()<cr>", "Prev Hunk" },
@ -327,7 +334,7 @@ local mappings = {
},
l = {
name = " LSP",
name = "  LSP",
a = { "<cmd>lua vim.lsp.buf.code_action()<cr>", "Code Action" },
d = {
"<cmd>Telescope diagnostics bufnr=0<cr>",
@ -358,7 +365,7 @@ local mappings = {
},
},
s = {
name = " Search",
name = "  Search",
b = { "<cmd>Telescope git_branches<cr>", "Checkout branch" },
c = { "<cmd>Telescope colorscheme<cr>", "Colorscheme" },
h = { "<cmd>Telescope help_tags<cr>", "Find Help" },
@ -370,7 +377,7 @@ local mappings = {
},
t = {
name = " Terminal",
name = "  Terminal",
-- l = { "<cmd>lua _LIVE_SERVER()<cr>", "Live Server" },
l = { "<cmd>terminal live-server<cr>", "Live Server" },
P = { "<cmd>lua _NEWTAB_TOGGLE()<cr>", "Power Shell" },
@ -392,7 +399,7 @@ local mappings = {
j = { "<cmd>lua _SET_TAB_TITLE()<cr>", "Set Tab Title" },
},
r = {
name = " Run",
name = "  Run",
l = { "<cmd>edit term://live-server<cr>", "Live Server" },
s = {
'<cmd>autocmd bufwritepost [^_]*.sass,[^_]*.scss silent exec "!sass %:p %:r.css"<CR>',
@ -544,7 +551,7 @@ local mappings = {
-- },
d = debug_key,
z = {
name = "󱑠 Plugins(Lazy)",
name = " 󱑠 Plugins(Lazy)",
i = { "<cmd>Lazy install<cr>", "Install" },
s = { "<cmd>Lazy sync<cr>", "Sync" },
S = { "<cmd>Lazy clear<cr>", "Status" },