mirror of
https://github.com/pojokcodeid/nvim-lazy.git
synced 2025-06-21 00:25:47 +02:00
enc: lua format custem
This commit is contained in:
parent
65857a4226
commit
384c0b5768
68 changed files with 1450 additions and 1450 deletions
|
@ -1,265 +1,265 @@
|
|||
function Active_whichkey()
|
||||
VSCodeNotify("whichkey.show")
|
||||
VSCodeNotify("whichkey.show")
|
||||
end
|
||||
|
||||
function Top_screen()
|
||||
Cmd("call <SNR>3_reveal('top', 0)")
|
||||
Cmd("call <SNR>3_reveal('top', 0)")
|
||||
end
|
||||
|
||||
function Bottom_screen()
|
||||
Cmd("call <SNR>3_reveal('bottom', 0)")
|
||||
Cmd("call <SNR>3_reveal('bottom', 0)")
|
||||
end
|
||||
|
||||
function Move_to_top_screen()
|
||||
Cmd("call <SNR>3_moveCursor('top')")
|
||||
Cmd("call <SNR>3_moveCursor('top')")
|
||||
end
|
||||
|
||||
function Move_to_bottom_screen()
|
||||
Cmd("call <SNR>3_moveCursor('bottom')")
|
||||
Cmd("call <SNR>3_moveCursor('bottom')")
|
||||
end
|
||||
|
||||
function Scroll_line_down()
|
||||
VSCodeCall("scrollLineDown")
|
||||
VSCodeCall("scrollLineDown")
|
||||
end
|
||||
|
||||
function Scroll_line_up()
|
||||
VSCodeCall("scrollLineUp")
|
||||
VSCodeCall("scrollLineUp")
|
||||
end
|
||||
|
||||
function Vscode_ctrl_d()
|
||||
VSCodeNotify("vscode-neovim.ctrl-d")
|
||||
VSCodeNotify("vscode-neovim.ctrl-d")
|
||||
end
|
||||
|
||||
function Vscode_ctrl_u()
|
||||
VSCodeNotify("vscode-neovim.ctrl-u")
|
||||
VSCodeNotify("vscode-neovim.ctrl-u")
|
||||
end
|
||||
|
||||
function Move_to_bottom_screen__center_screen()
|
||||
Move_to_bottom_screen()
|
||||
Center_screen()
|
||||
Move_to_bottom_screen()
|
||||
Center_screen()
|
||||
end
|
||||
|
||||
function Move_to_top_screen__center_screen()
|
||||
Move_to_top_screen()
|
||||
Center_screen()
|
||||
Move_to_top_screen()
|
||||
Center_screen()
|
||||
end
|
||||
|
||||
function Trim_trailing_whitespace()
|
||||
VSCodeCall("editor.action.trimTrailingWhitespace")
|
||||
VSCodeCall("editor.action.trimTrailingWhitespace")
|
||||
end
|
||||
|
||||
function Save()
|
||||
VSCodeCall("workbench.action.files.save")
|
||||
VSCodeCall("workbench.action.files.save")
|
||||
end
|
||||
|
||||
function Save_no_format()
|
||||
VSCodeCall("workbench.action.files.saveWithoutFormatting")
|
||||
VSCodeCall("workbench.action.files.saveWithoutFormatting")
|
||||
end
|
||||
|
||||
function Trim__save__no_format()
|
||||
Trim_trailing_whitespace()
|
||||
Save_no_format()
|
||||
Trim_trailing_whitespace()
|
||||
Save_no_format()
|
||||
end
|
||||
|
||||
function Trim__save__no_highlight()
|
||||
Trim_trailing_whitespace()
|
||||
Save()
|
||||
Remove_highlighting()
|
||||
Trim_trailing_whitespace()
|
||||
Save()
|
||||
Remove_highlighting()
|
||||
end
|
||||
|
||||
function Format()
|
||||
VSCodeCall("editor.action.formatDocument")
|
||||
print("formatted!")
|
||||
VSCodeCall("editor.action.formatDocument")
|
||||
print("formatted!")
|
||||
end
|
||||
|
||||
function Trim__save__format()
|
||||
Trim_trailing_whitespace()
|
||||
Format()
|
||||
Save()
|
||||
Trim_trailing_whitespace()
|
||||
Format()
|
||||
Save()
|
||||
end
|
||||
|
||||
function Reveal_definition_aside()
|
||||
VSCodeNotify("editor.action.revealDefinitionAside")
|
||||
VSCodeNotify("editor.action.revealDefinitionAside")
|
||||
end
|
||||
|
||||
function Go_to_implementation()
|
||||
VSCodeNotify("editor.action.goToImplementation")
|
||||
VSCodeNotify("editor.action.goToImplementation")
|
||||
end
|
||||
|
||||
function Go_to_reference()
|
||||
VSCodeNotify("editor.action.goToReferences")
|
||||
VSCodeNotify("editor.action.goToReferences")
|
||||
end
|
||||
|
||||
function Rename_symbol()
|
||||
VSCodeNotify("editor.action.rename")
|
||||
VSCodeNotify("editor.action.rename")
|
||||
end
|
||||
|
||||
function Outdent()
|
||||
---@diagnostic disable-next-line: unused-local
|
||||
for i = 1, vim.v.count1 do
|
||||
VSCodeNotify("editor.action.outdentLines")
|
||||
end
|
||||
---@diagnostic disable-next-line: unused-local
|
||||
for i = 1, vim.v.count1 do
|
||||
VSCodeNotify("editor.action.outdentLines")
|
||||
end
|
||||
end
|
||||
|
||||
function Indent()
|
||||
---@diagnostic disable-next-line: unused-local
|
||||
for i = 1, vim.v.count1 do
|
||||
VSCodeNotify("editor.action.indentLines")
|
||||
end
|
||||
---@diagnostic disable-next-line: unused-local
|
||||
for i = 1, vim.v.count1 do
|
||||
VSCodeNotify("editor.action.indentLines")
|
||||
end
|
||||
end
|
||||
|
||||
function Outdent_vis()
|
||||
VSCodeNotify("editor.action.outdentLines", false)
|
||||
VSCodeNotify("editor.action.outdentLines", false)
|
||||
end
|
||||
|
||||
function Indent_vis()
|
||||
VSCodeNotify("editor.action.indentLines", false)
|
||||
VSCodeNotify("editor.action.indentLines", false)
|
||||
end
|
||||
|
||||
function Comment()
|
||||
VSCodeNotify("editor.action.commentLine")
|
||||
VSCodeNotify("editor.action.commentLine")
|
||||
end
|
||||
|
||||
function Convert_to_spaces()
|
||||
VSCodeNotify("editor.action.indentationToSpaces")
|
||||
VSCodeNotify("editor.action.indentationToSpaces")
|
||||
end
|
||||
|
||||
function Convert_to_tabs()
|
||||
VSCodeNotify("editor.action.indentationToTabs")
|
||||
VSCodeNotify("editor.action.indentationToTabs")
|
||||
end
|
||||
|
||||
function Indent_with_spaces()
|
||||
VSCodeNotify("editor.action.indentUsingSpaces")
|
||||
VSCodeNotify("editor.action.indentUsingSpaces")
|
||||
end
|
||||
|
||||
function Indent_with_tabs()
|
||||
VSCodeNotify("editor.action.indentUsingTabs")
|
||||
VSCodeNotify("editor.action.indentUsingTabs")
|
||||
end
|
||||
|
||||
function CloseEditor()
|
||||
VSCodeNotify("workbench.action.closeActiveEditor")
|
||||
VSCodeNotify("workbench.action.closeActiveEditor")
|
||||
end
|
||||
|
||||
function UndoCloseEditor()
|
||||
VSCodeNotify("workbench.action.reopenClosedEditor")
|
||||
VSCodeNotify("workbench.action.reopenClosedEditor")
|
||||
end
|
||||
|
||||
function Git_stage_file()
|
||||
Trim_trailing_whitespace()
|
||||
Save()
|
||||
VSCodeNotify("git.stage")
|
||||
Trim_trailing_whitespace()
|
||||
Save()
|
||||
VSCodeNotify("git.stage")
|
||||
end
|
||||
|
||||
function Git_unstage_file()
|
||||
Save()
|
||||
VSCodeNotify("git.unstage")
|
||||
Save()
|
||||
VSCodeNotify("git.unstage")
|
||||
end
|
||||
|
||||
function Git_revert_change()
|
||||
VSCodeNotify("git.revertSelectedRanges")
|
||||
VSCodeNotify("git.revertSelectedRanges")
|
||||
end
|
||||
|
||||
function Git_stage_change()
|
||||
VSCodeNotify("git.stageSelectedRanges")
|
||||
VSCodeNotify("git.stageSelectedRanges")
|
||||
end
|
||||
|
||||
function Git_unstage_change()
|
||||
VSCodeNotify("git.unstageSelectedRanges")
|
||||
VSCodeNotify("git.unstageSelectedRanges")
|
||||
end
|
||||
|
||||
function Git_open_changes()
|
||||
VSCodeNotify("git.openChange")
|
||||
VSCodeNotify("git.openChange")
|
||||
end
|
||||
|
||||
function Git_open_all_changes()
|
||||
VSCodeNotify("git.openAllChanges")
|
||||
VSCodeNotify("git.openAllChanges")
|
||||
end
|
||||
|
||||
function Accept_merge_both()
|
||||
VSCodeNotify("merge-conflict.accept.both")
|
||||
VSCodeNotify("merge-conflict.accept.both")
|
||||
end
|
||||
|
||||
function Accept_merge_all_both()
|
||||
VSCodeNotify("merge-conflict.accept.all-both")
|
||||
VSCodeNotify("merge-conflict.accept.all-both")
|
||||
end
|
||||
|
||||
function Accept_merge_current()
|
||||
VSCodeNotify("merge-conflict.accept.current")
|
||||
VSCodeNotify("merge-conflict.accept.current")
|
||||
end
|
||||
|
||||
function Accept_merge_all_current()
|
||||
VSCodeNotify("merge-conflict.accept.all-current")
|
||||
VSCodeNotify("merge-conflict.accept.all-current")
|
||||
end
|
||||
|
||||
function Accept_merge_incoming()
|
||||
VSCodeNotify("merge-conflict.accept.incoming")
|
||||
VSCodeNotify("merge-conflict.accept.incoming")
|
||||
end
|
||||
|
||||
function Accept_merge_all_incoming()
|
||||
VSCodeNotify("merge-conflict.accept.all-incoming")
|
||||
VSCodeNotify("merge-conflict.accept.all-incoming")
|
||||
end
|
||||
|
||||
function Accept_merge_selection()
|
||||
VSCodeNotify("merge-conflict.accept.selection")
|
||||
VSCodeNotify("merge-conflict.accept.selection")
|
||||
end
|
||||
|
||||
function Codesnap()
|
||||
VSCodeNotify("codesnap.start", true)
|
||||
VSCodeNotify("codesnap.start", true)
|
||||
end
|
||||
|
||||
function Comment_vis()
|
||||
VSCodeNotify("editor.action.commentLine", false)
|
||||
VSCodeNotify("editor.action.commentLine", false)
|
||||
end
|
||||
|
||||
function Toggle_breakpoint()
|
||||
VSCodeNotify("editor.debug.action.toggleBreakpoint")
|
||||
VSCodeNotify("editor.debug.action.toggleBreakpoint")
|
||||
end
|
||||
|
||||
function Copy_path()
|
||||
VSCodeNotify("copyFilePath")
|
||||
VSCodeNotify("copyFilePath")
|
||||
end
|
||||
|
||||
function Copy_relative_path()
|
||||
VSCodeNotify("copyRelativeFilePath")
|
||||
VSCodeNotify("copyRelativeFilePath")
|
||||
end
|
||||
|
||||
function Active_whichkey()
|
||||
VSCodeNotify("whichkey.show")
|
||||
VSCodeNotify("whichkey.show")
|
||||
end
|
||||
|
||||
function Navigation_down()
|
||||
VSCodeNotify("workbench.action.navigateDown")
|
||||
VSCodeNotify("workbench.action.navigateDown")
|
||||
end
|
||||
|
||||
function Navigation_up()
|
||||
VSCodeNotify("workbench.action.navigateUp")
|
||||
VSCodeNotify("workbench.action.navigateUp")
|
||||
end
|
||||
|
||||
function Navigation_left()
|
||||
VSCodeNotify("workbench.action.navigateLeft")
|
||||
VSCodeNotify("workbench.action.navigateLeft")
|
||||
end
|
||||
|
||||
function Navigation_right()
|
||||
VSCodeNotify("workbench.action.navigateRight")
|
||||
VSCodeNotify("workbench.action.navigateRight")
|
||||
end
|
||||
|
||||
function Select_all()
|
||||
VSCodeNotify("editor.action.selectAll")
|
||||
VSCodeNotify("editor.action.selectAll")
|
||||
end
|
||||
|
||||
function Copy_clipboard()
|
||||
VSCodeNotify("editor.action.clipboardCopyAction")
|
||||
VSCodeNotify("editor.action.clipboardCopyAction")
|
||||
end
|
||||
|
||||
function Paste_clipboard()
|
||||
VSCodeNotify("editor.action.clipboardPasteAction")
|
||||
VSCodeNotify("editor.action.clipboardPasteAction")
|
||||
end
|
||||
|
||||
function Save()
|
||||
VSCodeNotify("workbench.action.files.save")
|
||||
VSCodeNotify("workbench.action.files.saveAll")
|
||||
VSCodeNotify("workbench.action.files.save")
|
||||
VSCodeNotify("workbench.action.files.saveAll")
|
||||
end
|
||||
|
||||
function Close()
|
||||
VSCodeNotify("workbench.action.closeActiveEditor")
|
||||
VSCodeNotify("workbench.action.closeActiveEditor")
|
||||
end
|
||||
|
|
|
@ -47,7 +47,7 @@ Map({ "n", "v" }, "zj", Git_stage_change)
|
|||
-- Map({ "n", "v" }, "zb", Vscode_ctrl_u)
|
||||
|
||||
vim.api.nvim_exec(
|
||||
[[
|
||||
[[
|
||||
" THEME CHANGER
|
||||
function! SetCursorLineNrColorInsert(mode)
|
||||
" Insert mode: blue
|
||||
|
@ -70,5 +70,5 @@ vim.api.nvim_exec(
|
|||
autocmd ModeChanged [vV\x16]*:* call VSCodeNotify('nvim-theme.normal')
|
||||
augroup END
|
||||
]],
|
||||
false
|
||||
false
|
||||
)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim"
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
-- bootstrap lazy.nvim
|
||||
-- stylua: ignore
|
||||
|
@ -15,8 +15,8 @@ local icons = require("user.icons").ui
|
|||
vim.opt.rtp:prepend(vim.env.LAZY or lazypath)
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = " "
|
||||
vim.diagnostic.config { virtual_lines = false }
|
||||
require("lazy").setup {
|
||||
vim.diagnostic.config({ virtual_lines = false })
|
||||
require("lazy").setup({
|
||||
spec = {
|
||||
{ import = "plugins.themes" },
|
||||
{ import = "plugins" },
|
||||
|
@ -57,4 +57,4 @@ require("lazy").setup {
|
|||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
})
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
local transparent_mode = pcode.transparent_mode or 0
|
||||
if transparent_mode ~= nil then
|
||||
if transparent_mode == 1 then
|
||||
vim.cmd "TransparentDisable"
|
||||
vim.cmd "TransparentEnable"
|
||||
vim.cmd("TransparentDisable")
|
||||
vim.cmd("TransparentEnable")
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -12,7 +12,7 @@ local _get_folder_name = function()
|
|||
return " " .. str:lower():gsub("^%l", string.upper) .. " "
|
||||
end
|
||||
|
||||
local term_program = vim.fn.getenv "TERM_PROGRAM"
|
||||
local term_program = vim.fn.getenv("TERM_PROGRAM")
|
||||
if term_program == "WezTerm" then
|
||||
-- vim.cmd('silent !wezterm cli set-tab-title "' .. _get_folder_name() .. '"')
|
||||
-- create autocmd on insertEnter
|
||||
|
|
|
@ -3,11 +3,11 @@
|
|||
-- 2. Ubah dashboard sesuai keinginan dan kebutuhan
|
||||
|
||||
vim.g.pcode_header1 = {
|
||||
[[ _ __ __ ]],
|
||||
[[ ___ ___ (____ / /__ _______ ___/ ___ ]],
|
||||
[[ / _ / _ \ / / _ \/ '_/ / __/ _ / _ / -_) ]],
|
||||
[[ / .__\_____/ /\___/_/\_\ \__/\___\_,_/\__/ ]],
|
||||
[[ /_/ |___/ ]],
|
||||
[[ _ __ __ ]],
|
||||
[[ ___ ___ (____ / /__ _______ ___/ ___ ]],
|
||||
[[ / _ / _ \ / / _ \/ '_/ / __/ _ / _ / -_) ]],
|
||||
[[ / .__\_____/ /\___/_/\_\ \__/\___\_,_/\__/ ]],
|
||||
[[ /_/ |___/ ]],
|
||||
}
|
||||
|
||||
-- vim.g.pcode_header2 = {
|
||||
|
|
|
@ -2,10 +2,10 @@ local null_ls = require("null-ls")
|
|||
local formatting = null_ls.builtins.formatting
|
||||
local diagnostics = null_ls.builtins.diagnostics
|
||||
local m = {
|
||||
sources = {
|
||||
formatting.stylua, -- tambahkan di bawah sini
|
||||
--diagnostics.flake8, -- tambahkan di bawah sini
|
||||
--formatting.blade_formatter.with({ filetypes = { "blade", "php" } }),
|
||||
},
|
||||
sources = {
|
||||
formatting.stylua, -- tambahkan di bawah sini
|
||||
--diagnostics.flake8, -- tambahkan di bawah sini
|
||||
--formatting.blade_formatter.with({ filetypes = { "blade", "php" } }),
|
||||
},
|
||||
}
|
||||
return m
|
||||
|
|
|
@ -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 {}
|
||||
|
|
|
@ -5,7 +5,7 @@ return {
|
|||
lazy = true,
|
||||
event = "VimEnter",
|
||||
config = function()
|
||||
require "user.alpha"
|
||||
require("user.alpha")
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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,
|
||||
},
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
}
|
||||
|
|
|
@ -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
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
},
|
||||
}
|
||||
|
|
|
@ -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 = {
|
||||
|
|
|
@ -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,
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
}
|
||||
|
|
|
@ -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",
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
},
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
},
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -3,6 +3,6 @@ return {
|
|||
event = "VeryLazy",
|
||||
lazy = true,
|
||||
config = function()
|
||||
require("neoscroll").setup {}
|
||||
require("neoscroll").setup({})
|
||||
end,
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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 = {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
return {
|
||||
"nvim-lua/plenary.nvim",
|
||||
lazy = true,
|
||||
"nvim-lua/plenary.nvim",
|
||||
lazy = true,
|
||||
}
|
||||
|
|
|
@ -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"],
|
||||
|
|
|
@ -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,
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
}
|
||||
|
|
|
@ -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" } },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
@ -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 = {
|
||||
|
|
|
@ -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,
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
},
|
||||
|
|
|
@ -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,
|
||||
},
|
||||
}
|
||||
|
|
|
@ -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 = "*",
|
||||
|
|
|
@ -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,
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
}
|
||||
|
|
|
@ -1,26 +1,26 @@
|
|||
local model = vim.g.pcode_model
|
||||
if model ~= nil then
|
||||
if model == 1 then
|
||||
require("user.startify")
|
||||
else
|
||||
require("user.dashboard")
|
||||
end
|
||||
if model == 1 then
|
||||
require("user.startify")
|
||||
else
|
||||
require("user.dashboard")
|
||||
end
|
||||
else
|
||||
require("user.startify")
|
||||
require("user.startify")
|
||||
end
|
||||
|
||||
-- Disable statusline in dashboard
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = "alpha",
|
||||
callback = function()
|
||||
-- store current statusline value and use that
|
||||
local old_laststatus = vim.opt.laststatus
|
||||
vim.api.nvim_create_autocmd("BufUnload", {
|
||||
buffer = 0,
|
||||
callback = function()
|
||||
vim.opt.laststatus = old_laststatus
|
||||
end,
|
||||
})
|
||||
vim.opt.laststatus = 0
|
||||
end,
|
||||
pattern = "alpha",
|
||||
callback = function()
|
||||
-- store current statusline value and use that
|
||||
local old_laststatus = vim.opt.laststatus
|
||||
vim.api.nvim_create_autocmd("BufUnload", {
|
||||
buffer = 0,
|
||||
callback = function()
|
||||
vim.opt.laststatus = old_laststatus
|
||||
end,
|
||||
})
|
||||
vim.opt.laststatus = 0
|
||||
end,
|
||||
})
|
||||
|
|
|
@ -1,50 +1,50 @@
|
|||
local status_ok, navic = pcall(require, "nvim-navic")
|
||||
if not status_ok then
|
||||
return
|
||||
return
|
||||
end
|
||||
|
||||
local ico = vim.g.pcode_icons
|
||||
local icons = ico.kind
|
||||
|
||||
navic.setup({
|
||||
icons = {
|
||||
Array = icons.Array .. " ",
|
||||
Boolean = icons.Boolean,
|
||||
Class = icons.Class .. " ",
|
||||
Color = icons.Color .. " ",
|
||||
Constant = icons.Constant .. " ",
|
||||
Constructor = icons.Constructor .. " ",
|
||||
Enum = icons.Enum .. " ",
|
||||
EnumMember = icons.EnumMember .. " ",
|
||||
Event = icons.Event .. " ",
|
||||
Field = icons.Field .. " ",
|
||||
File = icons.File .. " ",
|
||||
Folder = icons.Folder .. " ",
|
||||
Function = icons.Function .. " ",
|
||||
Interface = icons.Interface .. " ",
|
||||
Key = icons.Key .. " ",
|
||||
Keyword = icons.Keyword .. " ",
|
||||
Method = icons.Method .. " ",
|
||||
Module = icons.Module .. " ",
|
||||
Namespace = icons.Namespace .. " ",
|
||||
Null = icons.Null .. " ",
|
||||
Number = icons.Number .. " ",
|
||||
Object = icons.Object .. " ",
|
||||
Operator = icons.Operator .. " ",
|
||||
Package = icons.Package .. " ",
|
||||
Property = icons.Property .. " ",
|
||||
Reference = icons.Reference .. " ",
|
||||
Snippet = icons.Snippet .. " ",
|
||||
String = icons.String .. " ",
|
||||
Struct = icons.Struct .. " ",
|
||||
Text = icons.Text .. " ",
|
||||
TypeParameter = icons.TypeParameter .. " ",
|
||||
Unit = icons.Unit .. " ",
|
||||
Value = icons.Value .. " ",
|
||||
Variable = icons.Variable .. " ",
|
||||
},
|
||||
highlight = true,
|
||||
separator = " " .. ico.ui.ChevronRight .. " ",
|
||||
depth_limit = 0,
|
||||
depth_limit_indicator = "..",
|
||||
icons = {
|
||||
Array = icons.Array .. " ",
|
||||
Boolean = icons.Boolean,
|
||||
Class = icons.Class .. " ",
|
||||
Color = icons.Color .. " ",
|
||||
Constant = icons.Constant .. " ",
|
||||
Constructor = icons.Constructor .. " ",
|
||||
Enum = icons.Enum .. " ",
|
||||
EnumMember = icons.EnumMember .. " ",
|
||||
Event = icons.Event .. " ",
|
||||
Field = icons.Field .. " ",
|
||||
File = icons.File .. " ",
|
||||
Folder = icons.Folder .. " ",
|
||||
Function = icons.Function .. " ",
|
||||
Interface = icons.Interface .. " ",
|
||||
Key = icons.Key .. " ",
|
||||
Keyword = icons.Keyword .. " ",
|
||||
Method = icons.Method .. " ",
|
||||
Module = icons.Module .. " ",
|
||||
Namespace = icons.Namespace .. " ",
|
||||
Null = icons.Null .. " ",
|
||||
Number = icons.Number .. " ",
|
||||
Object = icons.Object .. " ",
|
||||
Operator = icons.Operator .. " ",
|
||||
Package = icons.Package .. " ",
|
||||
Property = icons.Property .. " ",
|
||||
Reference = icons.Reference .. " ",
|
||||
Snippet = icons.Snippet .. " ",
|
||||
String = icons.String .. " ",
|
||||
Struct = icons.Struct .. " ",
|
||||
Text = icons.Text .. " ",
|
||||
TypeParameter = icons.TypeParameter .. " ",
|
||||
Unit = icons.Unit .. " ",
|
||||
Value = icons.Value .. " ",
|
||||
Variable = icons.Variable .. " ",
|
||||
},
|
||||
highlight = true,
|
||||
separator = " " .. ico.ui.ChevronRight .. " ",
|
||||
depth_limit = 0,
|
||||
depth_limit_indicator = "..",
|
||||
})
|
||||
|
|
|
@ -1,54 +1,54 @@
|
|||
local transparent = false
|
||||
local data_exists, custom_ui = pcall(require, "custom.ui")
|
||||
if not data_exists then
|
||||
return
|
||||
return
|
||||
end
|
||||
local transparent_mode = custom_ui.transparent_mode
|
||||
if transparent_mode ~= nil then
|
||||
if transparent_mode == 1 then
|
||||
transparent = true
|
||||
end
|
||||
if transparent_mode == 1 then
|
||||
transparent = true
|
||||
end
|
||||
end
|
||||
|
||||
require("catppuccin").setup({
|
||||
flavour = "macchiato", -- latte, frappe, macchiato, mocha
|
||||
background = { -- :h background
|
||||
light = "latte",
|
||||
dark = "macchiato",
|
||||
},
|
||||
transparent_background = transparent,
|
||||
show_end_of_buffer = false, -- show the '~' characters after the end of buffers
|
||||
term_colors = false,
|
||||
dim_inactive = {
|
||||
enabled = false,
|
||||
shade = "dark",
|
||||
percentage = 0.15,
|
||||
},
|
||||
no_italic = false, -- Force no italic
|
||||
no_bold = false, -- Force no bold
|
||||
styles = {
|
||||
comments = { "italic" },
|
||||
conditionals = { "italic" },
|
||||
loops = {},
|
||||
functions = {},
|
||||
keywords = {},
|
||||
strings = {},
|
||||
variables = {},
|
||||
numbers = {},
|
||||
booleans = {},
|
||||
properties = {},
|
||||
types = {},
|
||||
operators = {},
|
||||
},
|
||||
color_overrides = {},
|
||||
custom_highlights = {},
|
||||
integrations = {
|
||||
cmp = true,
|
||||
gitsigns = true,
|
||||
nvimtree = true,
|
||||
telescope = true,
|
||||
notify = false,
|
||||
mini = false,
|
||||
-- For more plugins integrations please scroll down (https://github.com/catppuccin/nvim#integrations)
|
||||
},
|
||||
flavour = "macchiato", -- latte, frappe, macchiato, mocha
|
||||
background = { -- :h background
|
||||
light = "latte",
|
||||
dark = "macchiato",
|
||||
},
|
||||
transparent_background = transparent,
|
||||
show_end_of_buffer = false, -- show the '~' characters after the end of buffers
|
||||
term_colors = false,
|
||||
dim_inactive = {
|
||||
enabled = false,
|
||||
shade = "dark",
|
||||
percentage = 0.15,
|
||||
},
|
||||
no_italic = false, -- Force no italic
|
||||
no_bold = false, -- Force no bold
|
||||
styles = {
|
||||
comments = { "italic" },
|
||||
conditionals = { "italic" },
|
||||
loops = {},
|
||||
functions = {},
|
||||
keywords = {},
|
||||
strings = {},
|
||||
variables = {},
|
||||
numbers = {},
|
||||
booleans = {},
|
||||
properties = {},
|
||||
types = {},
|
||||
operators = {},
|
||||
},
|
||||
color_overrides = {},
|
||||
custom_highlights = {},
|
||||
integrations = {
|
||||
cmp = true,
|
||||
gitsigns = true,
|
||||
nvimtree = true,
|
||||
telescope = true,
|
||||
notify = false,
|
||||
mini = false,
|
||||
-- For more plugins integrations please scroll down (https://github.com/catppuccin/nvim#integrations)
|
||||
},
|
||||
})
|
||||
|
|
|
@ -5,7 +5,7 @@ end
|
|||
local WELCOME_MESSAGE = [[
|
||||
Welcome to ChatGPT.
|
||||
]]
|
||||
chatgpt.setup {
|
||||
chatgpt.setup({
|
||||
welcome_message = WELCOME_MESSAGE, -- set to "" if you don't like the fancy godot robot
|
||||
loading_text = "loading",
|
||||
question_sign = "", -- you can use emoji if you want e.g. 🙂
|
||||
|
@ -73,4 +73,4 @@ chatgpt.setup {
|
|||
new_session = "<C-n>",
|
||||
cycle_windows = "<Tab>",
|
||||
},
|
||||
}
|
||||
})
|
||||
|
|
|
@ -8,5 +8,5 @@ end
|
|||
|
||||
local ok, _ = pcall(vim.cmd.colorscheme, colorscheme)
|
||||
if not ok then
|
||||
require "notify"("Colorscheme '" .. colorscheme .. "' not found!", "error")
|
||||
require("notify")("Colorscheme '" .. colorscheme .. "' not found!", "error")
|
||||
end
|
||||
|
|
|
@ -2,80 +2,80 @@
|
|||
|
||||
local dap_status_ok, dap = pcall(require, "dap")
|
||||
if not dap_status_ok then
|
||||
return
|
||||
return
|
||||
end
|
||||
|
||||
local dap_ui_status_ok, dapui = pcall(require, "dapui")
|
||||
if not dap_ui_status_ok then
|
||||
return
|
||||
return
|
||||
end
|
||||
|
||||
-- dapui.setup()
|
||||
dapui.setup({
|
||||
icons = { expanded = "▾", collapsed = "▸" },
|
||||
mappings = {
|
||||
-- Use a table to apply multiple mappings
|
||||
expand = { "<CR>", "<2-LeftMouse>" },
|
||||
open = "o",
|
||||
remove = "d",
|
||||
edit = "e",
|
||||
repl = "r",
|
||||
toggle = "t",
|
||||
},
|
||||
-- Expand lines larger than the window
|
||||
-- Requires >= 0.7
|
||||
expand_lines = vim.fn.has("nvim-0.7"),
|
||||
-- Layouts define sections of the screen to place windows.
|
||||
-- The position can be "left", "right", "top" or "bottom".
|
||||
-- The size specifies the height/width depending on position. It can be an Int
|
||||
-- or a Float. Integer specifies height/width directly (i.e. 20 lines/columns) while
|
||||
-- Float value specifies percentage (i.e. 0.3 - 30% of available lines/columns)
|
||||
-- Elements are the elements shown in the layout (in order).
|
||||
-- Layouts are opened in order so that earlier layouts take priority in window sizing.
|
||||
layouts = {
|
||||
{
|
||||
elements = {
|
||||
-- Elements can be strings or table with id and size keys.
|
||||
{ id = "scopes", size = 0.25 },
|
||||
"breakpoints",
|
||||
-- "stacks",
|
||||
-- "watches",
|
||||
},
|
||||
size = 40, -- 40 columns
|
||||
position = "right",
|
||||
},
|
||||
{
|
||||
elements = {
|
||||
"repl",
|
||||
"console",
|
||||
},
|
||||
size = 0.25, -- 25% of total lines
|
||||
position = "bottom",
|
||||
},
|
||||
},
|
||||
floating = {
|
||||
max_height = nil, -- These can be integers or a float between 0 and 1.
|
||||
max_width = nil, -- Floats will be treated as percentage of your screen.
|
||||
border = "single", -- Border style. Can be "single", "double" or "rounded"
|
||||
mappings = {
|
||||
close = { "q", "<Esc>" },
|
||||
},
|
||||
},
|
||||
windows = { indent = 1 },
|
||||
render = {
|
||||
max_type_length = nil, -- Can be integer or nil.
|
||||
},
|
||||
icons = { expanded = "▾", collapsed = "▸" },
|
||||
mappings = {
|
||||
-- Use a table to apply multiple mappings
|
||||
expand = { "<CR>", "<2-LeftMouse>" },
|
||||
open = "o",
|
||||
remove = "d",
|
||||
edit = "e",
|
||||
repl = "r",
|
||||
toggle = "t",
|
||||
},
|
||||
-- Expand lines larger than the window
|
||||
-- Requires >= 0.7
|
||||
expand_lines = vim.fn.has("nvim-0.7"),
|
||||
-- Layouts define sections of the screen to place windows.
|
||||
-- The position can be "left", "right", "top" or "bottom".
|
||||
-- The size specifies the height/width depending on position. It can be an Int
|
||||
-- or a Float. Integer specifies height/width directly (i.e. 20 lines/columns) while
|
||||
-- Float value specifies percentage (i.e. 0.3 - 30% of available lines/columns)
|
||||
-- Elements are the elements shown in the layout (in order).
|
||||
-- Layouts are opened in order so that earlier layouts take priority in window sizing.
|
||||
layouts = {
|
||||
{
|
||||
elements = {
|
||||
-- Elements can be strings or table with id and size keys.
|
||||
{ id = "scopes", size = 0.25 },
|
||||
"breakpoints",
|
||||
-- "stacks",
|
||||
-- "watches",
|
||||
},
|
||||
size = 40, -- 40 columns
|
||||
position = "right",
|
||||
},
|
||||
{
|
||||
elements = {
|
||||
"repl",
|
||||
"console",
|
||||
},
|
||||
size = 0.25, -- 25% of total lines
|
||||
position = "bottom",
|
||||
},
|
||||
},
|
||||
floating = {
|
||||
max_height = nil, -- These can be integers or a float between 0 and 1.
|
||||
max_width = nil, -- Floats will be treated as percentage of your screen.
|
||||
border = "single", -- Border style. Can be "single", "double" or "rounded"
|
||||
mappings = {
|
||||
close = { "q", "<Esc>" },
|
||||
},
|
||||
},
|
||||
windows = { indent = 1 },
|
||||
render = {
|
||||
max_type_length = nil, -- Can be integer or nil.
|
||||
},
|
||||
})
|
||||
|
||||
dap.listeners.after.event_initialized["dapui_config"] = function()
|
||||
-- dapui.setup()
|
||||
dapui.open()
|
||||
-- dapui.setup()
|
||||
dapui.open()
|
||||
end
|
||||
dap.listeners.before.event_terminated["dapui_config"] = function()
|
||||
dapui.close()
|
||||
dapui.close()
|
||||
end
|
||||
dap.listeners.before.event_exited["dapui_config"] = function()
|
||||
dapui.close()
|
||||
dapui.close()
|
||||
end
|
||||
-- vim.fn.sign_define("DapBreakpoint", { text = "🟥", texthl = "", linehl = "", numhl = "" })
|
||||
vim.fn.sign_define("DapBreakpoint", { text = "", texthl = "DiagnosticSignError", linehl = "", numhl = "" })
|
||||
|
|
|
@ -19,7 +19,7 @@ if data_board ~= nil then
|
|||
board = data_board
|
||||
end
|
||||
|
||||
local dashboard = require "alpha.themes.dashboard"
|
||||
local dashboard = require("alpha.themes.dashboard")
|
||||
dashboard.section.header.val = board
|
||||
dashboard.section.buttons.val = {
|
||||
dashboard.button("F", " Find file", ":Telescope find_files <CR>"),
|
||||
|
@ -62,8 +62,8 @@ vim.api.nvim_create_autocmd("User", {
|
|||
vim.api.nvim_create_autocmd({ "User" }, {
|
||||
pattern = { "AlphaReady" },
|
||||
callback = function()
|
||||
vim.cmd [[
|
||||
vim.cmd([[
|
||||
set laststatus=0 | autocmd BufUnload <buffer> set laststatus=3
|
||||
]]
|
||||
]])
|
||||
end,
|
||||
})
|
||||
|
|
|
@ -14,25 +14,25 @@ end
|
|||
if run == 1 then
|
||||
function FORMAT_FILTER(client)
|
||||
local filetype = vim.bo.filetype
|
||||
local n = require "null-ls"
|
||||
local s = require "null-ls.sources"
|
||||
local n = require("null-ls")
|
||||
local s = require("null-ls.sources")
|
||||
local method = n.methods.FORMATTING
|
||||
local available_formatters = s.get_available(filetype, method)
|
||||
|
||||
if #available_formatters > 0 then
|
||||
return client.name == "null-ls"
|
||||
elseif client.supports_method "textDocument/formatting" then
|
||||
elseif client.supports_method("textDocument/formatting") then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
vim.cmd [[
|
||||
vim.cmd([[
|
||||
augroup _lsp
|
||||
autocmd!
|
||||
" autocmd BufWritePre * lua vim.lsp.buf.format{timeout_ms =200, filter=format_filter}
|
||||
autocmd BufWritePre * lua vim.lsp.buf.format{timeout_ms=pcode.format_timeout_ms or 5000 ,filter=FORMAT_FILTER}
|
||||
augroup end
|
||||
]]
|
||||
]])
|
||||
end
|
||||
|
|
|
@ -9,11 +9,11 @@ function M.smart_quit()
|
|||
prompt = "You have unsaved changes. Quit anyway? (y/n) ",
|
||||
}, function(input)
|
||||
if input == "y" then
|
||||
vim.cmd "q!"
|
||||
vim.cmd("q!")
|
||||
end
|
||||
end)
|
||||
else
|
||||
vim.cmd "q!"
|
||||
vim.cmd("q!")
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
local status_ok, impatient = pcall(require, "impatient")
|
||||
if not status_ok then
|
||||
return
|
||||
return
|
||||
end
|
||||
|
||||
impatient.enable_profile()
|
||||
|
|
120
lua/user/jaq.lua
120
lua/user/jaq.lua
|
@ -1,82 +1,82 @@
|
|||
M = {}
|
||||
local status_ok, jaq_nvim = pcall(require, "jaq-nvim")
|
||||
if not status_ok then
|
||||
return
|
||||
return
|
||||
end
|
||||
|
||||
jaq_nvim.setup({
|
||||
-- Commands used with 'Jaq'
|
||||
cmds = {
|
||||
-- Default UI used (see `Usage` for options)
|
||||
default = "term",
|
||||
-- Commands used with 'Jaq'
|
||||
cmds = {
|
||||
-- Default UI used (see `Usage` for options)
|
||||
default = "term",
|
||||
|
||||
-- Uses external commands such as 'g++' and 'cargo'
|
||||
external = {
|
||||
typescript = "deno run %",
|
||||
javascript = "node %",
|
||||
-- markdown = "glow %",
|
||||
python = "python %",
|
||||
-- rust = "rustc % && ./$fileBase && rm $fileBase",
|
||||
rust = "cargo run",
|
||||
cpp = "g++ % -o $fileBase && ./$fileBase",
|
||||
go = "go run %",
|
||||
sh = "sh %",
|
||||
java = "java %",
|
||||
},
|
||||
-- Uses external commands such as 'g++' and 'cargo'
|
||||
external = {
|
||||
typescript = "deno run %",
|
||||
javascript = "node %",
|
||||
-- markdown = "glow %",
|
||||
python = "python %",
|
||||
-- rust = "rustc % && ./$fileBase && rm $fileBase",
|
||||
rust = "cargo run",
|
||||
cpp = "g++ % -o $fileBase && ./$fileBase",
|
||||
go = "go run %",
|
||||
sh = "sh %",
|
||||
java = "java %",
|
||||
},
|
||||
|
||||
-- Uses internal commands such as 'source' and 'luafile'
|
||||
internal = {
|
||||
-- lua = "luafile %",
|
||||
-- vim = "source %",
|
||||
},
|
||||
},
|
||||
-- Uses internal commands such as 'source' and 'luafile'
|
||||
internal = {
|
||||
-- lua = "luafile %",
|
||||
-- vim = "source %",
|
||||
},
|
||||
},
|
||||
|
||||
behavior = {
|
||||
-- Default type
|
||||
default = "terminal",
|
||||
behavior = {
|
||||
-- Default type
|
||||
default = "terminal",
|
||||
|
||||
-- Start in insert mode
|
||||
startinsert = false,
|
||||
-- Start in insert mode
|
||||
startinsert = false,
|
||||
|
||||
-- Use `wincmd p` on startup
|
||||
wincmd = false,
|
||||
-- Use `wincmd p` on startup
|
||||
wincmd = false,
|
||||
|
||||
-- Auto-save files
|
||||
autosave = false,
|
||||
},
|
||||
-- Auto-save files
|
||||
autosave = false,
|
||||
},
|
||||
|
||||
-- UI settings
|
||||
ui = {
|
||||
-- Floating Window / FTerm settings
|
||||
float = {
|
||||
-- Floating window border (see ':h nvim_open_win')
|
||||
border = "rounded", -- none, single, double, rounded
|
||||
-- UI settings
|
||||
ui = {
|
||||
-- Floating Window / FTerm settings
|
||||
float = {
|
||||
-- Floating window border (see ':h nvim_open_win')
|
||||
border = "rounded", -- none, single, double, 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",
|
||||
|
||||
-- Floating Window Transparency (see ':h winblend')
|
||||
blend = 0,
|
||||
},
|
||||
-- Floating Window Transparency (see ':h winblend')
|
||||
blend = 0,
|
||||
},
|
||||
|
||||
terminal = {
|
||||
-- Position of terminal
|
||||
position = "bot",
|
||||
terminal = {
|
||||
-- Position of terminal
|
||||
position = "bot",
|
||||
|
||||
-- Open the terminal without line numbers
|
||||
line_no = false,
|
||||
-- Open the terminal without line numbers
|
||||
line_no = false,
|
||||
|
||||
-- Size of terminal
|
||||
size = 20,
|
||||
},
|
||||
},
|
||||
-- Size of terminal
|
||||
size = 20,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
|
|
@ -2,11 +2,11 @@ local opts = { noremap = true, silent = true }
|
|||
|
||||
function _LIVE_SERVER()
|
||||
local Terminal = require("toggleterm.terminal").Terminal
|
||||
local live_server = Terminal:new {
|
||||
local live_server = Terminal:new({
|
||||
cmd = "live-server",
|
||||
hidden = true,
|
||||
direction = "tab",
|
||||
}
|
||||
})
|
||||
live_server:toggle()
|
||||
end
|
||||
|
||||
|
@ -159,7 +159,7 @@ end
|
|||
-- if pcall(require, "dap") then
|
||||
-- modified function keys found with `showkey -a` in the terminal to get key code
|
||||
-- run `nvim -V3log +quit` and search through the "Terminal info" in the `log` file for the correct keyname
|
||||
if vim.fn.has "win32" == 0 then
|
||||
if vim.fn.has("win32") == 0 then
|
||||
map("n", "<F5>", function()
|
||||
require("dap").continue()
|
||||
end, "")
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
local status_ok, mason_null_ls = pcall(require, "mason-null-ls")
|
||||
if not status_ok then
|
||||
return
|
||||
return
|
||||
end
|
||||
mason_null_ls.setup({
|
||||
ensure_installed = {
|
||||
-- Opt to list sources here, when available in mason.
|
||||
},
|
||||
automatic_setup = true,
|
||||
handlers = {},
|
||||
ensure_installed = {
|
||||
-- Opt to list sources here, when available in mason.
|
||||
},
|
||||
automatic_setup = true,
|
||||
handlers = {},
|
||||
})
|
||||
-- mason_null_ls.setup_handlers({})
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
local sources = {}
|
||||
local dap_data = pcode.dap_ensure_installed or {}
|
||||
for _, nullls in pairs(dap_data) do
|
||||
table.insert(sources, nullls)
|
||||
table.insert(sources, nullls)
|
||||
end
|
||||
require("mason").setup()
|
||||
require("mason-nvim-dap").setup({
|
||||
ensure_installed = sources,
|
||||
automatic_setup = true,
|
||||
handlers = {
|
||||
function(config)
|
||||
-- all sources with no handler get passed here
|
||||
ensure_installed = sources,
|
||||
automatic_setup = true,
|
||||
handlers = {
|
||||
function(config)
|
||||
-- all sources with no handler get passed here
|
||||
|
||||
-- Keep original functionality
|
||||
require("mason-nvim-dap").default_setup(config)
|
||||
end,
|
||||
},
|
||||
-- Keep original functionality
|
||||
require("mason-nvim-dap").default_setup(config)
|
||||
end,
|
||||
},
|
||||
})
|
||||
|
|
|
@ -51,12 +51,12 @@ end
|
|||
|
||||
-- vim.opt.shortmess = "ilmnrx" -- flags to shorten vim messages, see :help 'shortmess'
|
||||
-- vim.o.winbar = "%{%v:lua.require'nvim-navic'.get_location()%}"
|
||||
vim.opt.shortmess:append "c" -- don't give |ins-completion-menu| messages
|
||||
vim.opt.iskeyword:append "-" -- hyphenated words recognized by searches
|
||||
vim.opt.formatoptions:remove { "t", "c", "q", "j" }
|
||||
vim.opt.shortmess:append("c") -- don't give |ins-completion-menu| messages
|
||||
vim.opt.iskeyword:append("-") -- hyphenated words recognized by searches
|
||||
vim.opt.formatoptions:remove({ "t", "c", "q", "j" })
|
||||
vim.opt.formatoptions = "croql"
|
||||
-- vim.opt.formatoptions:remove({ "c", "r", "o" }) -- don't insert the current comment leader automatically for auto-wrapping comments using 'textwidth', hitting <Enter> in insert mode, or hitting 'o' or 'O' in normal mode.
|
||||
vim.opt.runtimepath:remove "/usr/share/vim/vimfiles" -- separate vim plugins from neovim in case vim still in use
|
||||
vim.opt.runtimepath:remove("/usr/share/vim/vimfiles") -- separate vim plugins from neovim in case vim still in use
|
||||
-- config for blink cursor in normal, visual and insert mode
|
||||
-- vim.opt.guicursor = {
|
||||
-- "n-v-c:block-Cursor/lCursor-blinkwait1000-blinkon100-blinkoff100",
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
local status_ok = pcall(require, "luasnip")
|
||||
if not status_ok then
|
||||
return
|
||||
return
|
||||
end
|
||||
|
||||
local lpath = vim.fn.stdpath("config") .. "/my-snippets"
|
||||
require("luasnip.loaders.from_vscode").lazy_load({
|
||||
paths = lpath,
|
||||
paths = lpath,
|
||||
})
|
||||
require("luasnip.loaders.from_vscode").load({ paths = lpath })
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
local alpha = require "alpha"
|
||||
local startify = require "alpha.themes.startify"
|
||||
local alpha = require("alpha")
|
||||
local startify = require("alpha.themes.startify")
|
||||
local dash_model = {}
|
||||
dash_model = {
|
||||
[[ _ __ __ ]],
|
||||
|
@ -63,9 +63,9 @@ vim.api.nvim_create_autocmd("User", {
|
|||
vim.api.nvim_create_autocmd({ "User" }, {
|
||||
pattern = { "AlphaReady" },
|
||||
callback = function()
|
||||
vim.cmd [[
|
||||
vim.cmd([[
|
||||
set laststatus=0 | autocmd BufUnload <buffer> set laststatus=3
|
||||
]]
|
||||
]])
|
||||
end,
|
||||
})
|
||||
-- ignore filetypes in MRU
|
||||
|
|
|
@ -1,71 +1,71 @@
|
|||
local status_ok, tokyonight = pcall(require, "tokyonight")
|
||||
if not status_ok then
|
||||
return
|
||||
return
|
||||
end
|
||||
local transp = false
|
||||
local sidebar = "normal" --"dark , transparent, normal"
|
||||
local hilight = "#292e42"
|
||||
local tras = pcode.transparent_mode or 0
|
||||
if tras == 1 then
|
||||
transp = true
|
||||
sidebar = "transparent"
|
||||
-- hilight = "#3E4254"
|
||||
-- hilight = "#353a56"
|
||||
hilight = "#292e42"
|
||||
transp = true
|
||||
sidebar = "transparent"
|
||||
-- hilight = "#3E4254"
|
||||
-- hilight = "#353a56"
|
||||
hilight = "#292e42"
|
||||
end
|
||||
|
||||
tokyonight.setup({
|
||||
-- your configuration comes here
|
||||
-- or leave it empty to use the default settings
|
||||
style = "night", -- The theme comes in three styles, `storm`, `moon`, a darker variant `night` and `day`
|
||||
light_style = "day", -- The theme is used when the background is set to light
|
||||
transparent = transp, -- Enable this to disable setting the background color
|
||||
terminal_colors = true, -- Configure the colors used when opening a `:terminal` in Neovim
|
||||
styles = {
|
||||
-- Style to be applied to different syntax groups
|
||||
-- Value is any valid attr-list value for `:help nvim_set_hl`
|
||||
-- comments = { italic = true },
|
||||
comments = { italic = true },
|
||||
keywords = {},
|
||||
functions = {},
|
||||
variables = {},
|
||||
-- Background styles. Can be "dark", "transparent" or "normal"
|
||||
sidebars = sidebar, -- style for sidebars, see below
|
||||
floats = sidebar, -- style for floating windows
|
||||
},
|
||||
sidebars = { "qf", "help" }, -- Set a darker background on sidebar-like windows. For example: `["qf", "vista_kind", "terminal", "packer"]`
|
||||
day_brightness = 0.2, -- Adjusts the brightness of the colors of the **Day** style. Number between 0 and 1, from dull to vibrant colors
|
||||
hide_inactive_statusline = false, -- Enabling this option, will hide inactive statuslines and replace them with a thin border instead. Should work with the standard **StatusLine** and **LuaLine**.
|
||||
dim_inactive = false, -- dims inactive windows
|
||||
lualine_bold = false, -- When `true`, section headers in the lualine theme will be bold
|
||||
-- your configuration comes here
|
||||
-- or leave it empty to use the default settings
|
||||
style = "night", -- The theme comes in three styles, `storm`, `moon`, a darker variant `night` and `day`
|
||||
light_style = "day", -- The theme is used when the background is set to light
|
||||
transparent = transp, -- Enable this to disable setting the background color
|
||||
terminal_colors = true, -- Configure the colors used when opening a `:terminal` in Neovim
|
||||
styles = {
|
||||
-- Style to be applied to different syntax groups
|
||||
-- Value is any valid attr-list value for `:help nvim_set_hl`
|
||||
-- comments = { italic = true },
|
||||
comments = { italic = true },
|
||||
keywords = {},
|
||||
functions = {},
|
||||
variables = {},
|
||||
-- Background styles. Can be "dark", "transparent" or "normal"
|
||||
sidebars = sidebar, -- style for sidebars, see below
|
||||
floats = sidebar, -- style for floating windows
|
||||
},
|
||||
sidebars = { "qf", "help" }, -- Set a darker background on sidebar-like windows. For example: `["qf", "vista_kind", "terminal", "packer"]`
|
||||
day_brightness = 0.2, -- Adjusts the brightness of the colors of the **Day** style. Number between 0 and 1, from dull to vibrant colors
|
||||
hide_inactive_statusline = false, -- Enabling this option, will hide inactive statuslines and replace them with a thin border instead. Should work with the standard **StatusLine** and **LuaLine**.
|
||||
dim_inactive = false, -- dims inactive windows
|
||||
lualine_bold = false, -- When `true`, section headers in the lualine theme will be bold
|
||||
|
||||
--- You can override specific color groups to use other groups or a hex color
|
||||
--- function will be called with a ColorScheme table
|
||||
-- @param colors ColorScheme
|
||||
on_colors = function(colors)
|
||||
colors.bg_highlight = hilight
|
||||
colors.bg_statusline = colors.none
|
||||
end,
|
||||
--- You can override specific color groups to use other groups or a hex color
|
||||
--- function will be called with a ColorScheme table
|
||||
-- @param colors ColorScheme
|
||||
on_colors = function(colors)
|
||||
colors.bg_highlight = hilight
|
||||
colors.bg_statusline = colors.none
|
||||
end,
|
||||
|
||||
--- You can override specific highlights to use other groups or a hex color
|
||||
--- function will be called with a Highlights and ColorScheme table
|
||||
--@param highlights Highlights
|
||||
-- @param colors ColorScheme
|
||||
on_highlights = function(highlights, colors)
|
||||
highlights.NvimTreeFolderIcon = {
|
||||
bg = colors.none,
|
||||
fg = "#e0af68",
|
||||
}
|
||||
highlights.Underlined = {
|
||||
underline = false,
|
||||
}
|
||||
highlights.NvimTreeWinSeparator = {
|
||||
fg = colors.border,
|
||||
}
|
||||
highlights.BufferLineFill = { bg = colors.bg }
|
||||
highlights.NvimTreeSpecialFile = { fg = colors.purple, underline = false }
|
||||
highlights["@tag.attribute"] = { fg = colors.green1, italic = true }
|
||||
-- highlights["@keyword.function"] = { fg = colors.blue, italic = true }
|
||||
-- highlights["@function"] = { fg = colors.blue, italic = true }
|
||||
end,
|
||||
--- You can override specific highlights to use other groups or a hex color
|
||||
--- function will be called with a Highlights and ColorScheme table
|
||||
--@param highlights Highlights
|
||||
-- @param colors ColorScheme
|
||||
on_highlights = function(highlights, colors)
|
||||
highlights.NvimTreeFolderIcon = {
|
||||
bg = colors.none,
|
||||
fg = "#e0af68",
|
||||
}
|
||||
highlights.Underlined = {
|
||||
underline = false,
|
||||
}
|
||||
highlights.NvimTreeWinSeparator = {
|
||||
fg = colors.border,
|
||||
}
|
||||
highlights.BufferLineFill = { bg = colors.bg }
|
||||
highlights.NvimTreeSpecialFile = { fg = colors.purple, underline = false }
|
||||
highlights["@tag.attribute"] = { fg = colors.green1, italic = true }
|
||||
-- highlights["@keyword.function"] = { fg = colors.blue, italic = true }
|
||||
-- highlights["@function"] = { fg = colors.blue, italic = true }
|
||||
end,
|
||||
})
|
||||
|
|
|
@ -1,42 +1,42 @@
|
|||
local status_ok, tokyonight = pcall(require, "tokyonight")
|
||||
if not status_ok then
|
||||
return
|
||||
return
|
||||
end
|
||||
tokyonight.setup({
|
||||
-- your configuration comes here
|
||||
-- or leave it empty to use the default settings
|
||||
style = "night", -- The theme comes in three styles, `storm`, `moon`, a darker variant `night` and `day`
|
||||
light_style = "day", -- The theme is used when the background is set to light
|
||||
transparent = true, -- Enable this to disable setting the background color
|
||||
terminal_colors = true, -- Configure the colors used when opening a `:terminal` in Neovim
|
||||
styles = {
|
||||
-- Style to be applied to different syntax groups
|
||||
-- Value is any valid attr-list value for `:help nvim_set_hl`
|
||||
-- comments = { italic = true },
|
||||
comments = { italic = true },
|
||||
keywords = { italic = true },
|
||||
functions = {},
|
||||
variables = {},
|
||||
-- Background styles. Can be "dark", "transparent" or "normal"
|
||||
sidebars = "transparent", -- style for sidebars, see below
|
||||
floats = "transparent", -- style for floating windows
|
||||
},
|
||||
sidebars = { "qf", "help" }, -- Set a darker background on sidebar-like windows. For example: `["qf", "vista_kind", "terminal", "packer"]`
|
||||
day_brightness = 0.2, -- Adjusts the brightness of the colors of the **Day** style. Number between 0 and 1, from dull to vibrant colors
|
||||
hide_inactive_statusline = false, -- Enabling this option, will hide inactive statuslines and replace them with a thin border instead. Should work with the standard **StatusLine** and **LuaLine**.
|
||||
dim_inactive = false, -- dims inactive windows
|
||||
lualine_bold = false, -- When `true`, section headers in the lualine theme will be bold
|
||||
-- your configuration comes here
|
||||
-- or leave it empty to use the default settings
|
||||
style = "night", -- The theme comes in three styles, `storm`, `moon`, a darker variant `night` and `day`
|
||||
light_style = "day", -- The theme is used when the background is set to light
|
||||
transparent = true, -- Enable this to disable setting the background color
|
||||
terminal_colors = true, -- Configure the colors used when opening a `:terminal` in Neovim
|
||||
styles = {
|
||||
-- Style to be applied to different syntax groups
|
||||
-- Value is any valid attr-list value for `:help nvim_set_hl`
|
||||
-- comments = { italic = true },
|
||||
comments = { italic = true },
|
||||
keywords = { italic = true },
|
||||
functions = {},
|
||||
variables = {},
|
||||
-- Background styles. Can be "dark", "transparent" or "normal"
|
||||
sidebars = "transparent", -- style for sidebars, see below
|
||||
floats = "transparent", -- style for floating windows
|
||||
},
|
||||
sidebars = { "qf", "help" }, -- Set a darker background on sidebar-like windows. For example: `["qf", "vista_kind", "terminal", "packer"]`
|
||||
day_brightness = 0.2, -- Adjusts the brightness of the colors of the **Day** style. Number between 0 and 1, from dull to vibrant colors
|
||||
hide_inactive_statusline = false, -- Enabling this option, will hide inactive statuslines and replace them with a thin border instead. Should work with the standard **StatusLine** and **LuaLine**.
|
||||
dim_inactive = false, -- dims inactive windows
|
||||
lualine_bold = false, -- When `true`, section headers in the lualine theme will be bold
|
||||
|
||||
--- You can override specific color groups to use other groups or a hex color
|
||||
--- function will be called with a ColorScheme table
|
||||
--@param colors ColorScheme
|
||||
on_colors = function(colors)
|
||||
colors.bg_highlight = "#9EA0A9"
|
||||
end,
|
||||
--- You can override specific color groups to use other groups or a hex color
|
||||
--- function will be called with a ColorScheme table
|
||||
--@param colors ColorScheme
|
||||
on_colors = function(colors)
|
||||
colors.bg_highlight = "#9EA0A9"
|
||||
end,
|
||||
|
||||
--- You can override specific highlights to use other groups or a hex color
|
||||
--- function will be called with a Highlights and ColorScheme table
|
||||
--@param highlights Highlights
|
||||
--@param colors ColorScheme
|
||||
--on_highlights = function(highlights, colors) end,
|
||||
--- You can override specific highlights to use other groups or a hex color
|
||||
--- function will be called with a Highlights and ColorScheme table
|
||||
--@param highlights Highlights
|
||||
--@param colors ColorScheme
|
||||
--on_highlights = function(highlights, colors) end,
|
||||
})
|
||||
|
|
|
@ -1,44 +1,44 @@
|
|||
local M = {}
|
||||
function M.bufremove(buf)
|
||||
buf = buf or 0
|
||||
buf = buf == 0 and vim.api.nvim_get_current_buf() or buf
|
||||
buf = buf or 0
|
||||
buf = buf == 0 and vim.api.nvim_get_current_buf() or buf
|
||||
|
||||
if vim.bo.modified then
|
||||
local choice = vim.fn.confirm(("Save changes to %q?"):format(vim.fn.bufname()), "&Yes\n&No\n&Cancel")
|
||||
if choice == 0 then -- Cancel
|
||||
return
|
||||
end
|
||||
if choice == 1 then -- Yes
|
||||
vim.cmd.write()
|
||||
end
|
||||
end
|
||||
if vim.bo.modified then
|
||||
local choice = vim.fn.confirm(("Save changes to %q?"):format(vim.fn.bufname()), "&Yes\n&No\n&Cancel")
|
||||
if choice == 0 then -- Cancel
|
||||
return
|
||||
end
|
||||
if choice == 1 then -- Yes
|
||||
vim.cmd.write()
|
||||
end
|
||||
end
|
||||
|
||||
for _, win in ipairs(vim.fn.win_findbuf(buf)) do
|
||||
vim.api.nvim_win_call(win, function()
|
||||
if not vim.api.nvim_win_is_valid(win) or vim.api.nvim_win_get_buf(win) ~= buf then
|
||||
return
|
||||
end
|
||||
-- Try using alternate buffer
|
||||
local alt = vim.fn.bufnr("#")
|
||||
if alt ~= buf and vim.fn.buflisted(alt) == 1 then
|
||||
vim.api.nvim_win_set_buf(win, alt)
|
||||
return
|
||||
end
|
||||
for _, win in ipairs(vim.fn.win_findbuf(buf)) do
|
||||
vim.api.nvim_win_call(win, function()
|
||||
if not vim.api.nvim_win_is_valid(win) or vim.api.nvim_win_get_buf(win) ~= buf then
|
||||
return
|
||||
end
|
||||
-- Try using alternate buffer
|
||||
local alt = vim.fn.bufnr("#")
|
||||
if alt ~= buf and vim.fn.buflisted(alt) == 1 then
|
||||
vim.api.nvim_win_set_buf(win, alt)
|
||||
return
|
||||
end
|
||||
|
||||
-- Try using previous buffer
|
||||
local has_previous = pcall(vim.cmd, "bprevious")
|
||||
if has_previous and buf ~= vim.api.nvim_win_get_buf(win) then
|
||||
return
|
||||
end
|
||||
-- Try using previous buffer
|
||||
local has_previous = pcall(vim.cmd, "bprevious")
|
||||
if has_previous and buf ~= vim.api.nvim_win_get_buf(win) then
|
||||
return
|
||||
end
|
||||
|
||||
-- Create new listed buffer
|
||||
local new_buf = vim.api.nvim_create_buf(true, false)
|
||||
vim.api.nvim_win_set_buf(win, new_buf)
|
||||
end)
|
||||
end
|
||||
if vim.api.nvim_buf_is_valid(buf) then
|
||||
pcall(vim.cmd, "bdelete! " .. buf)
|
||||
end
|
||||
-- Create new listed buffer
|
||||
local new_buf = vim.api.nvim_create_buf(true, false)
|
||||
vim.api.nvim_win_set_buf(win, new_buf)
|
||||
end)
|
||||
end
|
||||
if vim.api.nvim_buf_is_valid(buf) then
|
||||
pcall(vim.cmd, "bdelete! " .. buf)
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
|
@ -2,9 +2,9 @@ local null_ls = require("null-ls")
|
|||
local M = {}
|
||||
|
||||
M.list_registered = function(filetype)
|
||||
local method = null_ls.methods.FORMATTING
|
||||
local registered_providers = require("user.utils.lsp").list_registered_providers_names(filetype)
|
||||
return registered_providers[method] or {}
|
||||
local method = null_ls.methods.FORMATTING
|
||||
local registered_providers = require("user.utils.lsp").list_registered_providers_names(filetype)
|
||||
return registered_providers[method] or {}
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
|
@ -2,18 +2,18 @@ local null_ls = require("null-ls")
|
|||
local M = {}
|
||||
|
||||
M.alternative_methods = {
|
||||
null_ls.methods.DIAGNOSTICS,
|
||||
null_ls.methods.DIAGNOSTICS_ON_OPEN,
|
||||
null_ls.methods.DIAGNOSTICS_ON_SAVE,
|
||||
null_ls.methods.DIAGNOSTICS,
|
||||
null_ls.methods.DIAGNOSTICS_ON_OPEN,
|
||||
null_ls.methods.DIAGNOSTICS_ON_SAVE,
|
||||
}
|
||||
|
||||
M.linter_list_registered = function(filetype)
|
||||
local registered_providers = require("user.utils.lsp").list_registered_providers_names(filetype)
|
||||
local providers_for_methods = vim.iter(vim.tbl_map(function(m)
|
||||
return registered_providers[m] or {}
|
||||
end, M.alternative_methods))
|
||||
local registered_providers = require("user.utils.lsp").list_registered_providers_names(filetype)
|
||||
local providers_for_methods = vim.iter(vim.tbl_map(function(m)
|
||||
return registered_providers[m] or {}
|
||||
end, M.alternative_methods))
|
||||
|
||||
return providers_for_methods
|
||||
return providers_for_methods
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
local M = {}
|
||||
|
||||
M.list_registered_providers_names = function(filetype)
|
||||
local s = require("null-ls.sources")
|
||||
local available_sources = s.get_available(filetype)
|
||||
local registered = {}
|
||||
for _, source in ipairs(available_sources) do
|
||||
for method in pairs(source.methods) do
|
||||
registered[method] = registered[method] or {}
|
||||
table.insert(registered[method], source.name)
|
||||
end
|
||||
end
|
||||
return registered
|
||||
local s = require("null-ls.sources")
|
||||
local available_sources = s.get_available(filetype)
|
||||
local registered = {}
|
||||
for _, source in ipairs(available_sources) do
|
||||
for method in pairs(source.methods) do
|
||||
registered[method] = registered[method] or {}
|
||||
table.insert(registered[method], source.name)
|
||||
end
|
||||
end
|
||||
return registered
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
local hide_in_width = function()
|
||||
return vim.fn.winwidth(0) > 75
|
||||
end
|
||||
local icons = require "user.icons"
|
||||
local formatter = require "user.utils.formatter"
|
||||
local linter = require "user.utils.linter"
|
||||
local icons = require("user.icons")
|
||||
local formatter = require("user.utils.formatter")
|
||||
local linter = require("user.utils.linter")
|
||||
|
||||
local getLeftSubstring = function(word, length)
|
||||
if #word > length then
|
||||
|
@ -86,7 +86,7 @@ return {
|
|||
local buf_ft = vim.bo.filetype
|
||||
-- start register
|
||||
local buf_clients = {}
|
||||
buf_clients = vim.lsp.get_clients { bufnr = 0 }
|
||||
buf_clients = vim.lsp.get_clients({ bufnr = 0 })
|
||||
local buf_client_names = {}
|
||||
if next(buf_clients) == nil then
|
||||
-- TODO: clean up this if statement
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
local M = {}
|
||||
|
||||
local component = require "user.utils.lualine_component"
|
||||
local component = require("user.utils.lualine_component")
|
||||
local treesitter = component.treesitter
|
||||
local lsp_info = component.lsp_info
|
||||
local diagnostics = component.diagnostics
|
||||
|
|
|
@ -3,7 +3,7 @@ local M = {}
|
|||
-- for debug
|
||||
local debug_key = {}
|
||||
|
||||
if vim.fn.has "win32" == 0 then
|
||||
if vim.fn.has("win32") == 0 then
|
||||
debug_key = {
|
||||
name = " Debug",
|
||||
t = { "<cmd>lua require'dap'.toggle_breakpoint()<cr>", "Toggle Breakpoint" },
|
||||
|
@ -26,47 +26,47 @@ end
|
|||
|
||||
function M._LAZYGIT_TOGGLE()
|
||||
local Terminal = require("toggleterm.terminal").Terminal
|
||||
local lazygit = Terminal:new { cmd = "lazygit", hidden = true }
|
||||
local lazygit = Terminal:new({ cmd = "lazygit", hidden = true })
|
||||
lazygit:toggle()
|
||||
end
|
||||
|
||||
function M._NODE_TOGGLE()
|
||||
local Terminal = require("toggleterm.terminal").Terminal
|
||||
local node = Terminal:new { cmd = "node", hidden = true }
|
||||
local node = Terminal:new({ cmd = "node", hidden = true })
|
||||
node:toggle()
|
||||
end
|
||||
|
||||
function M._BTOP_TOGGLE()
|
||||
local Terminal = require("toggleterm.terminal").Terminal
|
||||
local htop = Terminal:new { cmd = "btop", hidden = true }
|
||||
local htop = Terminal:new({ cmd = "btop", hidden = true })
|
||||
htop:toggle()
|
||||
end
|
||||
|
||||
function M._PYTHON_TOGGLE()
|
||||
local Terminal = require("toggleterm.terminal").Terminal
|
||||
local python = Terminal:new { cmd = "python", hidden = true }
|
||||
local python = Terminal:new({ cmd = "python", hidden = true })
|
||||
python:toggle()
|
||||
end
|
||||
|
||||
function M._NEWTAB_TOGGLE()
|
||||
local Terminal = require("toggleterm.terminal").Terminal
|
||||
local pwsh = Terminal:new { cmd = "pwsh", hidden = true, direction = "tab" }
|
||||
local pwsh = Terminal:new({ cmd = "pwsh", hidden = true, direction = "tab" })
|
||||
pwsh:toggle()
|
||||
end
|
||||
|
||||
function M._OPEN_EXPLORER()
|
||||
local Terminal = require("toggleterm.terminal").Terminal
|
||||
local pwsh = Terminal:new { cmd = "explorer .", hidden = true, direction = "tab" }
|
||||
local pwsh = Terminal:new({ cmd = "explorer .", hidden = true, direction = "tab" })
|
||||
pwsh:toggle()
|
||||
end
|
||||
|
||||
function M._LIVE_SERVER()
|
||||
local Terminal = require("toggleterm.terminal").Terminal
|
||||
local live_server = Terminal:new {
|
||||
local live_server = Terminal:new({
|
||||
cmd = "live-server",
|
||||
hidden = true,
|
||||
direction = "tab",
|
||||
}
|
||||
})
|
||||
live_server:toggle()
|
||||
end
|
||||
|
||||
|
|
|
@ -30,9 +30,9 @@ local excludes = function()
|
|||
end
|
||||
|
||||
local get_filename = function()
|
||||
local filename = vim.fn.expand "%:t"
|
||||
local extension = vim.fn.expand "%:e"
|
||||
local f = require "user.functions"
|
||||
local filename = vim.fn.expand("%:t")
|
||||
local extension = vim.fn.expand("%:e")
|
||||
local f = require("user.functions")
|
||||
|
||||
if not f.isempty(filename) then
|
||||
local file_icon, hl_group = require("nvim-web-devicons").get_icon(filename, extension, { default = true })
|
||||
|
@ -102,7 +102,7 @@ local get_winbar = function()
|
|||
if excludes() then
|
||||
return
|
||||
end
|
||||
local f = require "user.functions"
|
||||
local f = require("user.functions")
|
||||
local value = get_filename()
|
||||
|
||||
local gps_added = false
|
||||
|
@ -114,7 +114,7 @@ local get_winbar = function()
|
|||
end
|
||||
end
|
||||
|
||||
if not f.isempty(value) and f.get_buf_option "mod" then
|
||||
if not f.isempty(value) and f.get_buf_option("mod") then
|
||||
-- TODO: replace with circle
|
||||
local mod = "%#LspCodeLens#" .. icons.ui.Circle .. "%*"
|
||||
if gps_added then
|
||||
|
@ -138,7 +138,7 @@ local get_winbar = function()
|
|||
end
|
||||
|
||||
vim.api.nvim_create_augroup("_winbar", {})
|
||||
if vim.fn.has "nvim-0.8" == 1 then
|
||||
if vim.fn.has("nvim-0.8") == 1 then
|
||||
vim.api.nvim_create_autocmd(
|
||||
{ "CursorHoldI", "CursorHold", "BufWinEnter", "BufFilePost", "InsertEnter", "BufWritePost", "TabClosed" },
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue