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,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 cmp_documentation = {
border = icons.Border,
@ -100,7 +100,7 @@ return {
winhighlight = "Normal:bg,FloatBorder:BorderBG,CursorLine:PmenuSel,Search:None",
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 = {
ghost_text = lspghost_text,

View file

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

View file

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

View file

@ -10,7 +10,7 @@ local rfile = {
javascript = 'node "$dir/$fileName"',
}
local runscript = vim.g.pcode_coderunner or {}
local runscript = pcode.coderunner or {}
rfile = vim.tbl_deep_extend("force", runscript, rfile)
return {
"CRAG666/code_runner.nvim",

View file

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

View file

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

View file

@ -1,10 +1,10 @@
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 {
"echasnovski/mini.indentscope",
version = false, -- wait till new 0.7.0 release to put it back on semver
event = "BufReadPre",
enabled = vim.g.pcode_indentscope and true or false,
enabled = pcode.indentscope and true or false,
opts = {
symbol = icons.ui.LineMiddle,
options = { try_as_border = true },

View file

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

View file

@ -9,7 +9,7 @@ return {
-- check config for theme
local set_theme = "auto"
local bubbles_theme
local color = vim.g.pcode_colorscheme
local color = pcode.colorscheme
switch(color, {
["tokyonight"] = function()
set_theme = "auto"
@ -44,7 +44,7 @@ return {
end
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)
if theme_option == "rounded" then
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 {
-- animations
{
"echasnovski/mini.animate",
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()
-- don't use animate when scrolling with the mouse
local mouse_scrolled = false

View file

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

View file

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

View file

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

View file

@ -10,15 +10,15 @@ return {
local live_grep = {
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 = {
theme = vim.g.pcode_telescope_theme_find_file,
theme = pcode.telescope_theme_find_file,
hidden = true,
}
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 = {
theme = vim.g.pcode_telescope_theme_live_grep,
theme = pcode.telescope_theme_live_grep,
only_sort_text = true,
}
end

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,5 +1,5 @@
local color = vim.g.pcode_colorscheme or "gruvbox-baby"
local transparent_mode = vim.g.pcode_transparent_mode or 0
local color = pcode.colorscheme or "gruvbox-baby"
local transparent_mode = pcode.transparent_mode or 0
if substring(tostring(color), "tokyonight") and true or false then
return {
@ -14,7 +14,7 @@ if substring(tostring(color), "tokyonight") and true or false then
local transp = false
local sidebar = "normal" --"dark , transparent, normal"
local hilight = "#292e42"
local tras = vim.g.pcode_transparent_mode or 0
local tras = pcode.transparent_mode or 0
if tras == 1 then
transp = true
sidebar = "transparent"

View file

@ -1,7 +1,7 @@
local transparent = 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 == 1 then
transparent = true

View file

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

View file

@ -95,7 +95,7 @@ return {
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")
which_key.setup(opts)
which_key.register(require("user.utils.whichkey").mappings, opt)