mirror of
https://github.com/pojokcodeid/nvim-lazy.git
synced 2025-06-22 08:53:31 +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,11 +1,12 @@
|
|||
require "custom.default"
|
||||
require "custom.dashboard"
|
||||
require "config.lazy_lib"
|
||||
require "user.colorscheme"
|
||||
require "user.keymaps"
|
||||
require "core.neovide"
|
||||
require "custom.autocmd"
|
||||
require "custom.keymaps"
|
||||
_G.pcode = _G.pcode or {}
|
||||
require("custom.default")
|
||||
require("custom.dashboard")
|
||||
require("config.lazy_lib")
|
||||
require("user.colorscheme")
|
||||
require("user.keymaps")
|
||||
require("core.neovide")
|
||||
require("custom.autocmd")
|
||||
require("custom.keymaps")
|
||||
-- require("user.snip")
|
||||
-- require("user.nvim-tree")
|
||||
-- require("user.options")
|
||||
|
|
|
@ -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 == 1 then
|
||||
vim.cmd "TransparentDisable"
|
||||
|
|
|
@ -14,10 +14,10 @@
|
|||
-- solarized-osaka
|
||||
-- darcula-dark
|
||||
-- juliana
|
||||
vim.g.pcode_colorscheme = "darcula-dark"
|
||||
pcode.colorscheme = "darcula-dark"
|
||||
|
||||
-- 0 =off 1= on
|
||||
vim.g.pcode_transparent_mode = 0
|
||||
pcode.transparent_mode = 0
|
||||
-- rounded
|
||||
-- roundedall
|
||||
-- square
|
||||
|
@ -25,40 +25,40 @@ vim.g.pcode_transparent_mode = 0
|
|||
-- parallelogram
|
||||
-- transparent
|
||||
-- default
|
||||
vim.g.pcode_lualinetheme = "roundedall"
|
||||
pcode.lualinetheme = "roundedall"
|
||||
-- 0 disable progress
|
||||
-- 1 lualine lsp progress
|
||||
-- 2 fidget progress
|
||||
vim.g.pcode_progress = 1
|
||||
pcode.progress = 1
|
||||
|
||||
-- 0 = on full text mode info,
|
||||
-- 1 = on initial mode + logo
|
||||
-- 2 = logo only
|
||||
-- 3 = initial only
|
||||
-- 4 = off
|
||||
vim.g.pcode_show_mode = 3
|
||||
pcode.show_mode = 3
|
||||
|
||||
-- 1 ( format jalan) 0 (fromat off)
|
||||
vim.g.pcode_format_on_save = 1
|
||||
vim.g.pcode_format_timeout_ms = 5000
|
||||
pcode.format_on_save = 1
|
||||
pcode.format_timeout_ms = 5000
|
||||
|
||||
-- ini hanya untuk lsp yg tidak support masson
|
||||
-- untuk referesi support language kunjungi link dibawah
|
||||
-- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
|
||||
vim.g.pcode_lsp_installer = {
|
||||
pcode.lsp_installer = {
|
||||
-- "yamlls",
|
||||
-- tambahkan di bawah sini setelah melakukan :masoninstall
|
||||
}
|
||||
|
||||
-- use for lsp diagnostics virtual text
|
||||
vim.g.pcode_lsp_virtualtext = true
|
||||
pcode.lsp_virtualtext = true
|
||||
|
||||
-- use for lsp ghost text config
|
||||
vim.g.pcode_lspghost_text = false
|
||||
pcode.lspghost_text = false
|
||||
|
||||
-- untuk referesi support language kunjungi link dibawah
|
||||
-- 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",
|
||||
-- "intelephense",
|
||||
-- "marksman",
|
||||
|
@ -68,24 +68,24 @@ vim.g.pcode_mason_ensure_installed = { -- sebelumnya register_lsp
|
|||
-- "kotlin_language_server",
|
||||
-- tambahkan di bawah sini setelah melakukan :masoninstall
|
||||
}
|
||||
vim.g.pcode_unregister_lsp = {
|
||||
pcode.unregister_lsp = {
|
||||
"jdtls", -- tambahkan di bawah ini
|
||||
}
|
||||
|
||||
-- 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",
|
||||
}
|
||||
|
||||
-- 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
|
||||
-- atau gunakan :MasonInstall
|
||||
vim.g.pcode_dap_ensure_installed = {
|
||||
pcode.dap_ensure_installed = {
|
||||
-- "python",
|
||||
}
|
||||
|
||||
-- https://github.com/folke/which-key.nvim
|
||||
vim.g.pcode_whichkey = {
|
||||
pcode.whichkey = {
|
||||
-- contoh penambahan
|
||||
["k"] = {
|
||||
name = "Example",
|
||||
|
@ -99,44 +99,44 @@ vim.g.pcode_whichkey = {
|
|||
|
||||
-- https://github.com/CRAG666/code_runner.nvim
|
||||
-- ready default java, python, typescript, javascript, rust, cpp, scss
|
||||
vim.g.pcode_coderunner = {
|
||||
pcode.coderunner = {
|
||||
go = "go run $fileName",
|
||||
html = "live-server $dir/$fileName",
|
||||
}
|
||||
|
||||
-- 0 = normal
|
||||
-- 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
|
||||
vim.g.pcode_codeium = false
|
||||
pcode.codeium = false
|
||||
-- https://github.com/Exafunction/codeium.nvim
|
||||
vim.g.pcode_codeium_nvim = true
|
||||
pcode.codeium_nvim = true
|
||||
-- https://github.com/kevinhwang91/nvim-ufo
|
||||
vim.g.pcode_nvimufo = false
|
||||
pcode.nvimufo = false
|
||||
-- https://github.com/echasnovski/mini.indentscope
|
||||
vim.g.pcode_indentscope = true
|
||||
pcode.indentscope = true
|
||||
-- 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
|
||||
vim.g.pcode_adaptive_color_icon = true
|
||||
pcode.adaptive_color_icon = true
|
||||
-- https://github.com/lukas-reineke/virt-column.nvim
|
||||
vim.g.pcode_columnline = true
|
||||
pcode.columnline = true
|
||||
|
||||
---@alias telescope_themes
|
||||
---| "cursor" # see `telescope.themes.get_cursor()`
|
||||
---| "dropdown" # see `telescope.themes.get_dropdown()`
|
||||
---| "ivy" # see `telescope.themes.get_ivy()`
|
||||
---| "center" # retain the default telescope theme
|
||||
vim.g.pcode_telescope_theme_find_file = "center"
|
||||
vim.g.pcode_telescope_theme_live_grep = "dropdown"
|
||||
pcode.telescope_theme_find_file = "center"
|
||||
pcode.telescope_theme_live_grep = "dropdown"
|
||||
-- https://github.com/kristijanhusak/vim-dadbod-ui
|
||||
vim.g.pcode_database = false
|
||||
pcode.database = false
|
||||
|
||||
-- https://github.com/nvim-neotest/neotest-jest
|
||||
vim.g.pcode_jest = true
|
||||
vim.g.pcode_jest_command = "npm test -- "
|
||||
vim.g.pcode_jest_config = "jest.config.mjs"
|
||||
pcode.jest = true
|
||||
pcode.jest_command = "npm test -- "
|
||||
pcode.jest_config = "jest.config.mjs"
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
local M = {}
|
||||
if vim.g.pcode_codeium then
|
||||
if pcode.codeium then
|
||||
M.codeium = {
|
||||
"Exafunction/codeium.vim",
|
||||
enabled = true,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
if vim.g.pcode_codeium_nvim then
|
||||
if pcode.codeium_nvim then
|
||||
return {
|
||||
-- codeium cmp source
|
||||
{
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
local M = {}
|
||||
if vim.g.pcode_database then
|
||||
if pcode.database then
|
||||
return {
|
||||
"kristijanhusak/vim-dadbod-ui",
|
||||
dependencies = {
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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 },
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 = {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
local M = {}
|
||||
if vim.g.pcode_tailwindcolorizer then
|
||||
if pcode.tailwindcolorizer then
|
||||
M.tailwind = {
|
||||
{
|
||||
"NvChad/nvim-colorizer.lua",
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 {}
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
local M = {}
|
||||
if vim.g.pcode_columnline then
|
||||
if pcode.columnline then
|
||||
M = {
|
||||
{
|
||||
"lukas-reineke/virt-column.nvim",
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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