enc: global variable pcode

This commit is contained in:
asep.komarudin 2024-06-14 08:21:36 +07:00
parent ecc54b9f87
commit 65857a4226
45 changed files with 132 additions and 131 deletions

View file

@ -1,11 +1,12 @@
require "custom.default" _G.pcode = _G.pcode or {}
require "custom.dashboard" require("custom.default")
require "config.lazy_lib" require("custom.dashboard")
require "user.colorscheme" require("config.lazy_lib")
require "user.keymaps" require("user.colorscheme")
require "core.neovide" require("user.keymaps")
require "custom.autocmd" require("core.neovide")
require "custom.keymaps" require("custom.autocmd")
require("custom.keymaps")
-- require("user.snip") -- require("user.snip")
-- require("user.nvim-tree") -- require("user.nvim-tree")
-- require("user.options") -- require("user.options")

View file

@ -1,4 +1,4 @@
local transparent_mode = vim.g.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"

View file

@ -14,10 +14,10 @@
-- solarized-osaka -- solarized-osaka
-- darcula-dark -- darcula-dark
-- juliana -- juliana
vim.g.pcode_colorscheme = "darcula-dark" pcode.colorscheme = "darcula-dark"
-- 0 =off 1= on -- 0 =off 1= on
vim.g.pcode_transparent_mode = 0 pcode.transparent_mode = 0
-- rounded -- rounded
-- roundedall -- roundedall
-- square -- square
@ -25,40 +25,40 @@ vim.g.pcode_transparent_mode = 0
-- parallelogram -- parallelogram
-- transparent -- transparent
-- default -- default
vim.g.pcode_lualinetheme = "roundedall" pcode.lualinetheme = "roundedall"
-- 0 disable progress -- 0 disable progress
-- 1 lualine lsp progress -- 1 lualine lsp progress
-- 2 fidget progress -- 2 fidget progress
vim.g.pcode_progress = 1 pcode.progress = 1
-- 0 = on full text mode info, -- 0 = on full text mode info,
-- 1 = on initial mode + logo -- 1 = on initial mode + logo
-- 2 = logo only -- 2 = logo only
-- 3 = initial only -- 3 = initial only
-- 4 = off -- 4 = off
vim.g.pcode_show_mode = 3 pcode.show_mode = 3
-- 1 ( format jalan) 0 (fromat off) -- 1 ( format jalan) 0 (fromat off)
vim.g.pcode_format_on_save = 1 pcode.format_on_save = 1
vim.g.pcode_format_timeout_ms = 5000 pcode.format_timeout_ms = 5000
-- ini hanya untuk lsp yg tidak support masson -- ini hanya untuk lsp yg tidak support masson
-- untuk referesi support language kunjungi link dibawah -- untuk referesi support language kunjungi link dibawah
-- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md -- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
vim.g.pcode_lsp_installer = { pcode.lsp_installer = {
-- "yamlls", -- "yamlls",
-- tambahkan di bawah sini setelah melakukan :masoninstall -- tambahkan di bawah sini setelah melakukan :masoninstall
} }
-- use for lsp diagnostics virtual text -- use for lsp diagnostics virtual text
vim.g.pcode_lsp_virtualtext = true pcode.lsp_virtualtext = true
-- use for lsp ghost text config -- use for lsp ghost text config
vim.g.pcode_lspghost_text = false pcode.lspghost_text = false
-- untuk referesi support language kunjungi link dibawah -- untuk referesi support language kunjungi link dibawah
-- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md -- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
vim.g.pcode_mason_ensure_installed = { -- sebelumnya register_lsp pcode.mason_ensure_installed = { -- sebelumnya register_lsp
-- "yamlls", -- "yamlls",
-- "intelephense", -- "intelephense",
-- "marksman", -- "marksman",
@ -68,24 +68,24 @@ vim.g.pcode_mason_ensure_installed = { -- sebelumnya register_lsp
-- "kotlin_language_server", -- "kotlin_language_server",
-- tambahkan di bawah sini setelah melakukan :masoninstall -- tambahkan di bawah sini setelah melakukan :masoninstall
} }
vim.g.pcode_unregister_lsp = { pcode.unregister_lsp = {
"jdtls", -- tambahkan di bawah ini "jdtls", -- tambahkan di bawah ini
} }
-- https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/doc/BUILTINS.md -- https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/doc/BUILTINS.md
vim.g.pcode_null_ls_ensure_installed = { pcode.null_ls_ensure_installed = {
"stylua", "stylua",
} }
-- dap instal hanya support linux dan mac -- dap instal hanya support linux dan mac
-- https://github.com/jay-babu/mason-nvim-dap.nvim/blob/main/lua/mason-nvim-dap/mappings/source.lua -- https://github.com/jay-babu/mason-nvim-dap.nvim/blob/main/lua/mason-nvim-dap/mappings/source.lua
-- atau gunakan :MasonInstall -- atau gunakan :MasonInstall
vim.g.pcode_dap_ensure_installed = { pcode.dap_ensure_installed = {
-- "python", -- "python",
} }
-- https://github.com/folke/which-key.nvim -- https://github.com/folke/which-key.nvim
vim.g.pcode_whichkey = { pcode.whichkey = {
-- contoh penambahan -- contoh penambahan
["k"] = { ["k"] = {
name = "Example", name = "Example",
@ -99,44 +99,44 @@ vim.g.pcode_whichkey = {
-- https://github.com/CRAG666/code_runner.nvim -- https://github.com/CRAG666/code_runner.nvim
-- ready default java, python, typescript, javascript, rust, cpp, scss -- ready default java, python, typescript, javascript, rust, cpp, scss
vim.g.pcode_coderunner = { pcode.coderunner = {
go = "go run $fileName", go = "go run $fileName",
html = "live-server $dir/$fileName", html = "live-server $dir/$fileName",
} }
-- 0 = normal -- 0 = normal
-- 1 = float -- 1 = float
vim.g.pcode_nvimtree_isfloat = 0 pcode.nvimtree_isfloat = 0
vim.g.pcode_tailwindcolorizer = false pcode.tailwindcolorizer = false
-- https://github.com/Exafunction/codeium.vim -- https://github.com/Exafunction/codeium.vim
vim.g.pcode_codeium = false pcode.codeium = false
-- https://github.com/Exafunction/codeium.nvim -- https://github.com/Exafunction/codeium.nvim
vim.g.pcode_codeium_nvim = true pcode.codeium_nvim = true
-- https://github.com/kevinhwang91/nvim-ufo -- https://github.com/kevinhwang91/nvim-ufo
vim.g.pcode_nvimufo = false pcode.nvimufo = false
-- https://github.com/echasnovski/mini.indentscope -- https://github.com/echasnovski/mini.indentscope
vim.g.pcode_indentscope = true pcode.indentscope = true
-- https://github.com/echasnovski/mini.animate -- https://github.com/echasnovski/mini.animate
vim.g.pcode_minianimate = false pcode.minianimate = false
vim.g.pcode_disable_cmpdoc = false pcode.disable_cmpdoc = false
-- https://github.com/rachartier/tiny-devicons-auto-colors.nvim -- https://github.com/rachartier/tiny-devicons-auto-colors.nvim
vim.g.pcode_adaptive_color_icon = true pcode.adaptive_color_icon = true
-- https://github.com/lukas-reineke/virt-column.nvim -- https://github.com/lukas-reineke/virt-column.nvim
vim.g.pcode_columnline = true pcode.columnline = true
---@alias telescope_themes ---@alias telescope_themes
---| "cursor" # see `telescope.themes.get_cursor()` ---| "cursor" # see `telescope.themes.get_cursor()`
---| "dropdown" # see `telescope.themes.get_dropdown()` ---| "dropdown" # see `telescope.themes.get_dropdown()`
---| "ivy" # see `telescope.themes.get_ivy()` ---| "ivy" # see `telescope.themes.get_ivy()`
---| "center" # retain the default telescope theme ---| "center" # retain the default telescope theme
vim.g.pcode_telescope_theme_find_file = "center" pcode.telescope_theme_find_file = "center"
vim.g.pcode_telescope_theme_live_grep = "dropdown" pcode.telescope_theme_live_grep = "dropdown"
-- https://github.com/kristijanhusak/vim-dadbod-ui -- https://github.com/kristijanhusak/vim-dadbod-ui
vim.g.pcode_database = false pcode.database = false
-- https://github.com/nvim-neotest/neotest-jest -- https://github.com/nvim-neotest/neotest-jest
vim.g.pcode_jest = true pcode.jest = true
vim.g.pcode_jest_command = "npm test -- " pcode.jest_command = "npm test -- "
vim.g.pcode_jest_config = "jest.config.mjs" pcode.jest_config = "jest.config.mjs"

View file

@ -1,4 +1,4 @@
local lspghost_text = vim.g.pcode_lspghost_text or false local lspghost_text = pcode.lspghost_text or false
local icons = require("user.icons").ui local icons = require("user.icons").ui
local cmp_documentation = { local cmp_documentation = {
border = icons.Border, border = icons.Border,
@ -100,7 +100,7 @@ return {
winhighlight = "Normal:bg,FloatBorder:BorderBG,CursorLine:PmenuSel,Search:None", winhighlight = "Normal:bg,FloatBorder:BorderBG,CursorLine:PmenuSel,Search:None",
scrollbar = true, scrollbar = true,
}, },
documentation = vim.g.pcode_disable_cmpdoc and cmp.config.disable or cmp_documentation, documentation = pcode.disable_cmpdoc and cmp.config.disable or cmp_documentation,
}, },
experimental = { experimental = {
ghost_text = lspghost_text, ghost_text = lspghost_text,

View file

@ -1,5 +1,5 @@
local M = {} local M = {}
if vim.g.pcode_codeium then if pcode.codeium then
M.codeium = { M.codeium = {
"Exafunction/codeium.vim", "Exafunction/codeium.vim",
enabled = true, enabled = true,

View file

@ -1,4 +1,4 @@
if vim.g.pcode_codeium_nvim then if pcode.codeium_nvim then
return { return {
-- codeium cmp source -- codeium cmp source
{ {

View file

@ -10,7 +10,7 @@ local rfile = {
javascript = 'node "$dir/$fileName"', javascript = 'node "$dir/$fileName"',
} }
local runscript = vim.g.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",

View file

@ -1,5 +1,5 @@
local M = {} local M = {}
if vim.g.pcode_database then if pcode.database then
return { return {
"kristijanhusak/vim-dadbod-ui", "kristijanhusak/vim-dadbod-ui",
dependencies = { dependencies = {

View file

@ -1,5 +1,5 @@
local M = {} local M = {}
if vim.g.pcode_adaptive_color_icon then if pcode.adaptive_color_icon then
M = { M = {
"rachartier/tiny-devicons-auto-colors.nvim", "rachartier/tiny-devicons-auto-colors.nvim",
event = "VeryLazy", event = "VeryLazy",

View file

@ -1,10 +1,10 @@
local icons = vim.g.pcode_icons local icons = vim.g.pcode_icons
if vim.g.pcode_indentscope and true or false then if pcode.indentscope and true or false then
return { return {
"echasnovski/mini.indentscope", "echasnovski/mini.indentscope",
version = false, -- wait till new 0.7.0 release to put it back on semver version = false, -- wait till new 0.7.0 release to put it back on semver
event = "BufReadPre", event = "BufReadPre",
enabled = vim.g.pcode_indentscope and true or false, enabled = pcode.indentscope and true or false,
opts = { opts = {
symbol = icons.ui.LineMiddle, symbol = icons.ui.LineMiddle,
options = { try_as_border = true }, options = { try_as_border = true },

View file

@ -20,13 +20,13 @@ end
local fidget = true local fidget = true
local lualine = false local lualine = false
if vim.g.pcode_progress == 1 then if pcode.progress == 1 then
fidget = false fidget = false
lualine = true lualine = true
elseif vim.g.pcode_progress == 2 then elseif pcode.progress == 2 then
fidget = true fidget = true
lualine = false lualine = false
elseif vim.g.pcode_progress == 0 then elseif pcode.progress == 0 then
fidget = false fidget = false
lualine = false lualine = false
else else

View file

@ -9,7 +9,7 @@ return {
-- check config for theme -- check config for theme
local set_theme = "auto" local set_theme = "auto"
local bubbles_theme local bubbles_theme
local color = vim.g.pcode_colorscheme local color = pcode.colorscheme
switch(color, { switch(color, {
["tokyonight"] = function() ["tokyonight"] = function()
set_theme = "auto" set_theme = "auto"
@ -44,7 +44,7 @@ return {
end end
local gettheme = require "user.utils.lualine_template" local gettheme = require "user.utils.lualine_template"
local theme_option = vim.g.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
theme = gettheme.rounded(bubbles_theme) theme = gettheme.rounded(bubbles_theme)

View file

@ -1,10 +1,10 @@
if not vim.g.neovide and vim.g.pcode_minianimate and true or false then if not vim.g.neovide and pcode.minianimate and true or false then
return { return {
-- animations -- animations
{ {
"echasnovski/mini.animate", "echasnovski/mini.animate",
event = "BufRead", event = "BufRead",
enabled = not vim.g.neovide and vim.g.pcode_minianimate and true or false, enabled = not vim.g.neovide and pcode.minianimate and true or false,
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

View file

@ -1,6 +1,6 @@
local icons = vim.g.pcode_icons local icons = vim.g.pcode_icons
local set_view = {} local set_view = {}
if vim.g.pcode_nvimtree_isfloat == 1 then if pcode.nvimtree_isfloat == 1 then
set_view = require("user.utils.nvimtree").float set_view = require("user.utils.nvimtree").float
else else
set_view = require("user.utils.nvimtree").normal set_view = require("user.utils.nvimtree").normal

View file

@ -12,7 +12,7 @@ local icons = vim.g.pcode_icons.folding
local M = {} local M = {}
if vim.g.pcode_nvimufo then if pcode.nvimufo then
M.ufo = { M.ufo = {
"kevinhwang91/nvim-ufo", "kevinhwang91/nvim-ufo",
dependencies = { dependencies = {

View file

@ -1,5 +1,5 @@
local M = {} local M = {}
if vim.g.pcode_tailwindcolorizer then if pcode.tailwindcolorizer then
M.tailwind = { M.tailwind = {
{ {
"NvChad/nvim-colorizer.lua", "NvChad/nvim-colorizer.lua",

View file

@ -10,15 +10,15 @@ return {
local live_grep = { local live_grep = {
only_sort_text = true, only_sort_text = true,
} }
if vim.g.pcode_telescope_theme_find_file and vim.g.pcode_telescope_theme_find_file ~= "center" then if pcode.telescope_theme_find_file and pcode.telescope_theme_find_file ~= "center" then
find_files = { find_files = {
theme = vim.g.pcode_telescope_theme_find_file, theme = pcode.telescope_theme_find_file,
hidden = true, hidden = true,
} }
end end
if vim.g.pcode_telescope_theme_live_grep and vim.g.pcode_telescope_theme_live_grep ~= "center" then if pcode.telescope_theme_live_grep and pcode.telescope_theme_live_grep ~= "center" then
live_grep = { live_grep = {
theme = vim.g.pcode_telescope_theme_live_grep, theme = pcode.telescope_theme_live_grep,
only_sort_text = true, only_sort_text = true,
} }
end end

View file

@ -1,6 +1,6 @@
local M = {} local M = {}
local config_file = vim.g.pcode_jest_config or "jest.config.ts" local config_file = pcode.jest_config or "jest.config.ts"
if vim.g.pcode_jest then if pcode.jest then
M = { M = {
{ {
"nvim-neotest/neotest", "nvim-neotest/neotest",
@ -12,7 +12,7 @@ if vim.g.pcode_jest then
opts = { opts = {
adapters = { adapters = {
["neotest-jest"] = { ["neotest-jest"] = {
jestCommand = vim.g.pcode_jest_command or "npm test -- ", jestCommand = pcode.jest_command or "npm test -- ",
jestConfigFile = function() jestConfigFile = function()
local file = vim.fn.expand("%:p") local file = vim.fn.expand("%:p")
if string.find(file, "/packages/") then if string.find(file, "/packages/") then

View file

@ -25,7 +25,7 @@ _G.extract = function(text)
end end
_G.all_trim = function(s) _G.all_trim = function(s)
return s:match "^%s*(.-)%s*$" return s:match("^%s*(.-)%s*$")
end end
return {} return {}

View file

@ -1,5 +1,5 @@
local color = vim.g.pcode_colorscheme or "gruvbox-baby" local color = pcode.colorscheme or "gruvbox-baby"
local transparent_mode = vim.g.pcode_transparent_mode or 0 local transparent_mode = pcode.transparent_mode or 0
if substring(tostring(color), "catppuccin") and true or false then if substring(tostring(color), "catppuccin") and true or false then
return { return {

View file

@ -1,5 +1,5 @@
local color = vim.g.pcode_colorscheme or "gruvbox-baby" local color = pcode.colorscheme or "gruvbox-baby"
local transparent_mode = vim.g.pcode_transparent_mode or 0 local transparent_mode = pcode.transparent_mode or 0
if (color == "dracula") and true or false then if (color == "dracula") and true or false then
return { return {

View file

@ -1,5 +1,5 @@
local color = vim.g.pcode_colorscheme or "gruvbox-baby" local color = pcode.colorscheme or "gruvbox-baby"
local transparent_mode = vim.g.pcode_transparent_mode or 0 local transparent_mode = pcode.transparent_mode or 0
if substring(tostring(color), "github") and true or false then if substring(tostring(color), "github") and true or false then
return { return {

View file

@ -1,5 +1,5 @@
local color = vim.g.pcode_colorscheme or "gruvbox-baby" local color = pcode.colorscheme or "gruvbox-baby"
local transparent_mode = vim.g.pcode_transparent_mode or 0 local transparent_mode = pcode.transparent_mode or 0
if (color == "gruvbox-baby") and true or false then if (color == "gruvbox-baby") and true or false then
return { return {
"luisiacc/gruvbox-baby", "luisiacc/gruvbox-baby",

View file

@ -1,4 +1,4 @@
local color = vim.g.pcode_colorscheme or "gruvbox-baby" local color = pcode.colorscheme or "gruvbox-baby"
if (color == "darcula-dark") and true or false then if (color == "darcula-dark") and true or false then
return { return {

View file

@ -1,4 +1,4 @@
local color = vim.g.pcode_colorscheme or "gruvbox-baby" local color = pcode.colorscheme or "gruvbox-baby"
if (color == "juliana") and true or false then if (color == "juliana") and true or false then
return { return {

View file

@ -1,5 +1,5 @@
local color = vim.g.pcode_colorscheme or "gruvbox-baby" local color = pcode.colorscheme or "gruvbox-baby"
local transparent_mode = vim.g.pcode_transparent_mode or 0 local transparent_mode = pcode.transparent_mode or 0
local materialstyle = extract(color)[2] or "oceanic" local materialstyle = extract(color)[2] or "oceanic"
local material_style = (materialstyle == "deepocean") and "deep ocean" or materialstyle local material_style = (materialstyle == "deepocean") and "deep ocean" or materialstyle

View file

@ -1,6 +1,6 @@
local nightfox = false local nightfox = false
local color = vim.g.pcode_colorscheme or "gruvbox-baby" local color = pcode.colorscheme or "gruvbox-baby"
local transparent_mode = vim.g.pcode_transparent_mode or 0 local transparent_mode = pcode.transparent_mode or 0
switch(color, { switch(color, {
["nightfox"] = function() ["nightfox"] = function()
nightfox = true nightfox = true

View file

@ -1,5 +1,5 @@
local color = vim.g.pcode_colorscheme or "gruvbox-baby" local color = pcode.colorscheme or "gruvbox-baby"
local transparent_mode = vim.g.pcode_transparent_mode or 0 local transparent_mode = pcode.transparent_mode or 0
if (color == "nord") and true or false then if (color == "nord") and true or false then
return { return {

View file

@ -1,5 +1,5 @@
local color = vim.g.pcode_colorscheme or "gruvbox-baby" local color = pcode.colorscheme or "gruvbox-baby"
local transparent_mode = vim.g.pcode_transparent_mode or 0 local transparent_mode = pcode.transparent_mode or 0
if substring(tostring(color), "onedark") and true or false then if substring(tostring(color), "onedark") and true or false then
return { return {

View file

@ -1,5 +1,5 @@
local color = vim.g.pcode_colorscheme or "gruvbox-baby" local color = pcode.colorscheme or "gruvbox-baby"
local transparent_mode = vim.g.pcode_transparent_mode or 0 local transparent_mode = pcode.transparent_mode or 0
if substring(tostring(color), "solarized") and true or false then if substring(tostring(color), "solarized") and true or false then
return { return {

View file

@ -1,5 +1,5 @@
local color = vim.g.pcode_colorscheme or "gruvbox-baby" local color = pcode.colorscheme or "gruvbox-baby"
local transparent_mode = vim.g.pcode_transparent_mode or 0 local transparent_mode = pcode.transparent_mode or 0
if substring(tostring(color), "sonokai") and true or false then if substring(tostring(color), "sonokai") and true or false then
return { return {

View file

@ -1,5 +1,5 @@
local color = vim.g.pcode_colorscheme or "gruvbox-baby" local color = pcode.colorscheme or "gruvbox-baby"
local transparent_mode = vim.g.pcode_transparent_mode or 0 local transparent_mode = pcode.transparent_mode or 0
if substring(tostring(color), "tokyonight") and true or false then if substring(tostring(color), "tokyonight") and true or false then
return { return {
@ -14,7 +14,7 @@ if substring(tostring(color), "tokyonight") and true or false then
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 = vim.g.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"

View file

@ -1,7 +1,7 @@
local transparent = false local transparent = false
local clear_lualine = false local clear_lualine = false
local transparent_mode = vim.g.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
transparent = true transparent = true

View file

@ -1,5 +1,5 @@
local M = {} local M = {}
if vim.g.pcode_columnline then if pcode.columnline then
M = { M = {
{ {
"lukas-reineke/virt-column.nvim", "lukas-reineke/virt-column.nvim",

View file

@ -95,7 +95,7 @@ return {
nowait = true, -- use `nowait` when creating keymaps nowait = true, -- use `nowait` when creating keymaps
} }
local wkey = vim.g.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)

View file

@ -1,4 +1,4 @@
local colorscheme = vim.g.pcode_colorscheme or "gruvbox-baby" local colorscheme = pcode.colorscheme or "gruvbox-baby"
if substring(tostring(colorscheme), "sonokai") then if substring(tostring(colorscheme), "sonokai") then
colorscheme = "sonokai" colorscheme = "sonokai"

View file

@ -1,5 +1,5 @@
local run = 0 local run = 0
local frmt = vim.g.pcode_format_on_save or 0 local frmt = pcode.format_on_save or 0
if frmt == 1 then if frmt == 1 then
run = 1 run = 1
else else
@ -32,7 +32,7 @@ if run == 1 then
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=vim.g.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

View file

@ -8,7 +8,7 @@ local lspconfig = require("lspconfig")
-- local servers = { "jsonls", "sumneko_lua","html","cssls","tsserver"} -- local servers = { "jsonls", "sumneko_lua","html","cssls","tsserver"}
-- local servers = { "jdtls", "yamlls" } -- local servers = { "jdtls", "yamlls" }
local servers = {} local servers = {}
local installer = vim.g.pcode_lsp_installer or {} local installer = pcode.lsp_installer or {}
for _, client in pairs(installer) do for _, client in pairs(installer) do
table.insert(servers, client) table.insert(servers, client)
end end

View file

@ -5,7 +5,7 @@ if not status_cmp_ok then
return return
end end
local lspvitualtext = vim.g.pcode_lsp_virtualtext or false local lspvitualtext = pcode.lsp_virtualtext or false
local icons = vim.g.pcode_icons local icons = vim.g.pcode_icons
M.capabilities = vim.lsp.protocol.make_client_capabilities() M.capabilities = vim.lsp.protocol.make_client_capabilities()

View file

@ -11,12 +11,12 @@ local function idxOf(array, value)
return nil return nil
end end
local mason_install = vim.g.pcode_mason_ensure_installed or {} local mason_install = pcode.mason_ensure_installed or {}
for _, client in pairs(mason_install) do for _, client in pairs(mason_install) do
table.insert(servers, client) table.insert(servers, client)
end end
local unregis_lsp = vim.g.pcode_unregister_lsp or {} local unregis_lsp = pcode.unregister_lsp or {}
local icons = vim.g.pcode_icons.ui local icons = vim.g.pcode_icons.ui
local settings = { local settings = {

View file

@ -21,7 +21,7 @@ if data_ok then
end end
-- load data null-ls -- load data null-ls
local nullls_data = vim.g.pcode_null_ls_ensure_installed or {} local nullls_data = pcode.null_ls_ensure_installed or {}
for _, nullls in pairs(nullls_data) do for _, nullls in pairs(nullls_data) do
table.insert(ensure_installed, nullls) table.insert(ensure_installed, nullls)
end end
@ -34,7 +34,7 @@ if mason_ok then
end end
local run = 0 local run = 0
local frmt = vim.g.pcode_format_on_save or 0 local frmt = pcode.format_on_save or 0
if frmt == 1 then if frmt == 1 then
run = 1 run = 1
end end

View file

@ -1,5 +1,5 @@
local sources = {} local sources = {}
local dap_data = vim.g.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

View file

@ -5,7 +5,7 @@ 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 = vim.g.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"

View file

@ -53,7 +53,7 @@ return {
codeium = { codeium = {
function() function()
if vim.g.pcode_codeium then if pcode.codeium then
local codeium = all_trim(vim.api.nvim_call_function("codeium#GetStatusString", {})) local codeium = all_trim(vim.api.nvim_call_function("codeium#GetStatusString", {}))
if codeium then if codeium then
if codeium == "OFF" then if codeium == "OFF" then
@ -69,7 +69,7 @@ return {
end end
end, end,
color = function() color = function()
if vim.g.pcode_codeium then if pcode.codeium then
local codeium = all_trim(vim.api.nvim_call_function("codeium#GetStatusString", {})) local codeium = all_trim(vim.api.nvim_call_function("codeium#GetStatusString", {}))
return { fg = codeium == "OFF" and "#3E4452" or "#50fa7b" } return { fg = codeium == "OFF" and "#3E4452" or "#50fa7b" }
else else
@ -164,13 +164,13 @@ return {
padding = 1, padding = 1,
separator = { left = "" }, separator = { left = "" },
fmt = function(str) fmt = function(str)
if vim.g.pcode_show_mode == 1 then if pcode.show_mode == 1 then
return icons.ui.Neovim .. " " .. (mode_map[str] or str) return icons.ui.Neovim .. " " .. (mode_map[str] or str)
elseif vim.g.pcode_show_mode == 2 then elseif pcode.show_mode == 2 then
return icons.ui.Neovim return icons.ui.Neovim
elseif vim.g.pcode_show_mode == 3 then elseif pcode.show_mode == 3 then
return (mode_map[str] or str) return (mode_map[str] or str)
elseif vim.g.pcode_show_mode == 4 then elseif pcode.show_mode == 4 then
return nil return nil
else else
return icons.ui.Neovim .. " " .. str return icons.ui.Neovim .. " " .. str
@ -182,13 +182,13 @@ return {
padding = 1, padding = 1,
separator = { left = "", right = "" }, separator = { left = "", right = "" },
fmt = function(str) fmt = function(str)
if vim.g.pcode_show_mode == 1 then if pcode.show_mode == 1 then
return icons.ui.Neovim .. " " .. (mode_map[str] or str) return icons.ui.Neovim .. " " .. (mode_map[str] or str)
elseif vim.g.pcode_show_mode == 2 then elseif pcode.show_mode == 2 then
return icons.ui.Neovim return icons.ui.Neovim
elseif vim.g.pcode_show_mode == 3 then elseif pcode.show_mode == 3 then
return (mode_map[str] or str) return (mode_map[str] or str)
elseif vim.g.pcode_show_mode == 4 then elseif pcode.show_mode == 4 then
return nil return nil
else else
return icons.ui.Neovim .. " " .. str return icons.ui.Neovim .. " " .. str
@ -200,13 +200,13 @@ return {
padding = 1, padding = 1,
separator = { left = " ", right = "" }, separator = { left = " ", right = "" },
fmt = function(str) fmt = function(str)
if vim.g.pcode_show_mode == 1 then if pcode.show_mode == 1 then
return icons.ui.Neovim .. " " .. (mode_map[str] or str) return icons.ui.Neovim .. " " .. (mode_map[str] or str)
elseif vim.g.pcode_show_mode == 2 then elseif pcode.show_mode == 2 then
return icons.ui.Neovim return icons.ui.Neovim
elseif vim.g.pcode_show_mode == 3 then elseif pcode.show_mode == 3 then
return (mode_map[str] or str) return (mode_map[str] or str)
elseif vim.g.pcode_show_mode == 4 then elseif pcode.show_mode == 4 then
return nil return nil
else else
return icons.ui.Neovim .. " " .. str return icons.ui.Neovim .. " " .. str
@ -218,13 +218,13 @@ return {
padding = 1, padding = 1,
separator = { left = "", right = "" }, separator = { left = "", right = "" },
fmt = function(str) fmt = function(str)
if vim.g.pcode_show_mode == 1 then if pcode.show_mode == 1 then
return icons.ui.Neovim .. " " .. (mode_map[str] or str) return icons.ui.Neovim .. " " .. (mode_map[str] or str)
elseif vim.g.pcode_show_mode == 2 then elseif pcode.show_mode == 2 then
return icons.ui.Neovim return icons.ui.Neovim
elseif vim.g.pcode_show_mode == 3 then elseif pcode.show_mode == 3 then
return (mode_map[str] or str) return (mode_map[str] or str)
elseif vim.g.pcode_show_mode == 4 then elseif pcode.show_mode == 4 then
return nil return nil
else else
return icons.ui.Neovim .. " " .. str return icons.ui.Neovim .. " " .. str
@ -237,13 +237,13 @@ return {
padding = 1, padding = 1,
separator = { left = " " }, separator = { left = " " },
fmt = function(str) fmt = function(str)
if vim.g.pcode_show_mode == 1 then if pcode.show_mode == 1 then
return icons.ui.Neovim .. " " .. (mode_map[str] or str) return icons.ui.Neovim .. " " .. (mode_map[str] or str)
elseif vim.g.pcode_show_mode == 2 then elseif pcode.show_mode == 2 then
return icons.ui.Neovim return icons.ui.Neovim
elseif vim.g.pcode_show_mode == 3 then elseif pcode.show_mode == 3 then
return (mode_map[str] or str) return (mode_map[str] or str)
elseif vim.g.pcode_show_mode == 4 then elseif pcode.show_mode == 4 then
return nil return nil
else else
return icons.ui.Neovim .. " " .. str return icons.ui.Neovim .. " " .. str

View file

@ -278,11 +278,11 @@ M.mappings = {
}, },
} }
if vim.g.pcode_codeium then if pcode.codeium then
table.insert(M.mappings, { ["c"] = { ":call codeium#Chat()<cr>", "󰭹 Codeium Chat" } }) table.insert(M.mappings, { ["c"] = { ":call codeium#Chat()<cr>", "󰭹 Codeium Chat" } })
end end
if vim.g.pcode_database then if pcode.database then
table.insert(M.mappings, { table.insert(M.mappings, {
["D"] = { ["D"] = {
name = " 󰆼 DBUI", name = " 󰆼 DBUI",