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()
|
function Active_whichkey()
|
||||||
VSCodeNotify("whichkey.show")
|
VSCodeNotify("whichkey.show")
|
||||||
end
|
end
|
||||||
|
|
||||||
function Top_screen()
|
function Top_screen()
|
||||||
Cmd("call <SNR>3_reveal('top', 0)")
|
Cmd("call <SNR>3_reveal('top', 0)")
|
||||||
end
|
end
|
||||||
|
|
||||||
function Bottom_screen()
|
function Bottom_screen()
|
||||||
Cmd("call <SNR>3_reveal('bottom', 0)")
|
Cmd("call <SNR>3_reveal('bottom', 0)")
|
||||||
end
|
end
|
||||||
|
|
||||||
function Move_to_top_screen()
|
function Move_to_top_screen()
|
||||||
Cmd("call <SNR>3_moveCursor('top')")
|
Cmd("call <SNR>3_moveCursor('top')")
|
||||||
end
|
end
|
||||||
|
|
||||||
function Move_to_bottom_screen()
|
function Move_to_bottom_screen()
|
||||||
Cmd("call <SNR>3_moveCursor('bottom')")
|
Cmd("call <SNR>3_moveCursor('bottom')")
|
||||||
end
|
end
|
||||||
|
|
||||||
function Scroll_line_down()
|
function Scroll_line_down()
|
||||||
VSCodeCall("scrollLineDown")
|
VSCodeCall("scrollLineDown")
|
||||||
end
|
end
|
||||||
|
|
||||||
function Scroll_line_up()
|
function Scroll_line_up()
|
||||||
VSCodeCall("scrollLineUp")
|
VSCodeCall("scrollLineUp")
|
||||||
end
|
end
|
||||||
|
|
||||||
function Vscode_ctrl_d()
|
function Vscode_ctrl_d()
|
||||||
VSCodeNotify("vscode-neovim.ctrl-d")
|
VSCodeNotify("vscode-neovim.ctrl-d")
|
||||||
end
|
end
|
||||||
|
|
||||||
function Vscode_ctrl_u()
|
function Vscode_ctrl_u()
|
||||||
VSCodeNotify("vscode-neovim.ctrl-u")
|
VSCodeNotify("vscode-neovim.ctrl-u")
|
||||||
end
|
end
|
||||||
|
|
||||||
function Move_to_bottom_screen__center_screen()
|
function Move_to_bottom_screen__center_screen()
|
||||||
Move_to_bottom_screen()
|
Move_to_bottom_screen()
|
||||||
Center_screen()
|
Center_screen()
|
||||||
end
|
end
|
||||||
|
|
||||||
function Move_to_top_screen__center_screen()
|
function Move_to_top_screen__center_screen()
|
||||||
Move_to_top_screen()
|
Move_to_top_screen()
|
||||||
Center_screen()
|
Center_screen()
|
||||||
end
|
end
|
||||||
|
|
||||||
function Trim_trailing_whitespace()
|
function Trim_trailing_whitespace()
|
||||||
VSCodeCall("editor.action.trimTrailingWhitespace")
|
VSCodeCall("editor.action.trimTrailingWhitespace")
|
||||||
end
|
end
|
||||||
|
|
||||||
function Save()
|
function Save()
|
||||||
VSCodeCall("workbench.action.files.save")
|
VSCodeCall("workbench.action.files.save")
|
||||||
end
|
end
|
||||||
|
|
||||||
function Save_no_format()
|
function Save_no_format()
|
||||||
VSCodeCall("workbench.action.files.saveWithoutFormatting")
|
VSCodeCall("workbench.action.files.saveWithoutFormatting")
|
||||||
end
|
end
|
||||||
|
|
||||||
function Trim__save__no_format()
|
function Trim__save__no_format()
|
||||||
Trim_trailing_whitespace()
|
Trim_trailing_whitespace()
|
||||||
Save_no_format()
|
Save_no_format()
|
||||||
end
|
end
|
||||||
|
|
||||||
function Trim__save__no_highlight()
|
function Trim__save__no_highlight()
|
||||||
Trim_trailing_whitespace()
|
Trim_trailing_whitespace()
|
||||||
Save()
|
Save()
|
||||||
Remove_highlighting()
|
Remove_highlighting()
|
||||||
end
|
end
|
||||||
|
|
||||||
function Format()
|
function Format()
|
||||||
VSCodeCall("editor.action.formatDocument")
|
VSCodeCall("editor.action.formatDocument")
|
||||||
print("formatted!")
|
print("formatted!")
|
||||||
end
|
end
|
||||||
|
|
||||||
function Trim__save__format()
|
function Trim__save__format()
|
||||||
Trim_trailing_whitespace()
|
Trim_trailing_whitespace()
|
||||||
Format()
|
Format()
|
||||||
Save()
|
Save()
|
||||||
end
|
end
|
||||||
|
|
||||||
function Reveal_definition_aside()
|
function Reveal_definition_aside()
|
||||||
VSCodeNotify("editor.action.revealDefinitionAside")
|
VSCodeNotify("editor.action.revealDefinitionAside")
|
||||||
end
|
end
|
||||||
|
|
||||||
function Go_to_implementation()
|
function Go_to_implementation()
|
||||||
VSCodeNotify("editor.action.goToImplementation")
|
VSCodeNotify("editor.action.goToImplementation")
|
||||||
end
|
end
|
||||||
|
|
||||||
function Go_to_reference()
|
function Go_to_reference()
|
||||||
VSCodeNotify("editor.action.goToReferences")
|
VSCodeNotify("editor.action.goToReferences")
|
||||||
end
|
end
|
||||||
|
|
||||||
function Rename_symbol()
|
function Rename_symbol()
|
||||||
VSCodeNotify("editor.action.rename")
|
VSCodeNotify("editor.action.rename")
|
||||||
end
|
end
|
||||||
|
|
||||||
function Outdent()
|
function Outdent()
|
||||||
---@diagnostic disable-next-line: unused-local
|
---@diagnostic disable-next-line: unused-local
|
||||||
for i = 1, vim.v.count1 do
|
for i = 1, vim.v.count1 do
|
||||||
VSCodeNotify("editor.action.outdentLines")
|
VSCodeNotify("editor.action.outdentLines")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function Indent()
|
function Indent()
|
||||||
---@diagnostic disable-next-line: unused-local
|
---@diagnostic disable-next-line: unused-local
|
||||||
for i = 1, vim.v.count1 do
|
for i = 1, vim.v.count1 do
|
||||||
VSCodeNotify("editor.action.indentLines")
|
VSCodeNotify("editor.action.indentLines")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function Outdent_vis()
|
function Outdent_vis()
|
||||||
VSCodeNotify("editor.action.outdentLines", false)
|
VSCodeNotify("editor.action.outdentLines", false)
|
||||||
end
|
end
|
||||||
|
|
||||||
function Indent_vis()
|
function Indent_vis()
|
||||||
VSCodeNotify("editor.action.indentLines", false)
|
VSCodeNotify("editor.action.indentLines", false)
|
||||||
end
|
end
|
||||||
|
|
||||||
function Comment()
|
function Comment()
|
||||||
VSCodeNotify("editor.action.commentLine")
|
VSCodeNotify("editor.action.commentLine")
|
||||||
end
|
end
|
||||||
|
|
||||||
function Convert_to_spaces()
|
function Convert_to_spaces()
|
||||||
VSCodeNotify("editor.action.indentationToSpaces")
|
VSCodeNotify("editor.action.indentationToSpaces")
|
||||||
end
|
end
|
||||||
|
|
||||||
function Convert_to_tabs()
|
function Convert_to_tabs()
|
||||||
VSCodeNotify("editor.action.indentationToTabs")
|
VSCodeNotify("editor.action.indentationToTabs")
|
||||||
end
|
end
|
||||||
|
|
||||||
function Indent_with_spaces()
|
function Indent_with_spaces()
|
||||||
VSCodeNotify("editor.action.indentUsingSpaces")
|
VSCodeNotify("editor.action.indentUsingSpaces")
|
||||||
end
|
end
|
||||||
|
|
||||||
function Indent_with_tabs()
|
function Indent_with_tabs()
|
||||||
VSCodeNotify("editor.action.indentUsingTabs")
|
VSCodeNotify("editor.action.indentUsingTabs")
|
||||||
end
|
end
|
||||||
|
|
||||||
function CloseEditor()
|
function CloseEditor()
|
||||||
VSCodeNotify("workbench.action.closeActiveEditor")
|
VSCodeNotify("workbench.action.closeActiveEditor")
|
||||||
end
|
end
|
||||||
|
|
||||||
function UndoCloseEditor()
|
function UndoCloseEditor()
|
||||||
VSCodeNotify("workbench.action.reopenClosedEditor")
|
VSCodeNotify("workbench.action.reopenClosedEditor")
|
||||||
end
|
end
|
||||||
|
|
||||||
function Git_stage_file()
|
function Git_stage_file()
|
||||||
Trim_trailing_whitespace()
|
Trim_trailing_whitespace()
|
||||||
Save()
|
Save()
|
||||||
VSCodeNotify("git.stage")
|
VSCodeNotify("git.stage")
|
||||||
end
|
end
|
||||||
|
|
||||||
function Git_unstage_file()
|
function Git_unstage_file()
|
||||||
Save()
|
Save()
|
||||||
VSCodeNotify("git.unstage")
|
VSCodeNotify("git.unstage")
|
||||||
end
|
end
|
||||||
|
|
||||||
function Git_revert_change()
|
function Git_revert_change()
|
||||||
VSCodeNotify("git.revertSelectedRanges")
|
VSCodeNotify("git.revertSelectedRanges")
|
||||||
end
|
end
|
||||||
|
|
||||||
function Git_stage_change()
|
function Git_stage_change()
|
||||||
VSCodeNotify("git.stageSelectedRanges")
|
VSCodeNotify("git.stageSelectedRanges")
|
||||||
end
|
end
|
||||||
|
|
||||||
function Git_unstage_change()
|
function Git_unstage_change()
|
||||||
VSCodeNotify("git.unstageSelectedRanges")
|
VSCodeNotify("git.unstageSelectedRanges")
|
||||||
end
|
end
|
||||||
|
|
||||||
function Git_open_changes()
|
function Git_open_changes()
|
||||||
VSCodeNotify("git.openChange")
|
VSCodeNotify("git.openChange")
|
||||||
end
|
end
|
||||||
|
|
||||||
function Git_open_all_changes()
|
function Git_open_all_changes()
|
||||||
VSCodeNotify("git.openAllChanges")
|
VSCodeNotify("git.openAllChanges")
|
||||||
end
|
end
|
||||||
|
|
||||||
function Accept_merge_both()
|
function Accept_merge_both()
|
||||||
VSCodeNotify("merge-conflict.accept.both")
|
VSCodeNotify("merge-conflict.accept.both")
|
||||||
end
|
end
|
||||||
|
|
||||||
function Accept_merge_all_both()
|
function Accept_merge_all_both()
|
||||||
VSCodeNotify("merge-conflict.accept.all-both")
|
VSCodeNotify("merge-conflict.accept.all-both")
|
||||||
end
|
end
|
||||||
|
|
||||||
function Accept_merge_current()
|
function Accept_merge_current()
|
||||||
VSCodeNotify("merge-conflict.accept.current")
|
VSCodeNotify("merge-conflict.accept.current")
|
||||||
end
|
end
|
||||||
|
|
||||||
function Accept_merge_all_current()
|
function Accept_merge_all_current()
|
||||||
VSCodeNotify("merge-conflict.accept.all-current")
|
VSCodeNotify("merge-conflict.accept.all-current")
|
||||||
end
|
end
|
||||||
|
|
||||||
function Accept_merge_incoming()
|
function Accept_merge_incoming()
|
||||||
VSCodeNotify("merge-conflict.accept.incoming")
|
VSCodeNotify("merge-conflict.accept.incoming")
|
||||||
end
|
end
|
||||||
|
|
||||||
function Accept_merge_all_incoming()
|
function Accept_merge_all_incoming()
|
||||||
VSCodeNotify("merge-conflict.accept.all-incoming")
|
VSCodeNotify("merge-conflict.accept.all-incoming")
|
||||||
end
|
end
|
||||||
|
|
||||||
function Accept_merge_selection()
|
function Accept_merge_selection()
|
||||||
VSCodeNotify("merge-conflict.accept.selection")
|
VSCodeNotify("merge-conflict.accept.selection")
|
||||||
end
|
end
|
||||||
|
|
||||||
function Codesnap()
|
function Codesnap()
|
||||||
VSCodeNotify("codesnap.start", true)
|
VSCodeNotify("codesnap.start", true)
|
||||||
end
|
end
|
||||||
|
|
||||||
function Comment_vis()
|
function Comment_vis()
|
||||||
VSCodeNotify("editor.action.commentLine", false)
|
VSCodeNotify("editor.action.commentLine", false)
|
||||||
end
|
end
|
||||||
|
|
||||||
function Toggle_breakpoint()
|
function Toggle_breakpoint()
|
||||||
VSCodeNotify("editor.debug.action.toggleBreakpoint")
|
VSCodeNotify("editor.debug.action.toggleBreakpoint")
|
||||||
end
|
end
|
||||||
|
|
||||||
function Copy_path()
|
function Copy_path()
|
||||||
VSCodeNotify("copyFilePath")
|
VSCodeNotify("copyFilePath")
|
||||||
end
|
end
|
||||||
|
|
||||||
function Copy_relative_path()
|
function Copy_relative_path()
|
||||||
VSCodeNotify("copyRelativeFilePath")
|
VSCodeNotify("copyRelativeFilePath")
|
||||||
end
|
end
|
||||||
|
|
||||||
function Active_whichkey()
|
function Active_whichkey()
|
||||||
VSCodeNotify("whichkey.show")
|
VSCodeNotify("whichkey.show")
|
||||||
end
|
end
|
||||||
|
|
||||||
function Navigation_down()
|
function Navigation_down()
|
||||||
VSCodeNotify("workbench.action.navigateDown")
|
VSCodeNotify("workbench.action.navigateDown")
|
||||||
end
|
end
|
||||||
|
|
||||||
function Navigation_up()
|
function Navigation_up()
|
||||||
VSCodeNotify("workbench.action.navigateUp")
|
VSCodeNotify("workbench.action.navigateUp")
|
||||||
end
|
end
|
||||||
|
|
||||||
function Navigation_left()
|
function Navigation_left()
|
||||||
VSCodeNotify("workbench.action.navigateLeft")
|
VSCodeNotify("workbench.action.navigateLeft")
|
||||||
end
|
end
|
||||||
|
|
||||||
function Navigation_right()
|
function Navigation_right()
|
||||||
VSCodeNotify("workbench.action.navigateRight")
|
VSCodeNotify("workbench.action.navigateRight")
|
||||||
end
|
end
|
||||||
|
|
||||||
function Select_all()
|
function Select_all()
|
||||||
VSCodeNotify("editor.action.selectAll")
|
VSCodeNotify("editor.action.selectAll")
|
||||||
end
|
end
|
||||||
|
|
||||||
function Copy_clipboard()
|
function Copy_clipboard()
|
||||||
VSCodeNotify("editor.action.clipboardCopyAction")
|
VSCodeNotify("editor.action.clipboardCopyAction")
|
||||||
end
|
end
|
||||||
|
|
||||||
function Paste_clipboard()
|
function Paste_clipboard()
|
||||||
VSCodeNotify("editor.action.clipboardPasteAction")
|
VSCodeNotify("editor.action.clipboardPasteAction")
|
||||||
end
|
end
|
||||||
|
|
||||||
function Save()
|
function Save()
|
||||||
VSCodeNotify("workbench.action.files.save")
|
VSCodeNotify("workbench.action.files.save")
|
||||||
VSCodeNotify("workbench.action.files.saveAll")
|
VSCodeNotify("workbench.action.files.saveAll")
|
||||||
end
|
end
|
||||||
|
|
||||||
function Close()
|
function Close()
|
||||||
VSCodeNotify("workbench.action.closeActiveEditor")
|
VSCodeNotify("workbench.action.closeActiveEditor")
|
||||||
end
|
end
|
||||||
|
|
|
@ -47,7 +47,7 @@ Map({ "n", "v" }, "zj", Git_stage_change)
|
||||||
-- Map({ "n", "v" }, "zb", Vscode_ctrl_u)
|
-- Map({ "n", "v" }, "zb", Vscode_ctrl_u)
|
||||||
|
|
||||||
vim.api.nvim_exec(
|
vim.api.nvim_exec(
|
||||||
[[
|
[[
|
||||||
" THEME CHANGER
|
" THEME CHANGER
|
||||||
function! SetCursorLineNrColorInsert(mode)
|
function! SetCursorLineNrColorInsert(mode)
|
||||||
" Insert mode: blue
|
" Insert mode: blue
|
||||||
|
@ -70,5 +70,5 @@ vim.api.nvim_exec(
|
||||||
autocmd ModeChanged [vV\x16]*:* call VSCodeNotify('nvim-theme.normal')
|
autocmd ModeChanged [vV\x16]*:* call VSCodeNotify('nvim-theme.normal')
|
||||||
augroup END
|
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
|
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||||
-- bootstrap lazy.nvim
|
-- bootstrap lazy.nvim
|
||||||
-- stylua: ignore
|
-- stylua: ignore
|
||||||
|
@ -15,8 +15,8 @@ local icons = require("user.icons").ui
|
||||||
vim.opt.rtp:prepend(vim.env.LAZY or lazypath)
|
vim.opt.rtp:prepend(vim.env.LAZY or lazypath)
|
||||||
vim.g.mapleader = " "
|
vim.g.mapleader = " "
|
||||||
vim.g.maplocalleader = " "
|
vim.g.maplocalleader = " "
|
||||||
vim.diagnostic.config { virtual_lines = false }
|
vim.diagnostic.config({ virtual_lines = false })
|
||||||
require("lazy").setup {
|
require("lazy").setup({
|
||||||
spec = {
|
spec = {
|
||||||
{ import = "plugins.themes" },
|
{ import = "plugins.themes" },
|
||||||
{ import = "plugins" },
|
{ import = "plugins" },
|
||||||
|
@ -57,4 +57,4 @@ require("lazy").setup {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
})
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
local transparent_mode = pcode.transparent_mode or 0
|
local transparent_mode = pcode.transparent_mode or 0
|
||||||
if transparent_mode ~= nil then
|
if transparent_mode ~= nil then
|
||||||
if transparent_mode == 1 then
|
if transparent_mode == 1 then
|
||||||
vim.cmd "TransparentDisable"
|
vim.cmd("TransparentDisable")
|
||||||
vim.cmd "TransparentEnable"
|
vim.cmd("TransparentEnable")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ local _get_folder_name = function()
|
||||||
return " " .. str:lower():gsub("^%l", string.upper) .. " "
|
return " " .. str:lower():gsub("^%l", string.upper) .. " "
|
||||||
end
|
end
|
||||||
|
|
||||||
local term_program = vim.fn.getenv "TERM_PROGRAM"
|
local term_program = vim.fn.getenv("TERM_PROGRAM")
|
||||||
if term_program == "WezTerm" then
|
if term_program == "WezTerm" then
|
||||||
-- vim.cmd('silent !wezterm cli set-tab-title "' .. _get_folder_name() .. '"')
|
-- vim.cmd('silent !wezterm cli set-tab-title "' .. _get_folder_name() .. '"')
|
||||||
-- create autocmd on insertEnter
|
-- create autocmd on insertEnter
|
||||||
|
|
|
@ -3,11 +3,11 @@
|
||||||
-- 2. Ubah dashboard sesuai keinginan dan kebutuhan
|
-- 2. Ubah dashboard sesuai keinginan dan kebutuhan
|
||||||
|
|
||||||
vim.g.pcode_header1 = {
|
vim.g.pcode_header1 = {
|
||||||
[[ _ __ __ ]],
|
[[ _ __ __ ]],
|
||||||
[[ ___ ___ (____ / /__ _______ ___/ ___ ]],
|
[[ ___ ___ (____ / /__ _______ ___/ ___ ]],
|
||||||
[[ / _ / _ \ / / _ \/ '_/ / __/ _ / _ / -_) ]],
|
[[ / _ / _ \ / / _ \/ '_/ / __/ _ / _ / -_) ]],
|
||||||
[[ / .__\_____/ /\___/_/\_\ \__/\___\_,_/\__/ ]],
|
[[ / .__\_____/ /\___/_/\_\ \__/\___\_,_/\__/ ]],
|
||||||
[[ /_/ |___/ ]],
|
[[ /_/ |___/ ]],
|
||||||
}
|
}
|
||||||
|
|
||||||
-- vim.g.pcode_header2 = {
|
-- vim.g.pcode_header2 = {
|
||||||
|
|
|
@ -2,10 +2,10 @@ local null_ls = require("null-ls")
|
||||||
local formatting = null_ls.builtins.formatting
|
local formatting = null_ls.builtins.formatting
|
||||||
local diagnostics = null_ls.builtins.diagnostics
|
local diagnostics = null_ls.builtins.diagnostics
|
||||||
local m = {
|
local m = {
|
||||||
sources = {
|
sources = {
|
||||||
formatting.stylua, -- tambahkan di bawah sini
|
formatting.stylua, -- tambahkan di bawah sini
|
||||||
--diagnostics.flake8, -- tambahkan di bawah sini
|
--diagnostics.flake8, -- tambahkan di bawah sini
|
||||||
--formatting.blade_formatter.with({ filetypes = { "blade", "php" } }),
|
--formatting.blade_formatter.with({ filetypes = { "blade", "php" } }),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
return m
|
return m
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
local opts, _ = pcall(require, "user.options")
|
local opts, _ = pcall(require, "user.options")
|
||||||
if opts then
|
if opts then
|
||||||
require "user.options"
|
require("user.options")
|
||||||
end
|
end
|
||||||
-- local key, _ = pcall(require, "user.keymaps")
|
-- local key, _ = pcall(require, "user.keymaps")
|
||||||
-- if key then
|
-- if key then
|
||||||
|
@ -8,11 +8,11 @@ end
|
||||||
-- end
|
-- end
|
||||||
local cmd, _ = pcall(require, "user.autocommands")
|
local cmd, _ = pcall(require, "user.autocommands")
|
||||||
if cmd then
|
if cmd then
|
||||||
require "user.autocommands"
|
require("user.autocommands")
|
||||||
end
|
end
|
||||||
local onsave, _ = pcall(require, "user.format_onsave")
|
local onsave, _ = pcall(require, "user.format_onsave")
|
||||||
if onsave then
|
if onsave then
|
||||||
require "user.format_onsave"
|
require("user.format_onsave")
|
||||||
end
|
end
|
||||||
vim.g.pcode_icons = require "user.icons"
|
vim.g.pcode_icons = require("user.icons")
|
||||||
return {}
|
return {}
|
||||||
|
|
|
@ -5,7 +5,7 @@ return {
|
||||||
lazy = true,
|
lazy = true,
|
||||||
event = "VimEnter",
|
event = "VimEnter",
|
||||||
config = function()
|
config = function()
|
||||||
require "user.alpha"
|
require("user.alpha")
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@ return {
|
||||||
dependencies = "neovim/nvim-lspconfig",
|
dependencies = "neovim/nvim-lspconfig",
|
||||||
event = "InsertEnter",
|
event = "InsertEnter",
|
||||||
config = function()
|
config = function()
|
||||||
require "user.breadcrumb"
|
require("user.breadcrumb")
|
||||||
require "user.winbar"
|
require("user.winbar")
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ return {
|
||||||
|
|
||||||
vim.opt.termguicolors = true
|
vim.opt.termguicolors = true
|
||||||
|
|
||||||
bufferline.setup {
|
bufferline.setup({
|
||||||
options = {
|
options = {
|
||||||
color_icons = true,
|
color_icons = true,
|
||||||
numbers = "none", -- | "ordinal" | "buffer_id" | "both" | function({ ordinal, id, lower, raise }): string,
|
numbers = "none", -- | "ordinal" | "buffer_id" | "both" | function({ ordinal, id, lower, raise }): string,
|
||||||
|
@ -174,6 +174,6 @@ return {
|
||||||
bg = { attribute = "bg", highlight = "Normal" },
|
bg = { attribute = "bg", highlight = "Normal" },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
})
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,12 +18,12 @@ return {
|
||||||
version = false, -- last release is way too old
|
version = false, -- last release is way too old
|
||||||
event = "InsertEnter",
|
event = "InsertEnter",
|
||||||
opts = function()
|
opts = function()
|
||||||
local cmp = require "cmp"
|
local cmp = require("cmp")
|
||||||
local luasnip = require "luasnip"
|
local luasnip = require("luasnip")
|
||||||
|
|
||||||
local check_backspace = function()
|
local check_backspace = function()
|
||||||
local col = vim.fn.col "." - 1
|
local col = vim.fn.col(".") - 1
|
||||||
return col == 0 or vim.fn.getline("."):sub(col, col):match "%s"
|
return col == 0 or vim.fn.getline("."):sub(col, col):match("%s")
|
||||||
end
|
end
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
@ -35,12 +35,12 @@ return {
|
||||||
require("luasnip").lsp_expand(args.body)
|
require("luasnip").lsp_expand(args.body)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
mapping = cmp.mapping.preset.insert {
|
mapping = cmp.mapping.preset.insert({
|
||||||
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
||||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||||
["<C-Space>"] = cmp.mapping.complete(),
|
["<C-Space>"] = cmp.mapping.complete(),
|
||||||
["<C-e>"] = cmp.mapping.abort(),
|
["<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)
|
["<Tab>"] = cmp.mapping(function(fallback)
|
||||||
if cmp.visible() then
|
if cmp.visible() then
|
||||||
cmp.select_next_item()
|
cmp.select_next_item()
|
||||||
|
@ -69,14 +69,14 @@ return {
|
||||||
"i",
|
"i",
|
||||||
"s",
|
"s",
|
||||||
}),
|
}),
|
||||||
},
|
}),
|
||||||
sources = cmp.config.sources {
|
sources = cmp.config.sources({
|
||||||
{ name = "nvim_lsp" },
|
{ name = "nvim_lsp" },
|
||||||
{ name = "luasnip" },
|
{ name = "luasnip" },
|
||||||
{ name = "buffer" },
|
{ name = "buffer" },
|
||||||
{ name = "path" },
|
{ name = "path" },
|
||||||
{ name = "nvim_lua" },
|
{ name = "nvim_lua" },
|
||||||
},
|
}),
|
||||||
formatting = {
|
formatting = {
|
||||||
fields = { "kind", "abbr", "menu" },
|
fields = { "kind", "abbr", "menu" },
|
||||||
format = function(entry, vim_item)
|
format = function(entry, vim_item)
|
||||||
|
|
|
@ -1,152 +1,152 @@
|
||||||
return {
|
return {
|
||||||
-- for auto complate commond mode
|
-- for auto complate commond mode
|
||||||
-- {
|
-- {
|
||||||
-- "gelguy/wilder.nvim",
|
-- "gelguy/wilder.nvim",
|
||||||
-- lazy = true,
|
-- lazy = true,
|
||||||
-- event = "VeryLazy",
|
-- event = "VeryLazy",
|
||||||
-- config = function()
|
-- config = function()
|
||||||
-- local wilder = require("wilder")
|
-- local wilder = require("wilder")
|
||||||
-- wilder.setup({ modes = { ":", "/", "?" } })
|
-- wilder.setup({ modes = { ":", "/", "?" } })
|
||||||
-- wilder.set_option(
|
-- wilder.set_option(
|
||||||
-- "renderer",
|
-- "renderer",
|
||||||
-- wilder.popupmenu_renderer({
|
-- wilder.popupmenu_renderer({
|
||||||
-- highlighter = wilder.basic_highlighter(),
|
-- highlighter = wilder.basic_highlighter(),
|
||||||
-- left = { " ", wilder.popupmenu_devicons() },
|
-- left = { " ", wilder.popupmenu_devicons() },
|
||||||
-- right = { " ", wilder.popupmenu_scrollbar() },
|
-- right = { " ", wilder.popupmenu_scrollbar() },
|
||||||
-- })
|
-- })
|
||||||
-- )
|
-- )
|
||||||
-- end,
|
-- end,
|
||||||
-- },
|
-- },
|
||||||
{
|
{
|
||||||
"folke/noice.nvim",
|
"folke/noice.nvim",
|
||||||
lazy = true,
|
lazy = true,
|
||||||
enabled = true,
|
enabled = true,
|
||||||
dependencies = {
|
dependencies = {
|
||||||
{ "MunifTanjim/nui.nvim" },
|
{ "MunifTanjim/nui.nvim" },
|
||||||
},
|
},
|
||||||
-- event = "BufWinEnter",
|
-- event = "BufWinEnter",
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
opts = {
|
opts = {
|
||||||
messages = {
|
messages = {
|
||||||
enabled = false,
|
enabled = false,
|
||||||
},
|
},
|
||||||
notify = {
|
notify = {
|
||||||
enabled = false,
|
enabled = false,
|
||||||
},
|
},
|
||||||
lsp = {
|
lsp = {
|
||||||
progress = {
|
progress = {
|
||||||
enabled = false,
|
enabled = false,
|
||||||
},
|
},
|
||||||
hover = {
|
hover = {
|
||||||
enabled = false,
|
enabled = false,
|
||||||
},
|
},
|
||||||
signature = {
|
signature = {
|
||||||
enabled = false,
|
enabled = false,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
keys = {
|
keys = {
|
||||||
{
|
{
|
||||||
"<S-Enter>",
|
"<S-Enter>",
|
||||||
function()
|
function()
|
||||||
require("noice").redirect(vim.fn.getcmdline())
|
require("noice").redirect(vim.fn.getcmdline())
|
||||||
end,
|
end,
|
||||||
mode = "c",
|
mode = "c",
|
||||||
desc = "Redirect Cmdline",
|
desc = "Redirect Cmdline",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"<leader>snl",
|
"<leader>snl",
|
||||||
function()
|
function()
|
||||||
require("noice").cmd("last")
|
require("noice").cmd("last")
|
||||||
end,
|
end,
|
||||||
desc = "Noice Last Message",
|
desc = "Noice Last Message",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"<leader>snh",
|
"<leader>snh",
|
||||||
function()
|
function()
|
||||||
require("noice").cmd("history")
|
require("noice").cmd("history")
|
||||||
end,
|
end,
|
||||||
desc = "Noice History",
|
desc = "Noice History",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"<leader>sna",
|
"<leader>sna",
|
||||||
function()
|
function()
|
||||||
require("noice").cmd("all")
|
require("noice").cmd("all")
|
||||||
end,
|
end,
|
||||||
desc = "Noice All",
|
desc = "Noice All",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"<c-f>",
|
"<c-f>",
|
||||||
function()
|
function()
|
||||||
if not require("noice.lsp").scroll(4) then
|
if not require("noice.lsp").scroll(4) then
|
||||||
return "<c-f>"
|
return "<c-f>"
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
silent = true,
|
silent = true,
|
||||||
expr = true,
|
expr = true,
|
||||||
desc = "Scroll forward",
|
desc = "Scroll forward",
|
||||||
mode = { "i", "n", "s" },
|
mode = { "i", "n", "s" },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"<c-b>",
|
"<c-b>",
|
||||||
function()
|
function()
|
||||||
if not require("noice.lsp").scroll(-4) then
|
if not require("noice.lsp").scroll(-4) then
|
||||||
return "<c-b>"
|
return "<c-b>"
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
silent = true,
|
silent = true,
|
||||||
expr = true,
|
expr = true,
|
||||||
desc = "Scroll backward",
|
desc = "Scroll backward",
|
||||||
mode = { "i", "n", "s" },
|
mode = { "i", "n", "s" },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"hrsh7th/cmp-cmdline",
|
"hrsh7th/cmp-cmdline",
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
config = function()
|
config = function()
|
||||||
local cmp = require("cmp")
|
local cmp = require("cmp")
|
||||||
local mapping = {
|
local mapping = {
|
||||||
["<CR>"] = cmp.mapping.confirm({ select = true }),
|
["<CR>"] = cmp.mapping.confirm({ select = true }),
|
||||||
["<Up>"] = cmp.mapping(cmp.mapping.select_prev_item(), { "i", "c" }),
|
["<Up>"] = cmp.mapping(cmp.mapping.select_prev_item(), { "i", "c" }),
|
||||||
["<S-Tab>"] = 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" }),
|
["<Down>"] = cmp.mapping(cmp.mapping.select_next_item(), { "i", "c" }),
|
||||||
["<Tab>"] = cmp.mapping(cmp.mapping.select_next_item(), { "i", "c" }),
|
["<Tab>"] = cmp.mapping(cmp.mapping.select_next_item(), { "i", "c" }),
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Use buffer source for `/`.
|
-- Use buffer source for `/`.
|
||||||
cmp.setup.cmdline("/", {
|
cmp.setup.cmdline("/", {
|
||||||
preselect = "none",
|
preselect = "none",
|
||||||
completion = {
|
completion = {
|
||||||
completeopt = "menu,preview,menuone,noselect",
|
completeopt = "menu,preview,menuone,noselect",
|
||||||
},
|
},
|
||||||
mapping = mapping,
|
mapping = mapping,
|
||||||
sources = {
|
sources = {
|
||||||
{ name = "buffer" },
|
{ name = "buffer" },
|
||||||
},
|
},
|
||||||
experimental = {
|
experimental = {
|
||||||
ghost_text = true,
|
ghost_text = true,
|
||||||
native_menu = false,
|
native_menu = false,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Use cmdline & path source for ':'.
|
-- Use cmdline & path source for ':'.
|
||||||
cmp.setup.cmdline(":", {
|
cmp.setup.cmdline(":", {
|
||||||
preselect = "none",
|
preselect = "none",
|
||||||
completion = {
|
completion = {
|
||||||
completeopt = "menu,preview,menuone,noselect",
|
completeopt = "menu,preview,menuone,noselect",
|
||||||
},
|
},
|
||||||
mapping = mapping,
|
mapping = mapping,
|
||||||
sources = cmp.config.sources({
|
sources = cmp.config.sources({
|
||||||
{ name = "path" },
|
{ name = "path" },
|
||||||
}, {
|
}, {
|
||||||
{ name = "cmdline" },
|
{ name = "cmdline" },
|
||||||
}),
|
}),
|
||||||
experimental = {
|
experimental = {
|
||||||
ghost_text = true,
|
ghost_text = true,
|
||||||
native_menu = false,
|
native_menu = false,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,54 +1,54 @@
|
||||||
--typescript = "deno run",
|
--typescript = "deno run",
|
||||||
-- cpp="gcc $fileName -lstdc++ -o $fileNameWithoutExt && $fileNameWithoutExt"
|
-- cpp="gcc $fileName -lstdc++ -o $fileNameWithoutExt && $fileNameWithoutExt"
|
||||||
local rfile = {
|
local rfile = {
|
||||||
java = "cd $dir && javac $fileName && java $fileNameWithoutExt",
|
java = "cd $dir && javac $fileName && java $fileNameWithoutExt",
|
||||||
python = "python3 -u",
|
python = "python3 -u",
|
||||||
typescript = "ts-node $dir/$fileName",
|
typescript = "ts-node $dir/$fileName",
|
||||||
rust = "cd $dir && rustc $fileName && $dir/$fileNameWithoutExt",
|
rust = "cd $dir && rustc $fileName && $dir/$fileNameWithoutExt",
|
||||||
cpp = "cd $dir && g++ $fileName -o $fileNameWithoutExt && $dir/$fileNameWithoutExt",
|
cpp = "cd $dir && g++ $fileName -o $fileNameWithoutExt && $dir/$fileNameWithoutExt",
|
||||||
scss = "sass $dir/$fileName $dir/$fileNameWithoutExt.css",
|
scss = "sass $dir/$fileName $dir/$fileNameWithoutExt.css",
|
||||||
javascript = 'node "$dir/$fileName"',
|
javascript = 'node "$dir/$fileName"',
|
||||||
}
|
}
|
||||||
|
|
||||||
local runscript = pcode.coderunner or {}
|
local runscript = pcode.coderunner or {}
|
||||||
rfile = vim.tbl_deep_extend("force", runscript, rfile)
|
rfile = vim.tbl_deep_extend("force", runscript, rfile)
|
||||||
return {
|
return {
|
||||||
"CRAG666/code_runner.nvim",
|
"CRAG666/code_runner.nvim",
|
||||||
lazy = true,
|
lazy = true,
|
||||||
cmd = { "RunCode", "RunFile", "RunProject", "RunClose" },
|
cmd = { "RunCode", "RunFile", "RunProject", "RunClose" },
|
||||||
opts = {
|
opts = {
|
||||||
-- put here the commands by filetype
|
-- put here the commands by filetype
|
||||||
filetype = rfile,
|
filetype = rfile,
|
||||||
-- mode = "term",
|
-- mode = "term",
|
||||||
mode = "float",
|
mode = "float",
|
||||||
focus = true,
|
focus = true,
|
||||||
startinsert = true,
|
startinsert = true,
|
||||||
term = {
|
term = {
|
||||||
--position = "vert",
|
--position = "vert",
|
||||||
position = "bot",
|
position = "bot",
|
||||||
size = 50,
|
size = 50,
|
||||||
},
|
},
|
||||||
float = {
|
float = {
|
||||||
-- Key that close the code_runner floating window
|
-- Key that close the code_runner floating window
|
||||||
close_key = "<ESC>",
|
close_key = "<ESC>",
|
||||||
-- Window border (see ':h nvim_open_win')
|
-- Window border (see ':h nvim_open_win')
|
||||||
border = "rounded",
|
border = "rounded",
|
||||||
|
|
||||||
-- Num from `0 - 1` for measurements
|
-- Num from `0 - 1` for measurements
|
||||||
height = 0.8,
|
height = 0.8,
|
||||||
width = 0.8,
|
width = 0.8,
|
||||||
x = 0.5,
|
x = 0.5,
|
||||||
y = 0.5,
|
y = 0.5,
|
||||||
|
|
||||||
-- Highlight group for floating window/border (see ':h winhl')
|
-- Highlight group for floating window/border (see ':h winhl')
|
||||||
border_hl = "FloatBorder",
|
border_hl = "FloatBorder",
|
||||||
float_hl = "Normal",
|
float_hl = "Normal",
|
||||||
|
|
||||||
-- Transparency (see ':h winblend')
|
-- Transparency (see ':h winblend')
|
||||||
blend = 0,
|
blend = 0,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
config = function(_, opts)
|
config = function(_, opts)
|
||||||
require("code_runner").setup(opts)
|
require("code_runner").setup(opts)
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,25 +1,25 @@
|
||||||
return {
|
return {
|
||||||
"NvChad/nvim-colorizer.lua",
|
"NvChad/nvim-colorizer.lua",
|
||||||
lazy = true,
|
lazy = true,
|
||||||
event = { "BufRead", "InsertEnter", "BufNewFile" },
|
event = { "BufRead", "InsertEnter", "BufNewFile" },
|
||||||
opts = {
|
opts = {
|
||||||
user_default_options = {
|
user_default_options = {
|
||||||
RGB = true, -- #RGB hex codes
|
RGB = true, -- #RGB hex codes
|
||||||
RRGGBB = true, -- #RRGGBB hex codes
|
RRGGBB = true, -- #RRGGBB hex codes
|
||||||
names = true, -- "Name" codes like Blue
|
names = true, -- "Name" codes like Blue
|
||||||
RRGGBBAA = true, -- #RRGGBBAA hex codes
|
RRGGBBAA = true, -- #RRGGBBAA hex codes
|
||||||
rgb_fn = true, -- CSS rgb() and rgba() functions
|
rgb_fn = true, -- CSS rgb() and rgba() functions
|
||||||
hsl_fn = true, -- CSS hsl() and hsla() functions
|
hsl_fn = true, -- CSS hsl() and hsla() functions
|
||||||
css = true, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB
|
css = true, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB
|
||||||
css_fn = true, -- Enable all CSS *functions*: rgb_fn, hsl_fn
|
css_fn = true, -- Enable all CSS *functions*: rgb_fn, hsl_fn
|
||||||
-- Available modes: foreground, background
|
-- Available modes: foreground, background
|
||||||
mode = "background", -- Set the display mode.
|
mode = "background", -- Set the display mode.
|
||||||
tailwind = true,
|
tailwind = true,
|
||||||
},
|
},
|
||||||
filetypes = {
|
filetypes = {
|
||||||
"*", -- Highlight all files, but customize some others.
|
"*", -- Highlight all files, but customize some others.
|
||||||
css = { rgb_fn = true }, -- Enable parsing rgb(...) functions in css.
|
css = { rgb_fn = true }, -- Enable parsing rgb(...) functions in css.
|
||||||
html = { names = false }, -- Disable parsing "names" like Blue or Gray
|
html = { names = false }, -- Disable parsing "names" like Blue or Gray
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
return {
|
return {
|
||||||
"numToStr/Comment.nvim",
|
"numToStr/Comment.nvim",
|
||||||
lazy = true,
|
lazy = true,
|
||||||
opts = function()
|
opts = function()
|
||||||
return {
|
return {
|
||||||
pre_hook = require("ts_context_commentstring.integrations.comment_nvim").create_pre_hook(),
|
pre_hook = require("ts_context_commentstring.integrations.comment_nvim").create_pre_hook(),
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
config = function(_, opts)
|
config = function(_, opts)
|
||||||
require("Comment").setup(opts)
|
require("Comment").setup(opts)
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,22 +1,22 @@
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"rcarriga/nvim-dap-ui",
|
"rcarriga/nvim-dap-ui",
|
||||||
lazy = true,
|
lazy = true,
|
||||||
event = "BufRead",
|
event = "BufRead",
|
||||||
dependencies = "mfussenegger/nvim-dap",
|
dependencies = "mfussenegger/nvim-dap",
|
||||||
enabled = vim.fn.has("win32") == 0,
|
enabled = vim.fn.has("win32") == 0,
|
||||||
config = function()
|
config = function()
|
||||||
require("user.dapui")
|
require("user.dapui")
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"jay-babu/mason-nvim-dap.nvim",
|
"jay-babu/mason-nvim-dap.nvim",
|
||||||
lazy = true,
|
lazy = true,
|
||||||
event = "BufRead",
|
event = "BufRead",
|
||||||
dependencies = { "williamboman/mason.nvim", "mfussenegger/nvim-dap" },
|
dependencies = { "williamboman/mason.nvim", "mfussenegger/nvim-dap" },
|
||||||
enabled = vim.fn.has("win32") == 0,
|
enabled = vim.fn.has("win32") == 0,
|
||||||
config = function()
|
config = function()
|
||||||
require("user.mason_dap")
|
require("user.mason_dap")
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,11 +14,11 @@ if pcode.database then
|
||||||
end,
|
end,
|
||||||
config = function()
|
config = function()
|
||||||
local function db_completion()
|
local function db_completion()
|
||||||
require("cmp").setup.buffer {
|
require("cmp").setup.buffer({
|
||||||
sources = { { name = "vim-dadbod-completion" } },
|
sources = { { name = "vim-dadbod-completion" } },
|
||||||
}
|
})
|
||||||
end
|
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", {
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
pattern = {
|
pattern = {
|
||||||
|
|
|
@ -1,34 +1,34 @@
|
||||||
return {
|
return {
|
||||||
"stevearc/dressing.nvim",
|
"stevearc/dressing.nvim",
|
||||||
lazy = true,
|
lazy = true,
|
||||||
init = function()
|
init = function()
|
||||||
---@diagnostic disable-next-line: duplicate-set-field
|
---@diagnostic disable-next-line: duplicate-set-field
|
||||||
vim.ui.select = function(...)
|
vim.ui.select = function(...)
|
||||||
require("lazy").load({ plugins = { "dressing.nvim" } })
|
require("lazy").load({ plugins = { "dressing.nvim" } })
|
||||||
return vim.ui.select(...)
|
return vim.ui.select(...)
|
||||||
end
|
end
|
||||||
---@diagnostic disable-next-line: duplicate-set-field
|
---@diagnostic disable-next-line: duplicate-set-field
|
||||||
vim.ui.input = function(...)
|
vim.ui.input = function(...)
|
||||||
require("lazy").load({ plugins = { "dressing.nvim" } })
|
require("lazy").load({ plugins = { "dressing.nvim" } })
|
||||||
return vim.ui.input(...)
|
return vim.ui.input(...)
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
opts = {
|
opts = {
|
||||||
input = {
|
input = {
|
||||||
title_pos = "center",
|
title_pos = "center",
|
||||||
relative = "editor",
|
relative = "editor",
|
||||||
default_prompt = "➤ ",
|
default_prompt = "➤ ",
|
||||||
win_options = { winhighlight = "Normal:Normal,NormalNC:Normal" },
|
win_options = { winhighlight = "Normal:Normal,NormalNC:Normal" },
|
||||||
prefer_width = 30,
|
prefer_width = 30,
|
||||||
max_width = { 140, 0.9 },
|
max_width = { 140, 0.9 },
|
||||||
min_width = { 50, 0.2 },
|
min_width = { 50, 0.2 },
|
||||||
},
|
},
|
||||||
select = {
|
select = {
|
||||||
backend = { "telescope", "builtin" },
|
backend = { "telescope", "builtin" },
|
||||||
builtin = { win_options = { winhighlight = "Normal:Normal,NormalNC:Normal" } },
|
builtin = { win_options = { winhighlight = "Normal:Normal,NormalNC:Normal" } },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
config = function(_, opts)
|
config = function(_, opts)
|
||||||
require("dressing").setup(opts)
|
require("dressing").setup(opts)
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,75 +1,75 @@
|
||||||
local icons = vim.g.pcode_icons
|
local icons = vim.g.pcode_icons
|
||||||
return {
|
return {
|
||||||
"lewis6991/gitsigns.nvim",
|
"lewis6991/gitsigns.nvim",
|
||||||
lazy = true,
|
lazy = true,
|
||||||
enabled = vim.fn.executable("git") == 1,
|
enabled = vim.fn.executable("git") == 1,
|
||||||
ft = "gitcommit",
|
ft = "gitcommit",
|
||||||
event = "BufRead",
|
event = "BufRead",
|
||||||
opts = {
|
opts = {
|
||||||
signs = {
|
signs = {
|
||||||
add = {
|
add = {
|
||||||
hl = "GitSignsAdd",
|
hl = "GitSignsAdd",
|
||||||
text = icons.ui.BoldLineLeft,
|
text = icons.ui.BoldLineLeft,
|
||||||
numhl = "GitSignsAddNr",
|
numhl = "GitSignsAddNr",
|
||||||
linehl = "GitSignsAddLn",
|
linehl = "GitSignsAddLn",
|
||||||
},
|
},
|
||||||
change = {
|
change = {
|
||||||
hl = "GitSignsChange",
|
hl = "GitSignsChange",
|
||||||
text = icons.ui.BoldLineLeft,
|
text = icons.ui.BoldLineLeft,
|
||||||
numhl = "GitSignsChangeNr",
|
numhl = "GitSignsChangeNr",
|
||||||
linehl = "GitSignsChangeLn",
|
linehl = "GitSignsChangeLn",
|
||||||
},
|
},
|
||||||
delete = {
|
delete = {
|
||||||
hl = "GitSignsDelete",
|
hl = "GitSignsDelete",
|
||||||
text = icons.ui.Triangle,
|
text = icons.ui.Triangle,
|
||||||
numhl = "GitSignsDeleteNr",
|
numhl = "GitSignsDeleteNr",
|
||||||
linehl = "GitSignsDeleteLn",
|
linehl = "GitSignsDeleteLn",
|
||||||
},
|
},
|
||||||
topdelete = {
|
topdelete = {
|
||||||
hl = "GitSignsDelete",
|
hl = "GitSignsDelete",
|
||||||
text = icons.ui.Triangle,
|
text = icons.ui.Triangle,
|
||||||
numhl = "GitSignsDeleteNr",
|
numhl = "GitSignsDeleteNr",
|
||||||
linehl = "GitSignsDeleteLn",
|
linehl = "GitSignsDeleteLn",
|
||||||
},
|
},
|
||||||
changedelete = {
|
changedelete = {
|
||||||
hl = "GitSignsChange",
|
hl = "GitSignsChange",
|
||||||
text = icons.ui.BoldLineLeft,
|
text = icons.ui.BoldLineLeft,
|
||||||
numhl = "GitSignsChangeNr",
|
numhl = "GitSignsChangeNr",
|
||||||
linehl = "GitSignsChangeLn",
|
linehl = "GitSignsChangeLn",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
signcolumn = true,
|
signcolumn = true,
|
||||||
numhl = false,
|
numhl = false,
|
||||||
linehl = false,
|
linehl = false,
|
||||||
word_diff = false,
|
word_diff = false,
|
||||||
watch_gitdir = {
|
watch_gitdir = {
|
||||||
interval = 1000,
|
interval = 1000,
|
||||||
follow_files = true,
|
follow_files = true,
|
||||||
},
|
},
|
||||||
attach_to_untracked = true,
|
attach_to_untracked = true,
|
||||||
current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
|
current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
|
||||||
current_line_blame_opts = {
|
current_line_blame_opts = {
|
||||||
virt_text = true,
|
virt_text = true,
|
||||||
virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align'
|
virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align'
|
||||||
delay = 1000,
|
delay = 1000,
|
||||||
ignore_whitespace = false,
|
ignore_whitespace = false,
|
||||||
},
|
},
|
||||||
current_line_blame_formatter = "<author>, <author_time:%Y-%m-%d> - <summary>",
|
current_line_blame_formatter = "<author>, <author_time:%Y-%m-%d> - <summary>",
|
||||||
sign_priority = 6,
|
sign_priority = 6,
|
||||||
status_formatter = nil, -- Use default
|
status_formatter = nil, -- Use default
|
||||||
update_debounce = 200,
|
update_debounce = 200,
|
||||||
max_file_length = 40000,
|
max_file_length = 40000,
|
||||||
preview_config = {
|
preview_config = {
|
||||||
-- Options passed to nvim_open_win
|
-- Options passed to nvim_open_win
|
||||||
border = "rounded",
|
border = "rounded",
|
||||||
style = "minimal",
|
style = "minimal",
|
||||||
relative = "cursor",
|
relative = "cursor",
|
||||||
row = 0,
|
row = 0,
|
||||||
col = 1,
|
col = 1,
|
||||||
},
|
},
|
||||||
yadm = { enable = false },
|
yadm = { enable = false },
|
||||||
},
|
},
|
||||||
config = function(_, opts)
|
config = function(_, opts)
|
||||||
require("gitsigns").setup(opts)
|
require("gitsigns").setup(opts)
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,39 +1,39 @@
|
||||||
return {
|
return {
|
||||||
"lukas-reineke/indent-blankline.nvim",
|
"lukas-reineke/indent-blankline.nvim",
|
||||||
-- version = "3.5.4",
|
-- version = "3.5.4",
|
||||||
event = { "BufRead", "InsertEnter", "BufNewFile" },
|
event = { "BufRead", "InsertEnter", "BufNewFile" },
|
||||||
lazy = true,
|
lazy = true,
|
||||||
opts = {
|
opts = {
|
||||||
indent = {
|
indent = {
|
||||||
char = "│",
|
char = "│",
|
||||||
tab_char = "│",
|
tab_char = "│",
|
||||||
},
|
},
|
||||||
scope = { enabled = false },
|
scope = { enabled = false },
|
||||||
exclude = {
|
exclude = {
|
||||||
buftypes = {
|
buftypes = {
|
||||||
"nofile",
|
"nofile",
|
||||||
"prompt",
|
"prompt",
|
||||||
"quickfix",
|
"quickfix",
|
||||||
"terminal",
|
"terminal",
|
||||||
},
|
},
|
||||||
filetypes = {
|
filetypes = {
|
||||||
"help",
|
"help",
|
||||||
"alpha",
|
"alpha",
|
||||||
"dashboard",
|
"dashboard",
|
||||||
"neo-tree",
|
"neo-tree",
|
||||||
"Trouble",
|
"Trouble",
|
||||||
"trouble",
|
"trouble",
|
||||||
"lazy",
|
"lazy",
|
||||||
"mason",
|
"mason",
|
||||||
"notify",
|
"notify",
|
||||||
"toggleterm",
|
"toggleterm",
|
||||||
"lazyterm",
|
"lazyterm",
|
||||||
"NvimTree",
|
"NvimTree",
|
||||||
"aerial",
|
"aerial",
|
||||||
"neogitstatus",
|
"neogitstatus",
|
||||||
"startify",
|
"startify",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
main = "ibl",
|
main = "ibl",
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,48 +1,48 @@
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
lazy = true,
|
lazy = true,
|
||||||
event = "BufRead",
|
event = "BufRead",
|
||||||
cmd = {
|
cmd = {
|
||||||
"LspInfo",
|
"LspInfo",
|
||||||
"LspInstall",
|
"LspInstall",
|
||||||
"LspUninstall",
|
"LspUninstall",
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
require("lspconfig.ui.windows").default_options.border = "rounded"
|
require("lspconfig.ui.windows").default_options.border = "rounded"
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"williamboman/mason.nvim",
|
"williamboman/mason.nvim",
|
||||||
lazy = true,
|
lazy = true,
|
||||||
dependencies = { "williamboman/mason-lspconfig.nvim" },
|
dependencies = { "williamboman/mason-lspconfig.nvim" },
|
||||||
cmd = {
|
cmd = {
|
||||||
"Mason",
|
"Mason",
|
||||||
"MasonInstall",
|
"MasonInstall",
|
||||||
"MasonUninstall",
|
"MasonUninstall",
|
||||||
"MasonUninstallAll",
|
"MasonUninstallAll",
|
||||||
"MasonLog",
|
"MasonLog",
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
require("user.lsp")
|
require("user.lsp")
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"jayp0521/mason-null-ls.nvim",
|
"jayp0521/mason-null-ls.nvim",
|
||||||
lazy = true,
|
lazy = true,
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"nvimtools/none-ls.nvim",
|
"nvimtools/none-ls.nvim",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"nvimtools/none-ls-extras.nvim",
|
"nvimtools/none-ls-extras.nvim",
|
||||||
lazy = true,
|
lazy = true,
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
require("user.lsp.null-lscfg")
|
require("user.lsp.null-lscfg")
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
event = "InsertEnter",
|
event = "InsertEnter",
|
||||||
opts = function()
|
opts = function()
|
||||||
require("user.mason-null-ls")
|
require("user.mason-null-ls")
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,12 +41,12 @@ if fidget then
|
||||||
tag = "legacy",
|
tag = "legacy",
|
||||||
event = "BufRead",
|
event = "BufRead",
|
||||||
config = function()
|
config = function()
|
||||||
require("fidget").setup {
|
require("fidget").setup({
|
||||||
window = {
|
window = {
|
||||||
blend = 0,
|
blend = 0,
|
||||||
relative = "editor",
|
relative = "editor",
|
||||||
},
|
},
|
||||||
}
|
})
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
elseif lualine then
|
elseif lualine then
|
||||||
|
@ -57,7 +57,7 @@ elseif lualine then
|
||||||
branch = "main",
|
branch = "main",
|
||||||
event = { "BufRead" },
|
event = { "BufRead" },
|
||||||
config = function()
|
config = function()
|
||||||
require("lsp-progress").setup {
|
require("lsp-progress").setup({
|
||||||
client_format = function(client_name, spinner, series_messages)
|
client_format = function(client_name, spinner, series_messages)
|
||||||
return #series_messages > 0
|
return #series_messages > 0
|
||||||
and (spinner .. " " .. ambilKataDariKiri(table.concat(series_messages, ", "), 4) .. "...")
|
and (spinner .. " " .. ambilKataDariKiri(table.concat(series_messages, ", "), 4) .. "...")
|
||||||
|
@ -69,7 +69,7 @@ elseif lualine then
|
||||||
and (sign .. " " .. ambilKataDariKiri(table.concat(client_messages, " "), 4) .. "...")
|
and (sign .. " " .. ambilKataDariKiri(table.concat(client_messages, " "), 4) .. "...")
|
||||||
or sign
|
or sign
|
||||||
end,
|
end,
|
||||||
}
|
})
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -3,7 +3,7 @@ return {
|
||||||
"nvim-lualine/lualine.nvim",
|
"nvim-lualine/lualine.nvim",
|
||||||
event = { "InsertEnter", "BufRead", "BufNewFile" },
|
event = { "InsertEnter", "BufRead", "BufNewFile" },
|
||||||
config = function()
|
config = function()
|
||||||
local component = require "user.utils.lualine_component"
|
local component = require("user.utils.lualine_component")
|
||||||
local colors = component.colors
|
local colors = component.colors
|
||||||
|
|
||||||
-- check config for theme
|
-- check config for theme
|
||||||
|
@ -43,7 +43,7 @@ return {
|
||||||
bubbles_theme = vim.fn.fnamemodify("auto", ":t")
|
bubbles_theme = vim.fn.fnamemodify("auto", ":t")
|
||||||
end
|
end
|
||||||
|
|
||||||
local gettheme = require "user.utils.lualine_template"
|
local gettheme = require("user.utils.lualine_template")
|
||||||
local theme_option = pcode.lualinetheme or "rounded"
|
local theme_option = pcode.lualinetheme or "rounded"
|
||||||
local theme = gettheme.rounded(bubbles_theme)
|
local theme = gettheme.rounded(bubbles_theme)
|
||||||
if theme_option == "rounded" then
|
if theme_option == "rounded" then
|
||||||
|
@ -61,13 +61,13 @@ return {
|
||||||
elseif theme_option == "default" then
|
elseif theme_option == "default" then
|
||||||
theme = {}
|
theme = {}
|
||||||
end
|
end
|
||||||
require("lualine").setup {
|
require("lualine").setup({
|
||||||
options = theme.options,
|
options = theme.options,
|
||||||
sections = theme.sections,
|
sections = theme.sections,
|
||||||
inactive_sections = theme.inactive_sections,
|
inactive_sections = theme.inactive_sections,
|
||||||
tabline = theme.tabline,
|
tabline = theme.tabline,
|
||||||
extensions = theme.extensions,
|
extensions = theme.extensions,
|
||||||
}
|
})
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@ if not vim.g.neovide and pcode.minianimate and true or false then
|
||||||
opts = function()
|
opts = function()
|
||||||
-- don't use animate when scrolling with the mouse
|
-- don't use animate when scrolling with the mouse
|
||||||
local mouse_scrolled = false
|
local mouse_scrolled = false
|
||||||
for _, scroll in ipairs { "Up", "Down" } do
|
for _, scroll in ipairs({ "Up", "Down" }) do
|
||||||
local key = "<ScrollWheel" .. scroll .. ">"
|
local key = "<ScrollWheel" .. scroll .. ">"
|
||||||
vim.keymap.set({ "", "i" }, key, function()
|
vim.keymap.set({ "", "i" }, key, function()
|
||||||
mouse_scrolled = true
|
mouse_scrolled = true
|
||||||
|
@ -16,14 +16,14 @@ if not vim.g.neovide and pcode.minianimate and true or false then
|
||||||
end, { expr = true })
|
end, { expr = true })
|
||||||
end
|
end
|
||||||
|
|
||||||
local animate = require "mini.animate"
|
local animate = require("mini.animate")
|
||||||
return {
|
return {
|
||||||
resize = {
|
resize = {
|
||||||
timing = animate.gen_timing.linear { duration = 100, unit = "total" },
|
timing = animate.gen_timing.linear({ duration = 100, unit = "total" }),
|
||||||
},
|
},
|
||||||
scroll = {
|
scroll = {
|
||||||
timing = animate.gen_timing.linear { duration = 150, unit = "total" },
|
timing = animate.gen_timing.linear({ duration = 150, unit = "total" }),
|
||||||
subscroll = animate.gen_subscroll.equal {
|
subscroll = animate.gen_subscroll.equal({
|
||||||
predicate = function(total_scroll)
|
predicate = function(total_scroll)
|
||||||
if mouse_scrolled then
|
if mouse_scrolled then
|
||||||
mouse_scrolled = false
|
mouse_scrolled = false
|
||||||
|
@ -31,7 +31,7 @@ if not vim.g.neovide and pcode.minianimate and true or false then
|
||||||
end
|
end
|
||||||
return total_scroll > 1
|
return total_scroll > 1
|
||||||
end,
|
end,
|
||||||
},
|
}),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
|
|
|
@ -3,6 +3,6 @@ return {
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
lazy = true,
|
lazy = true,
|
||||||
config = function()
|
config = function()
|
||||||
require("neoscroll").setup {}
|
require("neoscroll").setup({})
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ return {
|
||||||
{
|
{
|
||||||
"<leader>un",
|
"<leader>un",
|
||||||
function()
|
function()
|
||||||
require("notify").dismiss { silent = true, pending = true }
|
require("notify").dismiss({ silent = true, pending = true })
|
||||||
end,
|
end,
|
||||||
desc = "Delete all Notifications",
|
desc = "Delete all Notifications",
|
||||||
},
|
},
|
||||||
|
@ -22,10 +22,10 @@ return {
|
||||||
},
|
},
|
||||||
-- event = "BufWinEnter",
|
-- event = "BufWinEnter",
|
||||||
config = function()
|
config = function()
|
||||||
local notify = require "notify"
|
local notify = require("notify")
|
||||||
-- this for transparency
|
-- this for transparency
|
||||||
-- notify.setup { background_colour = "#000000", render = "compact" }
|
-- notify.setup { background_colour = "#000000", render = "compact" }
|
||||||
notify.setup { render = "compact" }
|
notify.setup({ render = "compact" })
|
||||||
-- this overwrites the vim notify function
|
-- this overwrites the vim notify function
|
||||||
vim.notify = notify.notify
|
vim.notify = notify.notify
|
||||||
end,
|
end,
|
||||||
|
|
|
@ -210,7 +210,7 @@ return {
|
||||||
},
|
},
|
||||||
config = function(_, opts)
|
config = function(_, opts)
|
||||||
require("nvim-tree").setup(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)
|
api.events.subscribe(api.events.Event.FileCreated, function(file)
|
||||||
vim.cmd("edit " .. file.fname)
|
vim.cmd("edit " .. file.fname)
|
||||||
end)
|
end)
|
||||||
|
|
|
@ -20,8 +20,8 @@ if pcode.nvimufo then
|
||||||
{
|
{
|
||||||
"luukvbaal/statuscol.nvim",
|
"luukvbaal/statuscol.nvim",
|
||||||
config = function()
|
config = function()
|
||||||
local builtin = require "statuscol.builtin"
|
local builtin = require("statuscol.builtin")
|
||||||
require("statuscol").setup {
|
require("statuscol").setup({
|
||||||
setopt = true,
|
setopt = true,
|
||||||
relculright = true,
|
relculright = true,
|
||||||
segments = {
|
segments = {
|
||||||
|
@ -33,7 +33,7 @@ if pcode.nvimufo then
|
||||||
},
|
},
|
||||||
{ text = { builtin.lnumfunc, " " }, click = "v:lua.ScLa" },
|
{ text = { builtin.lnumfunc, " " }, click = "v:lua.ScLa" },
|
||||||
},
|
},
|
||||||
}
|
})
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -65,7 +65,7 @@ if pcode.nvimufo then
|
||||||
-- these are "extra", change them as you like
|
-- these are "extra", change them as you like
|
||||||
vim.keymap.set("n", "zR", require("ufo").openAllFolds)
|
vim.keymap.set("n", "zR", require("ufo").openAllFolds)
|
||||||
vim.keymap.set("n", "zM", require("ufo").closeAllFolds)
|
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
|
-- start ini bagian code support comment dan import
|
||||||
local ftMap = {
|
local ftMap = {
|
||||||
vim = "indent",
|
vim = "indent",
|
||||||
|
@ -75,7 +75,7 @@ if pcode.nvimufo then
|
||||||
|
|
||||||
local function customizeSelector(bufnr)
|
local function customizeSelector(bufnr)
|
||||||
local function handleFallbackException(err, providerName)
|
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)
|
return require("ufo").getFolds(bufnr, providerName)
|
||||||
else
|
else
|
||||||
return require("promise").reject(err)
|
return require("promise").reject(err)
|
||||||
|
@ -92,7 +92,7 @@ if pcode.nvimufo then
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
require("ufo").setup {
|
require("ufo").setup({
|
||||||
open_fold_hl_timeout = 150,
|
open_fold_hl_timeout = 150,
|
||||||
close_fold_kinds_for_ft = {
|
close_fold_kinds_for_ft = {
|
||||||
-- default = { "imports", "comment" },
|
-- default = { "imports", "comment" },
|
||||||
|
@ -127,21 +127,21 @@ if pcode.nvimufo then
|
||||||
-- Memeriksa apakah baris awal dari fold adalah komentar
|
-- Memeriksa apakah baris awal dari fold adalah komentar
|
||||||
local start_line = vim.api.nvim_buf_get_lines(0, lnum - 1, lnum, false)[1]
|
local start_line = vim.api.nvim_buf_get_lines(0, lnum - 1, lnum, false)[1]
|
||||||
-- cari comentar dengan awalan /* untuk generaal comment
|
-- cari comentar dengan awalan /* untuk generaal comment
|
||||||
if start_line:find "^%s*%/%*" then
|
if start_line:find("^%s*%/%*") then
|
||||||
is_comment = true
|
is_comment = true
|
||||||
-- cara commentar dengan awalan <!-- untuk html
|
-- cara commentar dengan awalan <!-- untuk html
|
||||||
elseif start_line:find "^%s*<!--" then
|
elseif start_line:find("^%s*<!--") then
|
||||||
is_comment = true
|
is_comment = true
|
||||||
-- cari comentar dengan awalan -- untuk lua
|
-- cari comentar dengan awalan -- untuk lua
|
||||||
elseif start_line:find "^%s*%-%-" then
|
elseif start_line:find("^%s*%-%-") then
|
||||||
is_comment = true
|
is_comment = true
|
||||||
end
|
end
|
||||||
-- cek fold yang berawalan import
|
-- cek fold yang berawalan import
|
||||||
if start_line:find "^%s*import" then
|
if start_line:find("^%s*import") then
|
||||||
is_import = true
|
is_import = true
|
||||||
end
|
end
|
||||||
-- cek fold dengan akhiran {
|
-- cek fold dengan akhiran {
|
||||||
if start_line:find "%s*{%s*$" then
|
if start_line:find("%s*{%s*$") then
|
||||||
is_bracket = true
|
is_bracket = true
|
||||||
end
|
end
|
||||||
if is_comment then
|
if is_comment then
|
||||||
|
@ -221,7 +221,7 @@ if pcode.nvimufo then
|
||||||
end
|
end
|
||||||
return result
|
return result
|
||||||
end,
|
end,
|
||||||
}
|
})
|
||||||
-- end bagian code support comment dan import
|
-- end bagian code support comment dan import
|
||||||
vim.api.nvim_create_autocmd("FileType", {
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
pattern = {
|
pattern = {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
return {
|
return {
|
||||||
"nvim-lua/plenary.nvim",
|
"nvim-lua/plenary.nvim",
|
||||||
lazy = true,
|
lazy = true,
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@ return {
|
||||||
event = "BufRead",
|
event = "BufRead",
|
||||||
config = function()
|
config = function()
|
||||||
-- Modul ini berisi beberapa definisi default
|
-- Modul ini berisi beberapa definisi default
|
||||||
local rainbow_delimiters = require "rainbow-delimiters"
|
local rainbow_delimiters = require("rainbow-delimiters")
|
||||||
vim.g.rainbow_delimiters = {
|
vim.g.rainbow_delimiters = {
|
||||||
strategy = {
|
strategy = {
|
||||||
[""] = rainbow_delimiters.strategy["global"],
|
[""] = rainbow_delimiters.strategy["global"],
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
return {
|
return {
|
||||||
"dstein64/nvim-scrollview",
|
"dstein64/nvim-scrollview",
|
||||||
lazy = true,
|
lazy = true,
|
||||||
event = { "BufRead", "InsertEnter", "BufNewFile" },
|
event = { "BufRead", "InsertEnter", "BufNewFile" },
|
||||||
opts = {
|
opts = {
|
||||||
bg = "LightCyan",
|
bg = "LightCyan",
|
||||||
ctermbg = 160,
|
ctermbg = 160,
|
||||||
},
|
},
|
||||||
config = function(_, opts)
|
config = function(_, opts)
|
||||||
require("scrollview").setup(opts)
|
require("scrollview").setup(opts)
|
||||||
vim.g.scrollview_excluded_filetypes = { "NvimTree", "vista_kind", "Outline", "neo-tree" }
|
vim.g.scrollview_excluded_filetypes = { "NvimTree", "vista_kind", "Outline", "neo-tree" }
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,21 +1,21 @@
|
||||||
return {
|
return {
|
||||||
"mrjones2014/smart-splits.nvim",
|
"mrjones2014/smart-splits.nvim",
|
||||||
lazy = true,
|
lazy = true,
|
||||||
event = { "BufRead", "InsertEnter", "BufNewFile" },
|
event = { "BufRead", "InsertEnter", "BufNewFile" },
|
||||||
opts = {
|
opts = {
|
||||||
ignored_filetypes = {
|
ignored_filetypes = {
|
||||||
"nofile",
|
"nofile",
|
||||||
"quickfix",
|
"quickfix",
|
||||||
"qf",
|
"qf",
|
||||||
"prompt",
|
"prompt",
|
||||||
},
|
},
|
||||||
ignored_buftypes = { "nofile" },
|
ignored_buftypes = { "nofile" },
|
||||||
},
|
},
|
||||||
config = function(_, opts)
|
config = function(_, opts)
|
||||||
require("smart-splits").setup(opts)
|
require("smart-splits").setup(opts)
|
||||||
vim.keymap.set("n", "<C-Left>", require("smart-splits").resize_left)
|
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-Down>", require("smart-splits").resize_down)
|
||||||
vim.keymap.set("n", "<C-Up", require("smart-splits").resize_up)
|
vim.keymap.set("n", "<C-Up", require("smart-splits").resize_up)
|
||||||
vim.keymap.set("n", "<C-Right>", require("smart-splits").resize_right)
|
vim.keymap.set("n", "<C-Right>", require("smart-splits").resize_right)
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,25 +1,25 @@
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"rafamadriz/friendly-snippets",
|
"rafamadriz/friendly-snippets",
|
||||||
event = "InsertEnter",
|
event = "InsertEnter",
|
||||||
lazy = true,
|
lazy = true,
|
||||||
config = function()
|
config = function()
|
||||||
require("luasnip.loaders.from_vscode").lazy_load()
|
require("luasnip.loaders.from_vscode").lazy_load()
|
||||||
require("user.snippets")
|
require("user.snippets")
|
||||||
require("user.snip")
|
require("user.snip")
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"L3MON4D3/LuaSnip",
|
"L3MON4D3/LuaSnip",
|
||||||
lazy = true,
|
lazy = true,
|
||||||
opts = {
|
opts = {
|
||||||
history = true,
|
history = true,
|
||||||
delete_check_events = "TextChanged",
|
delete_check_events = "TextChanged",
|
||||||
},
|
},
|
||||||
-- stylua: ignore
|
-- stylua: ignore
|
||||||
keys = {
|
keys = {
|
||||||
{ "<tab>", function() require("luasnip").jump(1) end, mode = "s" },
|
{ "<tab>", function() require("luasnip").jump(1) end, mode = "s" },
|
||||||
{ "<s-tab>", function() require("luasnip").jump(-1) end, mode = { "i", "s" } },
|
{ "<s-tab>", function() require("luasnip").jump(-1) end, mode = { "i", "s" } },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@ return {
|
||||||
only_sort_text = true,
|
only_sort_text = true,
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
local actions = require "telescope.actions"
|
local actions = require("telescope.actions")
|
||||||
vim.g.theme_switcher_loaded = true
|
vim.g.theme_switcher_loaded = true
|
||||||
return {
|
return {
|
||||||
defaults = {
|
defaults = {
|
||||||
|
|
|
@ -1,49 +1,49 @@
|
||||||
return {
|
return {
|
||||||
"akinsho/toggleterm.nvim",
|
"akinsho/toggleterm.nvim",
|
||||||
lazy = true,
|
lazy = true,
|
||||||
cmd = {
|
cmd = {
|
||||||
"ToggleTerm",
|
"ToggleTerm",
|
||||||
"TermExec",
|
"TermExec",
|
||||||
"ToggleTermToggleAll",
|
"ToggleTermToggleAll",
|
||||||
"ToggleTermSendCurrentLine",
|
"ToggleTermSendCurrentLine",
|
||||||
"ToggleTermSendVisualLines",
|
"ToggleTermSendVisualLines",
|
||||||
"ToggleTermSendVisualSelection",
|
"ToggleTermSendVisualSelection",
|
||||||
},
|
},
|
||||||
branch = "main",
|
branch = "main",
|
||||||
enabled = true,
|
enabled = true,
|
||||||
opts = {
|
opts = {
|
||||||
size = 20,
|
size = 20,
|
||||||
open_mapping = [[<c-\>]],
|
open_mapping = [[<c-\>]],
|
||||||
hide_numbers = true,
|
hide_numbers = true,
|
||||||
shade_filetypes = {},
|
shade_filetypes = {},
|
||||||
shade_terminals = true,
|
shade_terminals = true,
|
||||||
shading_factor = 2,
|
shading_factor = 2,
|
||||||
start_in_insert = true,
|
start_in_insert = true,
|
||||||
insert_mappings = true,
|
insert_mappings = true,
|
||||||
persist_size = true,
|
persist_size = true,
|
||||||
direction = "float",
|
direction = "float",
|
||||||
close_on_exit = true,
|
close_on_exit = true,
|
||||||
shell = vim.o.shell,
|
shell = vim.o.shell,
|
||||||
float_opts = {
|
float_opts = {
|
||||||
border = "curved",
|
border = "curved",
|
||||||
winblend = 0,
|
winblend = 0,
|
||||||
highlights = {
|
highlights = {
|
||||||
border = "Normal",
|
border = "Normal",
|
||||||
background = "Normal",
|
background = "Normal",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
config = function(_, opts)
|
config = function(_, opts)
|
||||||
require("toggleterm").setup(opts)
|
require("toggleterm").setup(opts)
|
||||||
function _G.set_terminal_keymaps()
|
function _G.set_terminal_keymaps()
|
||||||
local optsn = { noremap = true }
|
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", "<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", "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-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-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-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)
|
vim.api.nvim_buf_set_keymap(0, "t", "<C-l>", [[<C-\><C-n><C-W>l]], optsn)
|
||||||
end
|
end
|
||||||
vim.cmd("autocmd! TermOpen term://* lua set_terminal_keymaps()")
|
vim.cmd("autocmd! TermOpen term://* lua set_terminal_keymaps()")
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,7 @@ if transparent then
|
||||||
event = "BufWinEnter",
|
event = "BufWinEnter",
|
||||||
cmd = { "TransparentToggle", "TransparentEnable", "TransparentDisable" },
|
cmd = { "TransparentToggle", "TransparentEnable", "TransparentDisable" },
|
||||||
config = function()
|
config = function()
|
||||||
require("transparent").setup {
|
require("transparent").setup({
|
||||||
extra_groups = {
|
extra_groups = {
|
||||||
"Normal",
|
"Normal",
|
||||||
"NormalNC",
|
"NormalNC",
|
||||||
|
@ -53,25 +53,25 @@ if transparent then
|
||||||
-- disable lualine background color
|
-- disable lualine background color
|
||||||
"LualineNormal",
|
"LualineNormal",
|
||||||
},
|
},
|
||||||
}
|
})
|
||||||
require("transparent").clear_prefix "BufferLine"
|
require("transparent").clear_prefix("BufferLine")
|
||||||
-- clear prefix for which-key
|
-- clear prefix for which-key
|
||||||
require("transparent").clear_prefix "WhichKey"
|
require("transparent").clear_prefix("WhichKey")
|
||||||
-- clear prefix for lazy.nvim
|
-- clear prefix for lazy.nvim
|
||||||
require("transparent").clear_prefix "Lazy"
|
require("transparent").clear_prefix("Lazy")
|
||||||
-- clear prefix for NvimTree
|
-- clear prefix for NvimTree
|
||||||
require("transparent").clear_prefix "NvimTree"
|
require("transparent").clear_prefix("NvimTree")
|
||||||
-- clear prefix for NeoTree
|
-- clear prefix for NeoTree
|
||||||
require("transparent").clear_prefix "NeoTree"
|
require("transparent").clear_prefix("NeoTree")
|
||||||
-- clear prefix for Telescope
|
-- clear prefix for Telescope
|
||||||
require("transparent").clear_prefix "Telescope"
|
require("transparent").clear_prefix("Telescope")
|
||||||
require("transparent").clear_prefix "mason"
|
require("transparent").clear_prefix("mason")
|
||||||
if clear_lualine then
|
if clear_lualine then
|
||||||
-- clear prefix for Lualine
|
-- clear prefix for Lualine
|
||||||
require("transparent").clear_prefix "Lualine"
|
require("transparent").clear_prefix("Lualine")
|
||||||
-- create auto command to set transparent
|
-- create auto command to set transparent
|
||||||
vim.cmd "TransparentDisable"
|
vim.cmd("TransparentDisable")
|
||||||
vim.cmd "TransparentEnable"
|
vim.cmd("TransparentEnable")
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,189 +1,189 @@
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
{
|
{
|
||||||
"JoosepAlviste/nvim-ts-context-commentstring",
|
"JoosepAlviste/nvim-ts-context-commentstring",
|
||||||
lazy = true,
|
lazy = true,
|
||||||
config = function()
|
config = function()
|
||||||
require("ts_context_commentstring").setup({
|
require("ts_context_commentstring").setup({
|
||||||
enable_autocmd = false,
|
enable_autocmd = false,
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"windwp/nvim-autopairs",
|
"windwp/nvim-autopairs",
|
||||||
lazy = true,
|
lazy = true,
|
||||||
dependencies = "hrsh7th/nvim-cmp",
|
dependencies = "hrsh7th/nvim-cmp",
|
||||||
event = "InsertEnter",
|
event = "InsertEnter",
|
||||||
opts = {
|
opts = {
|
||||||
check_ts = true,
|
check_ts = true,
|
||||||
ts_config = {
|
ts_config = {
|
||||||
lua = { "string", "source" },
|
lua = { "string", "source" },
|
||||||
javascript = { "string", "template_string" },
|
javascript = { "string", "template_string" },
|
||||||
java = false,
|
java = false,
|
||||||
},
|
},
|
||||||
disable_filetype = { "TelescopePrompt", "spectre_panel" },
|
disable_filetype = { "TelescopePrompt", "spectre_panel" },
|
||||||
fast_wrap = {
|
fast_wrap = {
|
||||||
map = "<M-e>",
|
map = "<M-e>",
|
||||||
chars = { "{", "[", "(", '"', "'", "`" },
|
chars = { "{", "[", "(", '"', "'", "`" },
|
||||||
pattern = string.gsub([[ [%'%"%)%>%]%)%}%,] ]], "%s+", ""),
|
pattern = string.gsub([[ [%'%"%)%>%]%)%}%,] ]], "%s+", ""),
|
||||||
offset = 0, -- Offset from pattern match
|
offset = 0, -- Offset from pattern match
|
||||||
end_key = "$",
|
end_key = "$",
|
||||||
keys = "qwertyuiopzxcvbnmasdfghjkl",
|
keys = "qwertyuiopzxcvbnmasdfghjkl",
|
||||||
check_comma = true,
|
check_comma = true,
|
||||||
highlight = "PmenuSel",
|
highlight = "PmenuSel",
|
||||||
highlight_grey = "LineNr",
|
highlight_grey = "LineNr",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
config = function(_, opts)
|
config = function(_, opts)
|
||||||
require("nvim-autopairs").setup(opts)
|
require("nvim-autopairs").setup(opts)
|
||||||
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
|
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
|
||||||
local cmp_status_ok, cmp = pcall(require, "cmp")
|
local cmp_status_ok, cmp = pcall(require, "cmp")
|
||||||
if not cmp_status_ok then
|
if not cmp_status_ok then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done({ map_char = { tex = "" } }))
|
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done({ map_char = { tex = "" } }))
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
version = false, -- last release is way too old and doesn't work on Windows
|
version = false, -- last release is way too old and doesn't work on Windows
|
||||||
build = ":TSUpdate",
|
build = ":TSUpdate",
|
||||||
-- event = { "LazyFile", "VeryLazy" },
|
-- event = { "LazyFile", "VeryLazy" },
|
||||||
lazy = true,
|
lazy = true,
|
||||||
cmd = {
|
cmd = {
|
||||||
"TSInstall",
|
"TSInstall",
|
||||||
"TSUninstall",
|
"TSUninstall",
|
||||||
"TSUpdate",
|
"TSUpdate",
|
||||||
"TSUpdateSync",
|
"TSUpdateSync",
|
||||||
"TSInstallInfo",
|
"TSInstallInfo",
|
||||||
"TSInstallSync",
|
"TSInstallSync",
|
||||||
"TSInstallFromGrammar",
|
"TSInstallFromGrammar",
|
||||||
},
|
},
|
||||||
event = { "BufRead", "VeryLazy" },
|
event = { "BufRead", "VeryLazy" },
|
||||||
opts = function()
|
opts = function()
|
||||||
return {
|
return {
|
||||||
highlight = { enable = true },
|
highlight = { enable = true },
|
||||||
indent = { enable = true },
|
indent = { enable = true },
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
"lua",
|
"lua",
|
||||||
"vim",
|
"vim",
|
||||||
"vimdoc",
|
"vimdoc",
|
||||||
},
|
},
|
||||||
incremental_selection = {
|
incremental_selection = {
|
||||||
enable = true,
|
enable = true,
|
||||||
},
|
},
|
||||||
autopairs = {
|
autopairs = {
|
||||||
enable = true,
|
enable = true,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
config = function(_, opts)
|
config = function(_, opts)
|
||||||
if type(opts.ensure_installed) == "table" then
|
if type(opts.ensure_installed) == "table" then
|
||||||
---@type table<string, boolean>
|
---@type table<string, boolean>
|
||||||
local added = {}
|
local added = {}
|
||||||
opts.ensure_installed = vim.tbl_filter(function(lang)
|
opts.ensure_installed = vim.tbl_filter(function(lang)
|
||||||
if added[lang] then
|
if added[lang] then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
added[lang] = true
|
added[lang] = true
|
||||||
return true
|
return true
|
||||||
end, opts.ensure_installed)
|
end, opts.ensure_installed)
|
||||||
end
|
end
|
||||||
require("nvim-treesitter.configs").setup(opts)
|
require("nvim-treesitter.configs").setup(opts)
|
||||||
vim.schedule(function()
|
vim.schedule(function()
|
||||||
require("lazy").load({ plugins = { "nvim-treesitter-textobjects" } })
|
require("lazy").load({ plugins = { "nvim-treesitter-textobjects" } })
|
||||||
end)
|
end)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"nvim-treesitter/nvim-treesitter-textobjects",
|
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||||
lazy = true,
|
lazy = true,
|
||||||
config = function()
|
config = function()
|
||||||
-- When in diff mode, we want to use the default
|
-- When in diff mode, we want to use the default
|
||||||
-- vim text objects c & C instead of the treesitter ones.
|
-- vim text objects c & C instead of the treesitter ones.
|
||||||
local move = require("nvim-treesitter.textobjects.move") ---@type table<string,fun(...)>
|
local move = require("nvim-treesitter.textobjects.move") ---@type table<string,fun(...)>
|
||||||
local configs = require("nvim-treesitter.configs")
|
local configs = require("nvim-treesitter.configs")
|
||||||
for name, fn in pairs(move) do
|
for name, fn in pairs(move) do
|
||||||
if name:find("goto") == 1 then
|
if name:find("goto") == 1 then
|
||||||
move[name] = function(q, ...)
|
move[name] = function(q, ...)
|
||||||
if vim.wo.diff then
|
if vim.wo.diff then
|
||||||
local config = configs.get_module("textobjects.move")[name] ---@type table<string,string>
|
local config = configs.get_module("textobjects.move")[name] ---@type table<string,string>
|
||||||
for key, query in pairs(config or {}) do
|
for key, query in pairs(config or {}) do
|
||||||
if q == query and key:find("[%]%[][cC]") then
|
if q == query and key:find("[%]%[][cC]") then
|
||||||
vim.cmd("normal! " .. key)
|
vim.cmd("normal! " .. key)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return fn(q, ...)
|
return fn(q, ...)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
-- Automatically add closing tags for HTML and JSX
|
-- Automatically add closing tags for HTML and JSX
|
||||||
{
|
{
|
||||||
"windwp/nvim-ts-autotag",
|
"windwp/nvim-ts-autotag",
|
||||||
lazy = true,
|
lazy = true,
|
||||||
event = "BufRead",
|
event = "BufRead",
|
||||||
opts = {},
|
opts = {},
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"RRethy/vim-illuminate",
|
"RRethy/vim-illuminate",
|
||||||
lazy = true,
|
lazy = true,
|
||||||
event = "BufRead",
|
event = "BufRead",
|
||||||
opts = {
|
opts = {
|
||||||
options = {
|
options = {
|
||||||
-- providers: provider used to get references in the buffer, ordered by priority
|
-- providers: provider used to get references in the buffer, ordered by priority
|
||||||
providers = {
|
providers = {
|
||||||
"lsp",
|
"lsp",
|
||||||
"treesitter",
|
"treesitter",
|
||||||
"regex",
|
"regex",
|
||||||
},
|
},
|
||||||
-- delay: delay in milliseconds
|
-- delay: delay in milliseconds
|
||||||
delay = 120,
|
delay = 120,
|
||||||
-- filetype_overrides: filetype specific overrides.
|
-- filetype_overrides: filetype specific overrides.
|
||||||
-- The keys are strings to represent the filetype while the values are tables that
|
-- 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
|
-- supports the same keys passed to .configure except for filetypes_denylist and filetypes_allowlist
|
||||||
filetype_overrides = {},
|
filetype_overrides = {},
|
||||||
-- filetypes_denylist: filetypes to not illuminate, this overrides filetypes_allowlist
|
-- filetypes_denylist: filetypes to not illuminate, this overrides filetypes_allowlist
|
||||||
filetypes_denylist = {
|
filetypes_denylist = {
|
||||||
"dirvish",
|
"dirvish",
|
||||||
"fugitive",
|
"fugitive",
|
||||||
"alpha",
|
"alpha",
|
||||||
"NvimTree",
|
"NvimTree",
|
||||||
"lazy",
|
"lazy",
|
||||||
"neogitstatus",
|
"neogitstatus",
|
||||||
"Trouble",
|
"Trouble",
|
||||||
"lir",
|
"lir",
|
||||||
"Outline",
|
"Outline",
|
||||||
"spectre_panel",
|
"spectre_panel",
|
||||||
"toggleterm",
|
"toggleterm",
|
||||||
"DressingSelect",
|
"DressingSelect",
|
||||||
"TelescopePrompt",
|
"TelescopePrompt",
|
||||||
},
|
},
|
||||||
-- filetypes_allowlist: filetypes to illuminate, this is overridden by filetypes_denylist
|
-- filetypes_allowlist: filetypes to illuminate, this is overridden by filetypes_denylist
|
||||||
filetypes_allowlist = {},
|
filetypes_allowlist = {},
|
||||||
-- modes_denylist: modes to not illuminate, this overrides modes_allowlist
|
-- modes_denylist: modes to not illuminate, this overrides modes_allowlist
|
||||||
modes_denylist = {},
|
modes_denylist = {},
|
||||||
-- modes_allowlist: modes to illuminate, this is overridden by modes_denylist
|
-- modes_allowlist: modes to illuminate, this is overridden by modes_denylist
|
||||||
modes_allowlist = {},
|
modes_allowlist = {},
|
||||||
-- providers_regex_syntax_denylist: syntax to not illuminate, this overrides providers_regex_syntax_allowlist
|
-- providers_regex_syntax_denylist: syntax to not illuminate, this overrides providers_regex_syntax_allowlist
|
||||||
-- Only applies to the 'regex' provider
|
-- Only applies to the 'regex' provider
|
||||||
-- Use :echom synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name')
|
-- Use :echom synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name')
|
||||||
providers_regex_syntax_denylist = {},
|
providers_regex_syntax_denylist = {},
|
||||||
-- providers_regex_syntax_allowlist: syntax to illuminate, this is overridden by 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
|
-- Only applies to the 'regex' provider
|
||||||
-- Use :echom synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name')
|
-- Use :echom synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name')
|
||||||
providers_regex_syntax_allowlist = {},
|
providers_regex_syntax_allowlist = {},
|
||||||
-- under_cursor: whether or not to illuminate under the cursor
|
-- under_cursor: whether or not to illuminate under the cursor
|
||||||
under_cursor = true,
|
under_cursor = true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
config = function(_, opts)
|
config = function(_, opts)
|
||||||
require("illuminate").configure(opts)
|
require("illuminate").configure(opts)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,12 +7,12 @@ if pcode.columnline then
|
||||||
opts = {},
|
opts = {},
|
||||||
config = function()
|
config = function()
|
||||||
local icons = vim.g.pcode_icons
|
local icons = vim.g.pcode_icons
|
||||||
require("virt-column").overwrite {
|
require("virt-column").overwrite({
|
||||||
exclude = {
|
exclude = {
|
||||||
filetypes = { "help", "text", "markdown" },
|
filetypes = { "help", "text", "markdown" },
|
||||||
},
|
},
|
||||||
char = icons.ui.LineMiddle,
|
char = icons.ui.LineMiddle,
|
||||||
}
|
})
|
||||||
-- Mengatur colum color max 80 caracter
|
-- Mengatur colum color max 80 caracter
|
||||||
vim.api.nvim_create_autocmd("BufWinEnter", {
|
vim.api.nvim_create_autocmd("BufWinEnter", {
|
||||||
pattern = "*",
|
pattern = "*",
|
||||||
|
|
|
@ -1,21 +1,21 @@
|
||||||
return {
|
return {
|
||||||
"kyazdani42/nvim-web-devicons",
|
"kyazdani42/nvim-web-devicons",
|
||||||
lazy = true,
|
lazy = true,
|
||||||
dependencies = "pojokcodeid/nvim-material-icon",
|
dependencies = "pojokcodeid/nvim-material-icon",
|
||||||
opts = function()
|
opts = function()
|
||||||
local material_icon_ok, material_icon = pcall(require, "nvim-material-icon")
|
local material_icon_ok, material_icon = pcall(require, "nvim-material-icon")
|
||||||
if not material_icon_ok then
|
if not material_icon_ok then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
material_icon.setup({
|
material_icon.setup({
|
||||||
override = {},
|
override = {},
|
||||||
})
|
})
|
||||||
return {
|
return {
|
||||||
override = material_icon.get_icons(),
|
override = material_icon.get_icons(),
|
||||||
override_by_filename = {},
|
override_by_filename = {},
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
config = function(_, opts)
|
config = function(_, opts)
|
||||||
require("nvim-web-devicons").setup(opts)
|
require("nvim-web-devicons").setup(opts)
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,105 +1,105 @@
|
||||||
return {
|
return {
|
||||||
"folke/which-key.nvim",
|
"folke/which-key.nvim",
|
||||||
lazy = true,
|
lazy = true,
|
||||||
keys = { "<leader>", '"', "'", "`", "c", "v" },
|
keys = { "<leader>", '"', "'", "`", "c", "v" },
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
opts = function()
|
opts = function()
|
||||||
local icons = vim.g.pcode_icons
|
local icons = vim.g.pcode_icons
|
||||||
return {
|
return {
|
||||||
plugins = {
|
plugins = {
|
||||||
marks = false, -- shows a list of your marks on ' and `
|
marks = false, -- shows a list of your marks on ' and `
|
||||||
registers = false, -- shows your registers on " in NORMAL or <C-r> in INSERT mode
|
registers = false, -- shows your registers on " in NORMAL or <C-r> in INSERT mode
|
||||||
spelling = {
|
spelling = {
|
||||||
enabled = true,
|
enabled = true,
|
||||||
suggestions = 20,
|
suggestions = 20,
|
||||||
}, -- use which-key for spelling hints
|
}, -- use which-key for spelling hints
|
||||||
-- the presets plugin, adds help for a bunch of default keybindings in Neovim
|
-- the presets plugin, adds help for a bunch of default keybindings in Neovim
|
||||||
-- No actual key bindings are created
|
-- No actual key bindings are created
|
||||||
presets = {
|
presets = {
|
||||||
operators = false, -- adds help for operators like d, y, ...
|
operators = false, -- adds help for operators like d, y, ...
|
||||||
motions = false, -- adds help for motions
|
motions = false, -- adds help for motions
|
||||||
text_objects = false, -- help for text objects triggered after entering an operator
|
text_objects = false, -- help for text objects triggered after entering an operator
|
||||||
windows = false, -- default bindings on <c-w>
|
windows = false, -- default bindings on <c-w>
|
||||||
nav = false, -- misc bindings to work with windows
|
nav = false, -- misc bindings to work with windows
|
||||||
z = false, -- bindings for folds, spelling and others prefixed with z
|
z = false, -- bindings for folds, spelling and others prefixed with z
|
||||||
g = false, -- bindings for prefixed with g
|
g = false, -- bindings for prefixed with g
|
||||||
},
|
},
|
||||||
}, -- add operators that will trigger motion and text object completion
|
}, -- add operators that will trigger motion and text object completion
|
||||||
-- to enable all native operators, set the preset / operators plugin above
|
-- to enable all native operators, set the preset / operators plugin above
|
||||||
-- operators = { gc = "Comments" },
|
-- operators = { gc = "Comments" },
|
||||||
key_labels = {
|
key_labels = {
|
||||||
-- override the label used to display some keys. It doesn't effect WK in any other way.
|
-- override the label used to display some keys. It doesn't effect WK in any other way.
|
||||||
-- For example:
|
-- For example:
|
||||||
-- ["<space>"] = "SPC",
|
-- ["<space>"] = "SPC",
|
||||||
-- ["<cr>"] = "RET",
|
-- ["<cr>"] = "RET",
|
||||||
-- ["<tab>"] = "TAB",
|
-- ["<tab>"] = "TAB",
|
||||||
},
|
},
|
||||||
icons = {
|
icons = {
|
||||||
breadcrumb = icons.ui.DoubleChevronRight, -- symbol used in the command line area that shows your active key combo
|
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
|
separator = icons.ui.BoldArrowRight, -- symbol used between a key and it's label
|
||||||
group = icons.ui.Plus, -- symbol prepended to a group
|
group = icons.ui.Plus, -- symbol prepended to a group
|
||||||
},
|
},
|
||||||
popup_mappings = {
|
popup_mappings = {
|
||||||
scroll_down = "<c-d>", -- binding to scroll down inside the popup
|
scroll_down = "<c-d>", -- binding to scroll down inside the popup
|
||||||
scroll_up = "<c-u>", -- binding to scroll up inside the popup
|
scroll_up = "<c-u>", -- binding to scroll up inside the popup
|
||||||
},
|
},
|
||||||
window = {
|
window = {
|
||||||
border = "rounded", -- none, single, double, shadow
|
border = "rounded", -- none, single, double, shadow
|
||||||
position = "bottom", -- bottom, top
|
position = "bottom", -- bottom, top
|
||||||
margin = { 1, 1, 1, 1 }, -- extra window margin [top, right, bottom, left]
|
margin = { 1, 1, 1, 1 }, -- extra window margin [top, right, bottom, left]
|
||||||
padding = { 2, 2, 2, 2 }, -- extra window padding [top, right, bottom, left]
|
padding = { 2, 2, 2, 2 }, -- extra window padding [top, right, bottom, left]
|
||||||
winblend = 0,
|
winblend = 0,
|
||||||
},
|
},
|
||||||
layout = {
|
layout = {
|
||||||
height = { min = 4, max = 25 }, -- min and max height of the columns
|
height = { min = 4, max = 25 }, -- min and max height of the columns
|
||||||
width = { min = 20, max = 50 }, -- min and max width of the columns
|
width = { min = 20, max = 50 }, -- min and max width of the columns
|
||||||
spacing = 3, -- spacing between columns
|
spacing = 3, -- spacing between columns
|
||||||
align = "left", -- align columns left, center or right
|
align = "left", -- align columns left, center or right
|
||||||
},
|
},
|
||||||
ignore_missing = true, -- enable this to hide mappings for which you didn't specify a label
|
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
|
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_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
|
show_keys = true, -- show the currently pressed key and its label as a message in the command line
|
||||||
triggers = "auto", -- automatically setup triggers
|
triggers = "auto", -- automatically setup triggers
|
||||||
-- triggers = {"<leader>"} -- or specify a list manually
|
-- triggers = {"<leader>"} -- or specify a list manually
|
||||||
triggers_blacklist = {
|
triggers_blacklist = {
|
||||||
-- list of mode / prefixes that should never be hooked by WhichKey
|
-- list of mode / prefixes that should never be hooked by WhichKey
|
||||||
-- this is mostly relevant for key maps that start with a native binding
|
-- this is mostly relevant for key maps that start with a native binding
|
||||||
-- most people should not need to change this
|
-- most people should not need to change this
|
||||||
i = { "j", "k" },
|
i = { "j", "k" },
|
||||||
v = { "j", "k" },
|
v = { "j", "k" },
|
||||||
},
|
},
|
||||||
-- Disabled by default for Telescope
|
-- Disabled by default for Telescope
|
||||||
disable = {
|
disable = {
|
||||||
buftypes = {},
|
buftypes = {},
|
||||||
filetypes = { "TelescopePrompt" },
|
filetypes = { "TelescopePrompt" },
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
config = function(_, opts)
|
config = function(_, opts)
|
||||||
local opt = {
|
local opt = {
|
||||||
mode = "n", -- NORMAL mode
|
mode = "n", -- NORMAL mode
|
||||||
prefix = "<leader>",
|
prefix = "<leader>",
|
||||||
buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings
|
buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings
|
||||||
silent = true, -- use `silent` when creating keymaps
|
silent = true, -- use `silent` when creating keymaps
|
||||||
noremap = true, -- use `noremap` when creating keymaps
|
noremap = true, -- use `noremap` when creating keymaps
|
||||||
nowait = true, -- use `nowait` when creating keymaps
|
nowait = true, -- use `nowait` when creating keymaps
|
||||||
}
|
}
|
||||||
|
|
||||||
local opt2 = {
|
local opt2 = {
|
||||||
mode = "v", -- NORMAL mode
|
mode = "v", -- NORMAL mode
|
||||||
prefix = "<leader>",
|
prefix = "<leader>",
|
||||||
buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings
|
buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings
|
||||||
silent = true, -- use `silent` when creating keymaps
|
silent = true, -- use `silent` when creating keymaps
|
||||||
noremap = true, -- use `noremap` when creating keymaps
|
noremap = true, -- use `noremap` when creating keymaps
|
||||||
nowait = true, -- use `nowait` when creating keymaps
|
nowait = true, -- use `nowait` when creating keymaps
|
||||||
}
|
}
|
||||||
|
|
||||||
local wkey = pcode.whichkey or {}
|
local wkey = pcode.whichkey or {}
|
||||||
local which_key = require("which-key")
|
local which_key = require("which-key")
|
||||||
which_key.setup(opts)
|
which_key.setup(opts)
|
||||||
which_key.register(require("user.utils.whichkey").mappings, opt)
|
which_key.register(require("user.utils.whichkey").mappings, opt)
|
||||||
which_key.register(wkey, opt)
|
which_key.register(wkey, opt)
|
||||||
which_key.register(require("user.utils.whichkey").mappings2, opt2)
|
which_key.register(require("user.utils.whichkey").mappings2, opt2)
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
return {
|
return {
|
||||||
"gbprod/yanky.nvim",
|
"gbprod/yanky.nvim",
|
||||||
event = "BufReadPre",
|
event = "BufReadPre",
|
||||||
opts = {
|
opts = {
|
||||||
ring = {
|
ring = {
|
||||||
history_length = 50,
|
history_length = 50,
|
||||||
storage = "memory",
|
storage = "memory",
|
||||||
},
|
},
|
||||||
preserve_cursor_position = {
|
preserve_cursor_position = {
|
||||||
enabled = false,
|
enabled = false,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
config = function(_, opts)
|
config = function(_, opts)
|
||||||
require("yanky").setup(opts)
|
require("yanky").setup(opts)
|
||||||
-- cycle through the yank history, only work after paste
|
-- cycle through the yank history, only work after paste
|
||||||
vim.keymap.set("n", "[y", "<Plug>(YankyCycleForward)")
|
vim.keymap.set("n", "[y", "<Plug>(YankyCycleForward)")
|
||||||
vim.keymap.set("n", "]y", "<Plug>(YankyCycleBackward)")
|
vim.keymap.set("n", "]y", "<Plug>(YankyCycleBackward)")
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,26 +1,26 @@
|
||||||
local model = vim.g.pcode_model
|
local model = vim.g.pcode_model
|
||||||
if model ~= nil then
|
if model ~= nil then
|
||||||
if model == 1 then
|
if model == 1 then
|
||||||
require("user.startify")
|
require("user.startify")
|
||||||
else
|
else
|
||||||
require("user.dashboard")
|
require("user.dashboard")
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
require("user.startify")
|
require("user.startify")
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Disable statusline in dashboard
|
-- Disable statusline in dashboard
|
||||||
vim.api.nvim_create_autocmd("FileType", {
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
pattern = "alpha",
|
pattern = "alpha",
|
||||||
callback = function()
|
callback = function()
|
||||||
-- store current statusline value and use that
|
-- store current statusline value and use that
|
||||||
local old_laststatus = vim.opt.laststatus
|
local old_laststatus = vim.opt.laststatus
|
||||||
vim.api.nvim_create_autocmd("BufUnload", {
|
vim.api.nvim_create_autocmd("BufUnload", {
|
||||||
buffer = 0,
|
buffer = 0,
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.opt.laststatus = old_laststatus
|
vim.opt.laststatus = old_laststatus
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
vim.opt.laststatus = 0
|
vim.opt.laststatus = 0
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,50 +1,50 @@
|
||||||
local status_ok, navic = pcall(require, "nvim-navic")
|
local status_ok, navic = pcall(require, "nvim-navic")
|
||||||
if not status_ok then
|
if not status_ok then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local ico = vim.g.pcode_icons
|
local ico = vim.g.pcode_icons
|
||||||
local icons = ico.kind
|
local icons = ico.kind
|
||||||
|
|
||||||
navic.setup({
|
navic.setup({
|
||||||
icons = {
|
icons = {
|
||||||
Array = icons.Array .. " ",
|
Array = icons.Array .. " ",
|
||||||
Boolean = icons.Boolean,
|
Boolean = icons.Boolean,
|
||||||
Class = icons.Class .. " ",
|
Class = icons.Class .. " ",
|
||||||
Color = icons.Color .. " ",
|
Color = icons.Color .. " ",
|
||||||
Constant = icons.Constant .. " ",
|
Constant = icons.Constant .. " ",
|
||||||
Constructor = icons.Constructor .. " ",
|
Constructor = icons.Constructor .. " ",
|
||||||
Enum = icons.Enum .. " ",
|
Enum = icons.Enum .. " ",
|
||||||
EnumMember = icons.EnumMember .. " ",
|
EnumMember = icons.EnumMember .. " ",
|
||||||
Event = icons.Event .. " ",
|
Event = icons.Event .. " ",
|
||||||
Field = icons.Field .. " ",
|
Field = icons.Field .. " ",
|
||||||
File = icons.File .. " ",
|
File = icons.File .. " ",
|
||||||
Folder = icons.Folder .. " ",
|
Folder = icons.Folder .. " ",
|
||||||
Function = icons.Function .. " ",
|
Function = icons.Function .. " ",
|
||||||
Interface = icons.Interface .. " ",
|
Interface = icons.Interface .. " ",
|
||||||
Key = icons.Key .. " ",
|
Key = icons.Key .. " ",
|
||||||
Keyword = icons.Keyword .. " ",
|
Keyword = icons.Keyword .. " ",
|
||||||
Method = icons.Method .. " ",
|
Method = icons.Method .. " ",
|
||||||
Module = icons.Module .. " ",
|
Module = icons.Module .. " ",
|
||||||
Namespace = icons.Namespace .. " ",
|
Namespace = icons.Namespace .. " ",
|
||||||
Null = icons.Null .. " ",
|
Null = icons.Null .. " ",
|
||||||
Number = icons.Number .. " ",
|
Number = icons.Number .. " ",
|
||||||
Object = icons.Object .. " ",
|
Object = icons.Object .. " ",
|
||||||
Operator = icons.Operator .. " ",
|
Operator = icons.Operator .. " ",
|
||||||
Package = icons.Package .. " ",
|
Package = icons.Package .. " ",
|
||||||
Property = icons.Property .. " ",
|
Property = icons.Property .. " ",
|
||||||
Reference = icons.Reference .. " ",
|
Reference = icons.Reference .. " ",
|
||||||
Snippet = icons.Snippet .. " ",
|
Snippet = icons.Snippet .. " ",
|
||||||
String = icons.String .. " ",
|
String = icons.String .. " ",
|
||||||
Struct = icons.Struct .. " ",
|
Struct = icons.Struct .. " ",
|
||||||
Text = icons.Text .. " ",
|
Text = icons.Text .. " ",
|
||||||
TypeParameter = icons.TypeParameter .. " ",
|
TypeParameter = icons.TypeParameter .. " ",
|
||||||
Unit = icons.Unit .. " ",
|
Unit = icons.Unit .. " ",
|
||||||
Value = icons.Value .. " ",
|
Value = icons.Value .. " ",
|
||||||
Variable = icons.Variable .. " ",
|
Variable = icons.Variable .. " ",
|
||||||
},
|
},
|
||||||
highlight = true,
|
highlight = true,
|
||||||
separator = " " .. ico.ui.ChevronRight .. " ",
|
separator = " " .. ico.ui.ChevronRight .. " ",
|
||||||
depth_limit = 0,
|
depth_limit = 0,
|
||||||
depth_limit_indicator = "..",
|
depth_limit_indicator = "..",
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,54 +1,54 @@
|
||||||
local transparent = false
|
local transparent = false
|
||||||
local data_exists, custom_ui = pcall(require, "custom.ui")
|
local data_exists, custom_ui = pcall(require, "custom.ui")
|
||||||
if not data_exists then
|
if not data_exists then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local transparent_mode = custom_ui.transparent_mode
|
local transparent_mode = custom_ui.transparent_mode
|
||||||
if transparent_mode ~= nil then
|
if transparent_mode ~= nil then
|
||||||
if transparent_mode == 1 then
|
if transparent_mode == 1 then
|
||||||
transparent = true
|
transparent = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
require("catppuccin").setup({
|
require("catppuccin").setup({
|
||||||
flavour = "macchiato", -- latte, frappe, macchiato, mocha
|
flavour = "macchiato", -- latte, frappe, macchiato, mocha
|
||||||
background = { -- :h background
|
background = { -- :h background
|
||||||
light = "latte",
|
light = "latte",
|
||||||
dark = "macchiato",
|
dark = "macchiato",
|
||||||
},
|
},
|
||||||
transparent_background = transparent,
|
transparent_background = transparent,
|
||||||
show_end_of_buffer = false, -- show the '~' characters after the end of buffers
|
show_end_of_buffer = false, -- show the '~' characters after the end of buffers
|
||||||
term_colors = false,
|
term_colors = false,
|
||||||
dim_inactive = {
|
dim_inactive = {
|
||||||
enabled = false,
|
enabled = false,
|
||||||
shade = "dark",
|
shade = "dark",
|
||||||
percentage = 0.15,
|
percentage = 0.15,
|
||||||
},
|
},
|
||||||
no_italic = false, -- Force no italic
|
no_italic = false, -- Force no italic
|
||||||
no_bold = false, -- Force no bold
|
no_bold = false, -- Force no bold
|
||||||
styles = {
|
styles = {
|
||||||
comments = { "italic" },
|
comments = { "italic" },
|
||||||
conditionals = { "italic" },
|
conditionals = { "italic" },
|
||||||
loops = {},
|
loops = {},
|
||||||
functions = {},
|
functions = {},
|
||||||
keywords = {},
|
keywords = {},
|
||||||
strings = {},
|
strings = {},
|
||||||
variables = {},
|
variables = {},
|
||||||
numbers = {},
|
numbers = {},
|
||||||
booleans = {},
|
booleans = {},
|
||||||
properties = {},
|
properties = {},
|
||||||
types = {},
|
types = {},
|
||||||
operators = {},
|
operators = {},
|
||||||
},
|
},
|
||||||
color_overrides = {},
|
color_overrides = {},
|
||||||
custom_highlights = {},
|
custom_highlights = {},
|
||||||
integrations = {
|
integrations = {
|
||||||
cmp = true,
|
cmp = true,
|
||||||
gitsigns = true,
|
gitsigns = true,
|
||||||
nvimtree = true,
|
nvimtree = true,
|
||||||
telescope = true,
|
telescope = true,
|
||||||
notify = false,
|
notify = false,
|
||||||
mini = false,
|
mini = false,
|
||||||
-- For more plugins integrations please scroll down (https://github.com/catppuccin/nvim#integrations)
|
-- For more plugins integrations please scroll down (https://github.com/catppuccin/nvim#integrations)
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
|
@ -5,7 +5,7 @@ end
|
||||||
local WELCOME_MESSAGE = [[
|
local WELCOME_MESSAGE = [[
|
||||||
Welcome to ChatGPT.
|
Welcome to ChatGPT.
|
||||||
]]
|
]]
|
||||||
chatgpt.setup {
|
chatgpt.setup({
|
||||||
welcome_message = WELCOME_MESSAGE, -- set to "" if you don't like the fancy godot robot
|
welcome_message = WELCOME_MESSAGE, -- set to "" if you don't like the fancy godot robot
|
||||||
loading_text = "loading",
|
loading_text = "loading",
|
||||||
question_sign = "", -- you can use emoji if you want e.g. 🙂
|
question_sign = "", -- you can use emoji if you want e.g. 🙂
|
||||||
|
@ -73,4 +73,4 @@ chatgpt.setup {
|
||||||
new_session = "<C-n>",
|
new_session = "<C-n>",
|
||||||
cycle_windows = "<Tab>",
|
cycle_windows = "<Tab>",
|
||||||
},
|
},
|
||||||
}
|
})
|
||||||
|
|
|
@ -8,5 +8,5 @@ end
|
||||||
|
|
||||||
local ok, _ = pcall(vim.cmd.colorscheme, colorscheme)
|
local ok, _ = pcall(vim.cmd.colorscheme, colorscheme)
|
||||||
if not ok then
|
if not ok then
|
||||||
require "notify"("Colorscheme '" .. colorscheme .. "' not found!", "error")
|
require("notify")("Colorscheme '" .. colorscheme .. "' not found!", "error")
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,80 +2,80 @@
|
||||||
|
|
||||||
local dap_status_ok, dap = pcall(require, "dap")
|
local dap_status_ok, dap = pcall(require, "dap")
|
||||||
if not dap_status_ok then
|
if not dap_status_ok then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local dap_ui_status_ok, dapui = pcall(require, "dapui")
|
local dap_ui_status_ok, dapui = pcall(require, "dapui")
|
||||||
if not dap_ui_status_ok then
|
if not dap_ui_status_ok then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
-- dapui.setup()
|
-- dapui.setup()
|
||||||
dapui.setup({
|
dapui.setup({
|
||||||
icons = { expanded = "▾", collapsed = "▸" },
|
icons = { expanded = "▾", collapsed = "▸" },
|
||||||
mappings = {
|
mappings = {
|
||||||
-- Use a table to apply multiple mappings
|
-- Use a table to apply multiple mappings
|
||||||
expand = { "<CR>", "<2-LeftMouse>" },
|
expand = { "<CR>", "<2-LeftMouse>" },
|
||||||
open = "o",
|
open = "o",
|
||||||
remove = "d",
|
remove = "d",
|
||||||
edit = "e",
|
edit = "e",
|
||||||
repl = "r",
|
repl = "r",
|
||||||
toggle = "t",
|
toggle = "t",
|
||||||
},
|
},
|
||||||
-- Expand lines larger than the window
|
-- Expand lines larger than the window
|
||||||
-- Requires >= 0.7
|
-- Requires >= 0.7
|
||||||
expand_lines = vim.fn.has("nvim-0.7"),
|
expand_lines = vim.fn.has("nvim-0.7"),
|
||||||
-- Layouts define sections of the screen to place windows.
|
-- Layouts define sections of the screen to place windows.
|
||||||
-- The position can be "left", "right", "top" or "bottom".
|
-- The position can be "left", "right", "top" or "bottom".
|
||||||
-- The size specifies the height/width depending on position. It can be an Int
|
-- 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
|
-- 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)
|
-- Float value specifies percentage (i.e. 0.3 - 30% of available lines/columns)
|
||||||
-- Elements are the elements shown in the layout (in order).
|
-- 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 are opened in order so that earlier layouts take priority in window sizing.
|
||||||
layouts = {
|
layouts = {
|
||||||
{
|
{
|
||||||
elements = {
|
elements = {
|
||||||
-- Elements can be strings or table with id and size keys.
|
-- Elements can be strings or table with id and size keys.
|
||||||
{ id = "scopes", size = 0.25 },
|
{ id = "scopes", size = 0.25 },
|
||||||
"breakpoints",
|
"breakpoints",
|
||||||
-- "stacks",
|
-- "stacks",
|
||||||
-- "watches",
|
-- "watches",
|
||||||
},
|
},
|
||||||
size = 40, -- 40 columns
|
size = 40, -- 40 columns
|
||||||
position = "right",
|
position = "right",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
elements = {
|
elements = {
|
||||||
"repl",
|
"repl",
|
||||||
"console",
|
"console",
|
||||||
},
|
},
|
||||||
size = 0.25, -- 25% of total lines
|
size = 0.25, -- 25% of total lines
|
||||||
position = "bottom",
|
position = "bottom",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
floating = {
|
floating = {
|
||||||
max_height = nil, -- These can be integers or a float between 0 and 1.
|
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.
|
max_width = nil, -- Floats will be treated as percentage of your screen.
|
||||||
border = "single", -- Border style. Can be "single", "double" or "rounded"
|
border = "single", -- Border style. Can be "single", "double" or "rounded"
|
||||||
mappings = {
|
mappings = {
|
||||||
close = { "q", "<Esc>" },
|
close = { "q", "<Esc>" },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
windows = { indent = 1 },
|
windows = { indent = 1 },
|
||||||
render = {
|
render = {
|
||||||
max_type_length = nil, -- Can be integer or nil.
|
max_type_length = nil, -- Can be integer or nil.
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
dap.listeners.after.event_initialized["dapui_config"] = function()
|
dap.listeners.after.event_initialized["dapui_config"] = function()
|
||||||
-- dapui.setup()
|
-- dapui.setup()
|
||||||
dapui.open()
|
dapui.open()
|
||||||
end
|
end
|
||||||
dap.listeners.before.event_terminated["dapui_config"] = function()
|
dap.listeners.before.event_terminated["dapui_config"] = function()
|
||||||
dapui.close()
|
dapui.close()
|
||||||
end
|
end
|
||||||
dap.listeners.before.event_exited["dapui_config"] = function()
|
dap.listeners.before.event_exited["dapui_config"] = function()
|
||||||
dapui.close()
|
dapui.close()
|
||||||
end
|
end
|
||||||
-- vim.fn.sign_define("DapBreakpoint", { text = "🟥", texthl = "", linehl = "", numhl = "" })
|
-- vim.fn.sign_define("DapBreakpoint", { text = "🟥", texthl = "", linehl = "", numhl = "" })
|
||||||
vim.fn.sign_define("DapBreakpoint", { text = "", texthl = "DiagnosticSignError", linehl = "", numhl = "" })
|
vim.fn.sign_define("DapBreakpoint", { text = "", texthl = "DiagnosticSignError", linehl = "", numhl = "" })
|
||||||
|
|
|
@ -19,7 +19,7 @@ if data_board ~= nil then
|
||||||
board = data_board
|
board = data_board
|
||||||
end
|
end
|
||||||
|
|
||||||
local dashboard = require "alpha.themes.dashboard"
|
local dashboard = require("alpha.themes.dashboard")
|
||||||
dashboard.section.header.val = board
|
dashboard.section.header.val = board
|
||||||
dashboard.section.buttons.val = {
|
dashboard.section.buttons.val = {
|
||||||
dashboard.button("F", " Find file", ":Telescope find_files <CR>"),
|
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" }, {
|
vim.api.nvim_create_autocmd({ "User" }, {
|
||||||
pattern = { "AlphaReady" },
|
pattern = { "AlphaReady" },
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.cmd [[
|
vim.cmd([[
|
||||||
set laststatus=0 | autocmd BufUnload <buffer> set laststatus=3
|
set laststatus=0 | autocmd BufUnload <buffer> set laststatus=3
|
||||||
]]
|
]])
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
|
@ -14,25 +14,25 @@ end
|
||||||
if run == 1 then
|
if run == 1 then
|
||||||
function FORMAT_FILTER(client)
|
function FORMAT_FILTER(client)
|
||||||
local filetype = vim.bo.filetype
|
local filetype = vim.bo.filetype
|
||||||
local n = require "null-ls"
|
local n = require("null-ls")
|
||||||
local s = require "null-ls.sources"
|
local s = require("null-ls.sources")
|
||||||
local method = n.methods.FORMATTING
|
local method = n.methods.FORMATTING
|
||||||
local available_formatters = s.get_available(filetype, method)
|
local available_formatters = s.get_available(filetype, method)
|
||||||
|
|
||||||
if #available_formatters > 0 then
|
if #available_formatters > 0 then
|
||||||
return client.name == "null-ls"
|
return client.name == "null-ls"
|
||||||
elseif client.supports_method "textDocument/formatting" then
|
elseif client.supports_method("textDocument/formatting") then
|
||||||
return true
|
return true
|
||||||
else
|
else
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
vim.cmd [[
|
vim.cmd([[
|
||||||
augroup _lsp
|
augroup _lsp
|
||||||
autocmd!
|
autocmd!
|
||||||
" autocmd BufWritePre * lua vim.lsp.buf.format{timeout_ms =200, filter=format_filter}
|
" 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}
|
autocmd BufWritePre * lua vim.lsp.buf.format{timeout_ms=pcode.format_timeout_ms or 5000 ,filter=FORMAT_FILTER}
|
||||||
augroup end
|
augroup end
|
||||||
]]
|
]])
|
||||||
end
|
end
|
||||||
|
|
|
@ -9,11 +9,11 @@ function M.smart_quit()
|
||||||
prompt = "You have unsaved changes. Quit anyway? (y/n) ",
|
prompt = "You have unsaved changes. Quit anyway? (y/n) ",
|
||||||
}, function(input)
|
}, function(input)
|
||||||
if input == "y" then
|
if input == "y" then
|
||||||
vim.cmd "q!"
|
vim.cmd("q!")
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
else
|
else
|
||||||
vim.cmd "q!"
|
vim.cmd("q!")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
local status_ok, impatient = pcall(require, "impatient")
|
local status_ok, impatient = pcall(require, "impatient")
|
||||||
if not status_ok then
|
if not status_ok then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
impatient.enable_profile()
|
impatient.enable_profile()
|
||||||
|
|
120
lua/user/jaq.lua
120
lua/user/jaq.lua
|
@ -1,82 +1,82 @@
|
||||||
M = {}
|
M = {}
|
||||||
local status_ok, jaq_nvim = pcall(require, "jaq-nvim")
|
local status_ok, jaq_nvim = pcall(require, "jaq-nvim")
|
||||||
if not status_ok then
|
if not status_ok then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
jaq_nvim.setup({
|
jaq_nvim.setup({
|
||||||
-- Commands used with 'Jaq'
|
-- Commands used with 'Jaq'
|
||||||
cmds = {
|
cmds = {
|
||||||
-- Default UI used (see `Usage` for options)
|
-- Default UI used (see `Usage` for options)
|
||||||
default = "term",
|
default = "term",
|
||||||
|
|
||||||
-- Uses external commands such as 'g++' and 'cargo'
|
-- Uses external commands such as 'g++' and 'cargo'
|
||||||
external = {
|
external = {
|
||||||
typescript = "deno run %",
|
typescript = "deno run %",
|
||||||
javascript = "node %",
|
javascript = "node %",
|
||||||
-- markdown = "glow %",
|
-- markdown = "glow %",
|
||||||
python = "python %",
|
python = "python %",
|
||||||
-- rust = "rustc % && ./$fileBase && rm $fileBase",
|
-- rust = "rustc % && ./$fileBase && rm $fileBase",
|
||||||
rust = "cargo run",
|
rust = "cargo run",
|
||||||
cpp = "g++ % -o $fileBase && ./$fileBase",
|
cpp = "g++ % -o $fileBase && ./$fileBase",
|
||||||
go = "go run %",
|
go = "go run %",
|
||||||
sh = "sh %",
|
sh = "sh %",
|
||||||
java = "java %",
|
java = "java %",
|
||||||
},
|
},
|
||||||
|
|
||||||
-- Uses internal commands such as 'source' and 'luafile'
|
-- Uses internal commands such as 'source' and 'luafile'
|
||||||
internal = {
|
internal = {
|
||||||
-- lua = "luafile %",
|
-- lua = "luafile %",
|
||||||
-- vim = "source %",
|
-- vim = "source %",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
behavior = {
|
behavior = {
|
||||||
-- Default type
|
-- Default type
|
||||||
default = "terminal",
|
default = "terminal",
|
||||||
|
|
||||||
-- Start in insert mode
|
-- Start in insert mode
|
||||||
startinsert = false,
|
startinsert = false,
|
||||||
|
|
||||||
-- Use `wincmd p` on startup
|
-- Use `wincmd p` on startup
|
||||||
wincmd = false,
|
wincmd = false,
|
||||||
|
|
||||||
-- Auto-save files
|
-- Auto-save files
|
||||||
autosave = false,
|
autosave = false,
|
||||||
},
|
},
|
||||||
|
|
||||||
-- UI settings
|
-- UI settings
|
||||||
ui = {
|
ui = {
|
||||||
-- Floating Window / FTerm settings
|
-- Floating Window / FTerm settings
|
||||||
float = {
|
float = {
|
||||||
-- Floating window border (see ':h nvim_open_win')
|
-- Floating window border (see ':h nvim_open_win')
|
||||||
border = "rounded", -- none, single, double, rounded
|
border = "rounded", -- none, single, double, rounded
|
||||||
|
|
||||||
-- Num from `0 - 1` for measurements
|
-- Num from `0 - 1` for measurements
|
||||||
height = 0.8,
|
height = 0.8,
|
||||||
width = 0.8,
|
width = 0.8,
|
||||||
x = 0.5,
|
x = 0.5,
|
||||||
y = 0.5,
|
y = 0.5,
|
||||||
|
|
||||||
-- Highlight group for floating window/border (see ':h winhl')
|
-- Highlight group for floating window/border (see ':h winhl')
|
||||||
border_hl = "FloatBorder",
|
border_hl = "FloatBorder",
|
||||||
float_hl = "Normal",
|
float_hl = "Normal",
|
||||||
|
|
||||||
-- Floating Window Transparency (see ':h winblend')
|
-- Floating Window Transparency (see ':h winblend')
|
||||||
blend = 0,
|
blend = 0,
|
||||||
},
|
},
|
||||||
|
|
||||||
terminal = {
|
terminal = {
|
||||||
-- Position of terminal
|
-- Position of terminal
|
||||||
position = "bot",
|
position = "bot",
|
||||||
|
|
||||||
-- Open the terminal without line numbers
|
-- Open the terminal without line numbers
|
||||||
line_no = false,
|
line_no = false,
|
||||||
|
|
||||||
-- Size of terminal
|
-- Size of terminal
|
||||||
size = 20,
|
size = 20,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
local opts = { noremap = true, silent = true }
|
local opts = { noremap = true, silent = true }
|
||||||
|
|
|
@ -2,11 +2,11 @@ local opts = { noremap = true, silent = true }
|
||||||
|
|
||||||
function _LIVE_SERVER()
|
function _LIVE_SERVER()
|
||||||
local Terminal = require("toggleterm.terminal").Terminal
|
local Terminal = require("toggleterm.terminal").Terminal
|
||||||
local live_server = Terminal:new {
|
local live_server = Terminal:new({
|
||||||
cmd = "live-server",
|
cmd = "live-server",
|
||||||
hidden = true,
|
hidden = true,
|
||||||
direction = "tab",
|
direction = "tab",
|
||||||
}
|
})
|
||||||
live_server:toggle()
|
live_server:toggle()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -159,7 +159,7 @@ end
|
||||||
-- if pcall(require, "dap") then
|
-- if pcall(require, "dap") then
|
||||||
-- modified function keys found with `showkey -a` in the terminal to get key code
|
-- 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
|
-- 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()
|
map("n", "<F5>", function()
|
||||||
require("dap").continue()
|
require("dap").continue()
|
||||||
end, "")
|
end, "")
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
local status_ok, mason_null_ls = pcall(require, "mason-null-ls")
|
local status_ok, mason_null_ls = pcall(require, "mason-null-ls")
|
||||||
if not status_ok then
|
if not status_ok then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
mason_null_ls.setup({
|
mason_null_ls.setup({
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
-- Opt to list sources here, when available in mason.
|
-- Opt to list sources here, when available in mason.
|
||||||
},
|
},
|
||||||
automatic_setup = true,
|
automatic_setup = true,
|
||||||
handlers = {},
|
handlers = {},
|
||||||
})
|
})
|
||||||
-- mason_null_ls.setup_handlers({})
|
-- mason_null_ls.setup_handlers({})
|
||||||
|
|
|
@ -1,18 +1,18 @@
|
||||||
local sources = {}
|
local sources = {}
|
||||||
local dap_data = pcode.dap_ensure_installed or {}
|
local dap_data = pcode.dap_ensure_installed or {}
|
||||||
for _, nullls in pairs(dap_data) do
|
for _, nullls in pairs(dap_data) do
|
||||||
table.insert(sources, nullls)
|
table.insert(sources, nullls)
|
||||||
end
|
end
|
||||||
require("mason").setup()
|
require("mason").setup()
|
||||||
require("mason-nvim-dap").setup({
|
require("mason-nvim-dap").setup({
|
||||||
ensure_installed = sources,
|
ensure_installed = sources,
|
||||||
automatic_setup = true,
|
automatic_setup = true,
|
||||||
handlers = {
|
handlers = {
|
||||||
function(config)
|
function(config)
|
||||||
-- all sources with no handler get passed here
|
-- all sources with no handler get passed here
|
||||||
|
|
||||||
-- Keep original functionality
|
-- Keep original functionality
|
||||||
require("mason-nvim-dap").default_setup(config)
|
require("mason-nvim-dap").default_setup(config)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
|
@ -51,12 +51,12 @@ end
|
||||||
|
|
||||||
-- vim.opt.shortmess = "ilmnrx" -- flags to shorten vim messages, see :help 'shortmess'
|
-- vim.opt.shortmess = "ilmnrx" -- flags to shorten vim messages, see :help 'shortmess'
|
||||||
-- vim.o.winbar = "%{%v:lua.require'nvim-navic'.get_location()%}"
|
-- vim.o.winbar = "%{%v:lua.require'nvim-navic'.get_location()%}"
|
||||||
vim.opt.shortmess:append "c" -- don't give |ins-completion-menu| messages
|
vim.opt.shortmess:append("c") -- don't give |ins-completion-menu| messages
|
||||||
vim.opt.iskeyword:append "-" -- hyphenated words recognized by searches
|
vim.opt.iskeyword:append("-") -- hyphenated words recognized by searches
|
||||||
vim.opt.formatoptions:remove { "t", "c", "q", "j" }
|
vim.opt.formatoptions:remove({ "t", "c", "q", "j" })
|
||||||
vim.opt.formatoptions = "croql"
|
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.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
|
-- config for blink cursor in normal, visual and insert mode
|
||||||
-- vim.opt.guicursor = {
|
-- vim.opt.guicursor = {
|
||||||
-- "n-v-c:block-Cursor/lCursor-blinkwait1000-blinkon100-blinkoff100",
|
-- "n-v-c:block-Cursor/lCursor-blinkwait1000-blinkon100-blinkoff100",
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
local status_ok = pcall(require, "luasnip")
|
local status_ok = pcall(require, "luasnip")
|
||||||
if not status_ok then
|
if not status_ok then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local lpath = vim.fn.stdpath("config") .. "/my-snippets"
|
local lpath = vim.fn.stdpath("config") .. "/my-snippets"
|
||||||
require("luasnip.loaders.from_vscode").lazy_load({
|
require("luasnip.loaders.from_vscode").lazy_load({
|
||||||
paths = lpath,
|
paths = lpath,
|
||||||
})
|
})
|
||||||
require("luasnip.loaders.from_vscode").load({ paths = lpath })
|
require("luasnip.loaders.from_vscode").load({ paths = lpath })
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
local alpha = require "alpha"
|
local alpha = require("alpha")
|
||||||
local startify = require "alpha.themes.startify"
|
local startify = require("alpha.themes.startify")
|
||||||
local dash_model = {}
|
local dash_model = {}
|
||||||
dash_model = {
|
dash_model = {
|
||||||
[[ _ __ __ ]],
|
[[ _ __ __ ]],
|
||||||
|
@ -63,9 +63,9 @@ vim.api.nvim_create_autocmd("User", {
|
||||||
vim.api.nvim_create_autocmd({ "User" }, {
|
vim.api.nvim_create_autocmd({ "User" }, {
|
||||||
pattern = { "AlphaReady" },
|
pattern = { "AlphaReady" },
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.cmd [[
|
vim.cmd([[
|
||||||
set laststatus=0 | autocmd BufUnload <buffer> set laststatus=3
|
set laststatus=0 | autocmd BufUnload <buffer> set laststatus=3
|
||||||
]]
|
]])
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
-- ignore filetypes in MRU
|
-- ignore filetypes in MRU
|
||||||
|
|
|
@ -1,71 +1,71 @@
|
||||||
local status_ok, tokyonight = pcall(require, "tokyonight")
|
local status_ok, tokyonight = pcall(require, "tokyonight")
|
||||||
if not status_ok then
|
if not status_ok then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local transp = false
|
local transp = false
|
||||||
local sidebar = "normal" --"dark , transparent, normal"
|
local sidebar = "normal" --"dark , transparent, normal"
|
||||||
local hilight = "#292e42"
|
local hilight = "#292e42"
|
||||||
local tras = pcode.transparent_mode or 0
|
local tras = pcode.transparent_mode or 0
|
||||||
if tras == 1 then
|
if tras == 1 then
|
||||||
transp = true
|
transp = true
|
||||||
sidebar = "transparent"
|
sidebar = "transparent"
|
||||||
-- hilight = "#3E4254"
|
-- hilight = "#3E4254"
|
||||||
-- hilight = "#353a56"
|
-- hilight = "#353a56"
|
||||||
hilight = "#292e42"
|
hilight = "#292e42"
|
||||||
end
|
end
|
||||||
|
|
||||||
tokyonight.setup({
|
tokyonight.setup({
|
||||||
-- your configuration comes here
|
-- your configuration comes here
|
||||||
-- or leave it empty to use the default settings
|
-- 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`
|
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
|
light_style = "day", -- The theme is used when the background is set to light
|
||||||
transparent = transp, -- Enable this to disable setting the background color
|
transparent = transp, -- Enable this to disable setting the background color
|
||||||
terminal_colors = true, -- Configure the colors used when opening a `:terminal` in Neovim
|
terminal_colors = true, -- Configure the colors used when opening a `:terminal` in Neovim
|
||||||
styles = {
|
styles = {
|
||||||
-- Style to be applied to different syntax groups
|
-- Style to be applied to different syntax groups
|
||||||
-- Value is any valid attr-list value for `:help nvim_set_hl`
|
-- Value is any valid attr-list value for `:help nvim_set_hl`
|
||||||
-- comments = { italic = true },
|
-- comments = { italic = true },
|
||||||
comments = { italic = true },
|
comments = { italic = true },
|
||||||
keywords = {},
|
keywords = {},
|
||||||
functions = {},
|
functions = {},
|
||||||
variables = {},
|
variables = {},
|
||||||
-- Background styles. Can be "dark", "transparent" or "normal"
|
-- Background styles. Can be "dark", "transparent" or "normal"
|
||||||
sidebars = sidebar, -- style for sidebars, see below
|
sidebars = sidebar, -- style for sidebars, see below
|
||||||
floats = sidebar, -- style for floating windows
|
floats = sidebar, -- style for floating windows
|
||||||
},
|
},
|
||||||
sidebars = { "qf", "help" }, -- Set a darker background on sidebar-like windows. For example: `["qf", "vista_kind", "terminal", "packer"]`
|
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
|
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**.
|
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
|
dim_inactive = false, -- dims inactive windows
|
||||||
lualine_bold = false, -- When `true`, section headers in the lualine theme will be bold
|
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
|
--- You can override specific color groups to use other groups or a hex color
|
||||||
--- function will be called with a ColorScheme table
|
--- function will be called with a ColorScheme table
|
||||||
-- @param colors ColorScheme
|
-- @param colors ColorScheme
|
||||||
on_colors = function(colors)
|
on_colors = function(colors)
|
||||||
colors.bg_highlight = hilight
|
colors.bg_highlight = hilight
|
||||||
colors.bg_statusline = colors.none
|
colors.bg_statusline = colors.none
|
||||||
end,
|
end,
|
||||||
|
|
||||||
--- You can override specific highlights to use other groups or a hex color
|
--- You can override specific highlights to use other groups or a hex color
|
||||||
--- function will be called with a Highlights and ColorScheme table
|
--- function will be called with a Highlights and ColorScheme table
|
||||||
--@param highlights Highlights
|
--@param highlights Highlights
|
||||||
-- @param colors ColorScheme
|
-- @param colors ColorScheme
|
||||||
on_highlights = function(highlights, colors)
|
on_highlights = function(highlights, colors)
|
||||||
highlights.NvimTreeFolderIcon = {
|
highlights.NvimTreeFolderIcon = {
|
||||||
bg = colors.none,
|
bg = colors.none,
|
||||||
fg = "#e0af68",
|
fg = "#e0af68",
|
||||||
}
|
}
|
||||||
highlights.Underlined = {
|
highlights.Underlined = {
|
||||||
underline = false,
|
underline = false,
|
||||||
}
|
}
|
||||||
highlights.NvimTreeWinSeparator = {
|
highlights.NvimTreeWinSeparator = {
|
||||||
fg = colors.border,
|
fg = colors.border,
|
||||||
}
|
}
|
||||||
highlights.BufferLineFill = { bg = colors.bg }
|
highlights.BufferLineFill = { bg = colors.bg }
|
||||||
highlights.NvimTreeSpecialFile = { fg = colors.purple, underline = false }
|
highlights.NvimTreeSpecialFile = { fg = colors.purple, underline = false }
|
||||||
highlights["@tag.attribute"] = { fg = colors.green1, italic = true }
|
highlights["@tag.attribute"] = { fg = colors.green1, italic = true }
|
||||||
-- highlights["@keyword.function"] = { fg = colors.blue, italic = true }
|
-- highlights["@keyword.function"] = { fg = colors.blue, italic = true }
|
||||||
-- highlights["@function"] = { fg = colors.blue, italic = true }
|
-- highlights["@function"] = { fg = colors.blue, italic = true }
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,42 +1,42 @@
|
||||||
local status_ok, tokyonight = pcall(require, "tokyonight")
|
local status_ok, tokyonight = pcall(require, "tokyonight")
|
||||||
if not status_ok then
|
if not status_ok then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
tokyonight.setup({
|
tokyonight.setup({
|
||||||
-- your configuration comes here
|
-- your configuration comes here
|
||||||
-- or leave it empty to use the default settings
|
-- 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`
|
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
|
light_style = "day", -- The theme is used when the background is set to light
|
||||||
transparent = true, -- Enable this to disable setting the background color
|
transparent = true, -- Enable this to disable setting the background color
|
||||||
terminal_colors = true, -- Configure the colors used when opening a `:terminal` in Neovim
|
terminal_colors = true, -- Configure the colors used when opening a `:terminal` in Neovim
|
||||||
styles = {
|
styles = {
|
||||||
-- Style to be applied to different syntax groups
|
-- Style to be applied to different syntax groups
|
||||||
-- Value is any valid attr-list value for `:help nvim_set_hl`
|
-- Value is any valid attr-list value for `:help nvim_set_hl`
|
||||||
-- comments = { italic = true },
|
-- comments = { italic = true },
|
||||||
comments = { italic = true },
|
comments = { italic = true },
|
||||||
keywords = { italic = true },
|
keywords = { italic = true },
|
||||||
functions = {},
|
functions = {},
|
||||||
variables = {},
|
variables = {},
|
||||||
-- Background styles. Can be "dark", "transparent" or "normal"
|
-- Background styles. Can be "dark", "transparent" or "normal"
|
||||||
sidebars = "transparent", -- style for sidebars, see below
|
sidebars = "transparent", -- style for sidebars, see below
|
||||||
floats = "transparent", -- style for floating windows
|
floats = "transparent", -- style for floating windows
|
||||||
},
|
},
|
||||||
sidebars = { "qf", "help" }, -- Set a darker background on sidebar-like windows. For example: `["qf", "vista_kind", "terminal", "packer"]`
|
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
|
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**.
|
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
|
dim_inactive = false, -- dims inactive windows
|
||||||
lualine_bold = false, -- When `true`, section headers in the lualine theme will be bold
|
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
|
--- You can override specific color groups to use other groups or a hex color
|
||||||
--- function will be called with a ColorScheme table
|
--- function will be called with a ColorScheme table
|
||||||
--@param colors ColorScheme
|
--@param colors ColorScheme
|
||||||
on_colors = function(colors)
|
on_colors = function(colors)
|
||||||
colors.bg_highlight = "#9EA0A9"
|
colors.bg_highlight = "#9EA0A9"
|
||||||
end,
|
end,
|
||||||
|
|
||||||
--- You can override specific highlights to use other groups or a hex color
|
--- You can override specific highlights to use other groups or a hex color
|
||||||
--- function will be called with a Highlights and ColorScheme table
|
--- function will be called with a Highlights and ColorScheme table
|
||||||
--@param highlights Highlights
|
--@param highlights Highlights
|
||||||
--@param colors ColorScheme
|
--@param colors ColorScheme
|
||||||
--on_highlights = function(highlights, colors) end,
|
--on_highlights = function(highlights, colors) end,
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,44 +1,44 @@
|
||||||
local M = {}
|
local M = {}
|
||||||
function M.bufremove(buf)
|
function M.bufremove(buf)
|
||||||
buf = buf or 0
|
buf = buf or 0
|
||||||
buf = buf == 0 and vim.api.nvim_get_current_buf() or buf
|
buf = buf == 0 and vim.api.nvim_get_current_buf() or buf
|
||||||
|
|
||||||
if vim.bo.modified then
|
if vim.bo.modified then
|
||||||
local choice = vim.fn.confirm(("Save changes to %q?"):format(vim.fn.bufname()), "&Yes\n&No\n&Cancel")
|
local choice = vim.fn.confirm(("Save changes to %q?"):format(vim.fn.bufname()), "&Yes\n&No\n&Cancel")
|
||||||
if choice == 0 then -- Cancel
|
if choice == 0 then -- Cancel
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if choice == 1 then -- Yes
|
if choice == 1 then -- Yes
|
||||||
vim.cmd.write()
|
vim.cmd.write()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
for _, win in ipairs(vim.fn.win_findbuf(buf)) do
|
for _, win in ipairs(vim.fn.win_findbuf(buf)) do
|
||||||
vim.api.nvim_win_call(win, function()
|
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
|
if not vim.api.nvim_win_is_valid(win) or vim.api.nvim_win_get_buf(win) ~= buf then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
-- Try using alternate buffer
|
-- Try using alternate buffer
|
||||||
local alt = vim.fn.bufnr("#")
|
local alt = vim.fn.bufnr("#")
|
||||||
if alt ~= buf and vim.fn.buflisted(alt) == 1 then
|
if alt ~= buf and vim.fn.buflisted(alt) == 1 then
|
||||||
vim.api.nvim_win_set_buf(win, alt)
|
vim.api.nvim_win_set_buf(win, alt)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Try using previous buffer
|
-- Try using previous buffer
|
||||||
local has_previous = pcall(vim.cmd, "bprevious")
|
local has_previous = pcall(vim.cmd, "bprevious")
|
||||||
if has_previous and buf ~= vim.api.nvim_win_get_buf(win) then
|
if has_previous and buf ~= vim.api.nvim_win_get_buf(win) then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Create new listed buffer
|
-- Create new listed buffer
|
||||||
local new_buf = vim.api.nvim_create_buf(true, false)
|
local new_buf = vim.api.nvim_create_buf(true, false)
|
||||||
vim.api.nvim_win_set_buf(win, new_buf)
|
vim.api.nvim_win_set_buf(win, new_buf)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
if vim.api.nvim_buf_is_valid(buf) then
|
if vim.api.nvim_buf_is_valid(buf) then
|
||||||
pcall(vim.cmd, "bdelete! " .. buf)
|
pcall(vim.cmd, "bdelete! " .. buf)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
@ -2,9 +2,9 @@ local null_ls = require("null-ls")
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
M.list_registered = function(filetype)
|
M.list_registered = function(filetype)
|
||||||
local method = null_ls.methods.FORMATTING
|
local method = null_ls.methods.FORMATTING
|
||||||
local registered_providers = require("user.utils.lsp").list_registered_providers_names(filetype)
|
local registered_providers = require("user.utils.lsp").list_registered_providers_names(filetype)
|
||||||
return registered_providers[method] or {}
|
return registered_providers[method] or {}
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
@ -2,18 +2,18 @@ local null_ls = require("null-ls")
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
M.alternative_methods = {
|
M.alternative_methods = {
|
||||||
null_ls.methods.DIAGNOSTICS,
|
null_ls.methods.DIAGNOSTICS,
|
||||||
null_ls.methods.DIAGNOSTICS_ON_OPEN,
|
null_ls.methods.DIAGNOSTICS_ON_OPEN,
|
||||||
null_ls.methods.DIAGNOSTICS_ON_SAVE,
|
null_ls.methods.DIAGNOSTICS_ON_SAVE,
|
||||||
}
|
}
|
||||||
|
|
||||||
M.linter_list_registered = function(filetype)
|
M.linter_list_registered = function(filetype)
|
||||||
local registered_providers = require("user.utils.lsp").list_registered_providers_names(filetype)
|
local registered_providers = require("user.utils.lsp").list_registered_providers_names(filetype)
|
||||||
local providers_for_methods = vim.iter(vim.tbl_map(function(m)
|
local providers_for_methods = vim.iter(vim.tbl_map(function(m)
|
||||||
return registered_providers[m] or {}
|
return registered_providers[m] or {}
|
||||||
end, M.alternative_methods))
|
end, M.alternative_methods))
|
||||||
|
|
||||||
return providers_for_methods
|
return providers_for_methods
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
M.list_registered_providers_names = function(filetype)
|
M.list_registered_providers_names = function(filetype)
|
||||||
local s = require("null-ls.sources")
|
local s = require("null-ls.sources")
|
||||||
local available_sources = s.get_available(filetype)
|
local available_sources = s.get_available(filetype)
|
||||||
local registered = {}
|
local registered = {}
|
||||||
for _, source in ipairs(available_sources) do
|
for _, source in ipairs(available_sources) do
|
||||||
for method in pairs(source.methods) do
|
for method in pairs(source.methods) do
|
||||||
registered[method] = registered[method] or {}
|
registered[method] = registered[method] or {}
|
||||||
table.insert(registered[method], source.name)
|
table.insert(registered[method], source.name)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return registered
|
return registered
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
local hide_in_width = function()
|
local hide_in_width = function()
|
||||||
return vim.fn.winwidth(0) > 75
|
return vim.fn.winwidth(0) > 75
|
||||||
end
|
end
|
||||||
local icons = require "user.icons"
|
local icons = require("user.icons")
|
||||||
local formatter = require "user.utils.formatter"
|
local formatter = require("user.utils.formatter")
|
||||||
local linter = require "user.utils.linter"
|
local linter = require("user.utils.linter")
|
||||||
|
|
||||||
local getLeftSubstring = function(word, length)
|
local getLeftSubstring = function(word, length)
|
||||||
if #word > length then
|
if #word > length then
|
||||||
|
@ -86,7 +86,7 @@ return {
|
||||||
local buf_ft = vim.bo.filetype
|
local buf_ft = vim.bo.filetype
|
||||||
-- start register
|
-- start register
|
||||||
local buf_clients = {}
|
local buf_clients = {}
|
||||||
buf_clients = vim.lsp.get_clients { bufnr = 0 }
|
buf_clients = vim.lsp.get_clients({ bufnr = 0 })
|
||||||
local buf_client_names = {}
|
local buf_client_names = {}
|
||||||
if next(buf_clients) == nil then
|
if next(buf_clients) == nil then
|
||||||
-- TODO: clean up this if statement
|
-- TODO: clean up this if statement
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
local component = require "user.utils.lualine_component"
|
local component = require("user.utils.lualine_component")
|
||||||
local treesitter = component.treesitter
|
local treesitter = component.treesitter
|
||||||
local lsp_info = component.lsp_info
|
local lsp_info = component.lsp_info
|
||||||
local diagnostics = component.diagnostics
|
local diagnostics = component.diagnostics
|
||||||
|
|
|
@ -3,7 +3,7 @@ local M = {}
|
||||||
-- for debug
|
-- for debug
|
||||||
local debug_key = {}
|
local debug_key = {}
|
||||||
|
|
||||||
if vim.fn.has "win32" == 0 then
|
if vim.fn.has("win32") == 0 then
|
||||||
debug_key = {
|
debug_key = {
|
||||||
name = " Debug",
|
name = " Debug",
|
||||||
t = { "<cmd>lua require'dap'.toggle_breakpoint()<cr>", "Toggle Breakpoint" },
|
t = { "<cmd>lua require'dap'.toggle_breakpoint()<cr>", "Toggle Breakpoint" },
|
||||||
|
@ -26,47 +26,47 @@ end
|
||||||
|
|
||||||
function M._LAZYGIT_TOGGLE()
|
function M._LAZYGIT_TOGGLE()
|
||||||
local Terminal = require("toggleterm.terminal").Terminal
|
local Terminal = require("toggleterm.terminal").Terminal
|
||||||
local lazygit = Terminal:new { cmd = "lazygit", hidden = true }
|
local lazygit = Terminal:new({ cmd = "lazygit", hidden = true })
|
||||||
lazygit:toggle()
|
lazygit:toggle()
|
||||||
end
|
end
|
||||||
|
|
||||||
function M._NODE_TOGGLE()
|
function M._NODE_TOGGLE()
|
||||||
local Terminal = require("toggleterm.terminal").Terminal
|
local Terminal = require("toggleterm.terminal").Terminal
|
||||||
local node = Terminal:new { cmd = "node", hidden = true }
|
local node = Terminal:new({ cmd = "node", hidden = true })
|
||||||
node:toggle()
|
node:toggle()
|
||||||
end
|
end
|
||||||
|
|
||||||
function M._BTOP_TOGGLE()
|
function M._BTOP_TOGGLE()
|
||||||
local Terminal = require("toggleterm.terminal").Terminal
|
local Terminal = require("toggleterm.terminal").Terminal
|
||||||
local htop = Terminal:new { cmd = "btop", hidden = true }
|
local htop = Terminal:new({ cmd = "btop", hidden = true })
|
||||||
htop:toggle()
|
htop:toggle()
|
||||||
end
|
end
|
||||||
|
|
||||||
function M._PYTHON_TOGGLE()
|
function M._PYTHON_TOGGLE()
|
||||||
local Terminal = require("toggleterm.terminal").Terminal
|
local Terminal = require("toggleterm.terminal").Terminal
|
||||||
local python = Terminal:new { cmd = "python", hidden = true }
|
local python = Terminal:new({ cmd = "python", hidden = true })
|
||||||
python:toggle()
|
python:toggle()
|
||||||
end
|
end
|
||||||
|
|
||||||
function M._NEWTAB_TOGGLE()
|
function M._NEWTAB_TOGGLE()
|
||||||
local Terminal = require("toggleterm.terminal").Terminal
|
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()
|
pwsh:toggle()
|
||||||
end
|
end
|
||||||
|
|
||||||
function M._OPEN_EXPLORER()
|
function M._OPEN_EXPLORER()
|
||||||
local Terminal = require("toggleterm.terminal").Terminal
|
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()
|
pwsh:toggle()
|
||||||
end
|
end
|
||||||
|
|
||||||
function M._LIVE_SERVER()
|
function M._LIVE_SERVER()
|
||||||
local Terminal = require("toggleterm.terminal").Terminal
|
local Terminal = require("toggleterm.terminal").Terminal
|
||||||
local live_server = Terminal:new {
|
local live_server = Terminal:new({
|
||||||
cmd = "live-server",
|
cmd = "live-server",
|
||||||
hidden = true,
|
hidden = true,
|
||||||
direction = "tab",
|
direction = "tab",
|
||||||
}
|
})
|
||||||
live_server:toggle()
|
live_server:toggle()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -30,9 +30,9 @@ local excludes = function()
|
||||||
end
|
end
|
||||||
|
|
||||||
local get_filename = function()
|
local get_filename = function()
|
||||||
local filename = vim.fn.expand "%:t"
|
local filename = vim.fn.expand("%:t")
|
||||||
local extension = vim.fn.expand "%:e"
|
local extension = vim.fn.expand("%:e")
|
||||||
local f = require "user.functions"
|
local f = require("user.functions")
|
||||||
|
|
||||||
if not f.isempty(filename) then
|
if not f.isempty(filename) then
|
||||||
local file_icon, hl_group = require("nvim-web-devicons").get_icon(filename, extension, { default = true })
|
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
|
if excludes() then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local f = require "user.functions"
|
local f = require("user.functions")
|
||||||
local value = get_filename()
|
local value = get_filename()
|
||||||
|
|
||||||
local gps_added = false
|
local gps_added = false
|
||||||
|
@ -114,7 +114,7 @@ local get_winbar = function()
|
||||||
end
|
end
|
||||||
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
|
-- TODO: replace with circle
|
||||||
local mod = "%#LspCodeLens#" .. icons.ui.Circle .. "%*"
|
local mod = "%#LspCodeLens#" .. icons.ui.Circle .. "%*"
|
||||||
if gps_added then
|
if gps_added then
|
||||||
|
@ -138,7 +138,7 @@ local get_winbar = function()
|
||||||
end
|
end
|
||||||
|
|
||||||
vim.api.nvim_create_augroup("_winbar", {})
|
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(
|
vim.api.nvim_create_autocmd(
|
||||||
{ "CursorHoldI", "CursorHold", "BufWinEnter", "BufFilePost", "InsertEnter", "BufWritePost", "TabClosed" },
|
{ "CursorHoldI", "CursorHold", "BufWinEnter", "BufFilePost", "InsertEnter", "BufWritePost", "TabClosed" },
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue