mirror of
https://github.com/pojokcodeid/nvim-lazy.git
synced 2025-07-24 12:34:35 +02:00
enc: global variable pcode
This commit is contained in:
parent
ecc54b9f87
commit
65857a4226
45 changed files with 132 additions and 131 deletions
|
@ -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
|
||||
colorscheme = "sonokai"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
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
|
||||
run = 1
|
||||
else
|
||||
|
@ -32,7 +32,7 @@ if run == 1 then
|
|||
augroup _lsp
|
||||
autocmd!
|
||||
" autocmd BufWritePre * lua vim.lsp.buf.format{timeout_ms =200, filter=format_filter}
|
||||
autocmd BufWritePre * lua vim.lsp.buf.format{timeout_ms=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
|
||||
]]
|
||||
end
|
||||
|
|
|
@ -8,7 +8,7 @@ local lspconfig = require("lspconfig")
|
|||
-- local servers = { "jsonls", "sumneko_lua","html","cssls","tsserver"}
|
||||
-- local servers = { "jdtls", "yamlls" }
|
||||
local servers = {}
|
||||
local installer = vim.g.pcode_lsp_installer or {}
|
||||
local installer = pcode.lsp_installer or {}
|
||||
for _, client in pairs(installer) do
|
||||
table.insert(servers, client)
|
||||
end
|
||||
|
|
|
@ -5,7 +5,7 @@ if not status_cmp_ok then
|
|||
return
|
||||
end
|
||||
|
||||
local lspvitualtext = vim.g.pcode_lsp_virtualtext or false
|
||||
local lspvitualtext = pcode.lsp_virtualtext or false
|
||||
local icons = vim.g.pcode_icons
|
||||
|
||||
M.capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
|
|
|
@ -11,12 +11,12 @@ local function idxOf(array, value)
|
|||
return nil
|
||||
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
|
||||
table.insert(servers, client)
|
||||
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 settings = {
|
||||
|
|
|
@ -21,7 +21,7 @@ if data_ok then
|
|||
end
|
||||
|
||||
-- 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
|
||||
table.insert(ensure_installed, nullls)
|
||||
end
|
||||
|
@ -34,7 +34,7 @@ if mason_ok then
|
|||
end
|
||||
|
||||
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
|
||||
run = 1
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
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
|
||||
table.insert(sources, nullls)
|
||||
end
|
||||
|
|
|
@ -5,7 +5,7 @@ end
|
|||
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"
|
||||
|
|
|
@ -53,7 +53,7 @@ return {
|
|||
|
||||
codeium = {
|
||||
function()
|
||||
if vim.g.pcode_codeium then
|
||||
if pcode.codeium then
|
||||
local codeium = all_trim(vim.api.nvim_call_function("codeium#GetStatusString", {}))
|
||||
if codeium then
|
||||
if codeium == "OFF" then
|
||||
|
@ -69,7 +69,7 @@ return {
|
|||
end
|
||||
end,
|
||||
color = function()
|
||||
if vim.g.pcode_codeium then
|
||||
if pcode.codeium then
|
||||
local codeium = all_trim(vim.api.nvim_call_function("codeium#GetStatusString", {}))
|
||||
return { fg = codeium == "OFF" and "#3E4452" or "#50fa7b" }
|
||||
else
|
||||
|
@ -164,13 +164,13 @@ return {
|
|||
padding = 1,
|
||||
separator = { left = " " },
|
||||
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)
|
||||
elseif vim.g.pcode_show_mode == 2 then
|
||||
elseif pcode.show_mode == 2 then
|
||||
return icons.ui.Neovim
|
||||
elseif vim.g.pcode_show_mode == 3 then
|
||||
elseif pcode.show_mode == 3 then
|
||||
return (mode_map[str] or str)
|
||||
elseif vim.g.pcode_show_mode == 4 then
|
||||
elseif pcode.show_mode == 4 then
|
||||
return nil
|
||||
else
|
||||
return icons.ui.Neovim .. " " .. str
|
||||
|
@ -182,13 +182,13 @@ return {
|
|||
padding = 1,
|
||||
separator = { left = " ", right = "" },
|
||||
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)
|
||||
elseif vim.g.pcode_show_mode == 2 then
|
||||
elseif pcode.show_mode == 2 then
|
||||
return icons.ui.Neovim
|
||||
elseif vim.g.pcode_show_mode == 3 then
|
||||
elseif pcode.show_mode == 3 then
|
||||
return (mode_map[str] or str)
|
||||
elseif vim.g.pcode_show_mode == 4 then
|
||||
elseif pcode.show_mode == 4 then
|
||||
return nil
|
||||
else
|
||||
return icons.ui.Neovim .. " " .. str
|
||||
|
@ -200,13 +200,13 @@ return {
|
|||
padding = 1,
|
||||
separator = { left = " ", right = "" },
|
||||
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)
|
||||
elseif vim.g.pcode_show_mode == 2 then
|
||||
elseif pcode.show_mode == 2 then
|
||||
return icons.ui.Neovim
|
||||
elseif vim.g.pcode_show_mode == 3 then
|
||||
elseif pcode.show_mode == 3 then
|
||||
return (mode_map[str] or str)
|
||||
elseif vim.g.pcode_show_mode == 4 then
|
||||
elseif pcode.show_mode == 4 then
|
||||
return nil
|
||||
else
|
||||
return icons.ui.Neovim .. " " .. str
|
||||
|
@ -218,13 +218,13 @@ return {
|
|||
padding = 1,
|
||||
separator = { left = " ", right = "" },
|
||||
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)
|
||||
elseif vim.g.pcode_show_mode == 2 then
|
||||
elseif pcode.show_mode == 2 then
|
||||
return icons.ui.Neovim
|
||||
elseif vim.g.pcode_show_mode == 3 then
|
||||
elseif pcode.show_mode == 3 then
|
||||
return (mode_map[str] or str)
|
||||
elseif vim.g.pcode_show_mode == 4 then
|
||||
elseif pcode.show_mode == 4 then
|
||||
return nil
|
||||
else
|
||||
return icons.ui.Neovim .. " " .. str
|
||||
|
@ -237,13 +237,13 @@ return {
|
|||
padding = 1,
|
||||
separator = { left = " " },
|
||||
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)
|
||||
elseif vim.g.pcode_show_mode == 2 then
|
||||
elseif pcode.show_mode == 2 then
|
||||
return icons.ui.Neovim
|
||||
elseif vim.g.pcode_show_mode == 3 then
|
||||
elseif pcode.show_mode == 3 then
|
||||
return (mode_map[str] or str)
|
||||
elseif vim.g.pcode_show_mode == 4 then
|
||||
elseif pcode.show_mode == 4 then
|
||||
return nil
|
||||
else
|
||||
return icons.ui.Neovim .. " " .. str
|
||||
|
|
|
@ -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" } })
|
||||
end
|
||||
|
||||
if vim.g.pcode_database then
|
||||
if pcode.database then
|
||||
table.insert(M.mappings, {
|
||||
["D"] = {
|
||||
name = " DBUI",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue