mirror of
https://github.com/pojokcodeid/nvim-lazy.git
synced 2025-06-21 16:39:04 +02:00
enc: add snippet path config
This commit is contained in:
parent
9aebda6491
commit
5f97594d62
5 changed files with 149 additions and 148 deletions
|
@ -1,52 +1,52 @@
|
|||
_G.idxOf = function(array, value)
|
||||
for i, v in ipairs(array) do
|
||||
if v == value then
|
||||
return i
|
||||
end
|
||||
end
|
||||
return nil
|
||||
for i, v in ipairs(array) do
|
||||
if v == value then
|
||||
return i
|
||||
end
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
_G.LAZYGIT_TOGGLE = function()
|
||||
local ok = pcall(require, "toggleterm")
|
||||
if not ok then
|
||||
require("notify")("toggleterm not found!", "error")
|
||||
return
|
||||
end
|
||||
local Terminal = require("toggleterm.terminal").Terminal
|
||||
local lazygit = Terminal:new({ cmd = "lazygit", hidden = true })
|
||||
lazygit:toggle()
|
||||
local ok = pcall(require, "toggleterm")
|
||||
if not ok then
|
||||
require("notify")("toggleterm not found!", "error")
|
||||
return
|
||||
end
|
||||
local Terminal = require("toggleterm.terminal").Terminal
|
||||
local lazygit = Terminal:new({ cmd = "lazygit", hidden = true })
|
||||
lazygit:toggle()
|
||||
end
|
||||
|
||||
_G.substring = function(text, key)
|
||||
local index, _ = string.find(text, key)
|
||||
if index then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
local index, _ = string.find(text, key)
|
||||
if index then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
_G.all_trim = function(s)
|
||||
return s:match("^%s*(.-)%s*$")
|
||||
return s:match("^%s*(.-)%s*$")
|
||||
end
|
||||
|
||||
_G.current_theme = function()
|
||||
if pcode.themes then
|
||||
local theme = ""
|
||||
for _, value in pairs(pcode.themes or {}) do
|
||||
theme = value
|
||||
end
|
||||
return all_trim(theme)
|
||||
end
|
||||
return ""
|
||||
if pcode.themes then
|
||||
local theme = ""
|
||||
for _, value in pairs(pcode.themes or {}) do
|
||||
theme = value
|
||||
end
|
||||
return all_trim(theme)
|
||||
end
|
||||
return ""
|
||||
end
|
||||
|
||||
local function safeRequire(module)
|
||||
local ok, result = pcall(require, module)
|
||||
if ok then
|
||||
return result
|
||||
end
|
||||
local ok, result = pcall(require, module)
|
||||
if ok then
|
||||
return result
|
||||
end
|
||||
end
|
||||
|
||||
safeRequire("pcode.user.options")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue