refactor: encapsulate setup logic into a dedicated function
This commit is contained in:
+27
-21
@@ -1,31 +1,37 @@
|
|||||||
-- ━━━━━━━━━━━━━━━━━━━━━━━━ Post-Config Functions ━━━━━━━━━━━━━━━━━━━━━━━━
|
-- ━━━━━━━━━━━━━━━━━━━━━━━━ Post-Config Functions ━━━━━━━━━━━━━━━━━━━━━━━━
|
||||||
|
|
||||||
-- Setup blinky cursor
|
--- Function to setup post-opts
|
||||||
require('utils.blinky').setup(vim.g.blinky)
|
local function setup()
|
||||||
|
-- Setup blinky cursor
|
||||||
|
require('utils.blinky').setup(vim.g.blinky)
|
||||||
|
|
||||||
-- Setup nvim-remote
|
-- Setup nvim-remote
|
||||||
if vim.fn.executable('nvr') == 1 then
|
if vim.fn.executable('nvr') == 1 then
|
||||||
vim.env.GIT_EDITOR = "nvr -cc split --remote-wait +'set bufhidden=wipe'"
|
vim.env.GIT_EDITOR = "nvr -cc split --remote-wait +'set bufhidden=wipe'"
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Check for termux
|
-- Check for termux
|
||||||
local prefix = vim.env.PREFIX
|
local prefix = vim.env.PREFIX
|
||||||
|
|
||||||
-- Check if prefix contains "com.termux"
|
-- Check if prefix contains "com.termux"
|
||||||
if prefix ~= nil then
|
if prefix ~= nil then
|
||||||
if prefix:match('com.termux') then
|
if prefix:match('com.termux') then
|
||||||
|
vim.g.useimage = false
|
||||||
|
vim.g.is_termux = true
|
||||||
|
vim.g.useavante = false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Define intel_arch
|
||||||
|
local intel_arch = { x64 = true, x86 = true }
|
||||||
|
local cur_arch = require('data.func').get_system_arch()
|
||||||
|
|
||||||
|
-- Check the platform and disable incompatible plugins
|
||||||
|
if not intel_arch[cur_arch] then
|
||||||
vim.g.useimage = false
|
vim.g.useimage = false
|
||||||
vim.g.is_termux = true
|
|
||||||
vim.g.useavante = false
|
vim.g.useavante = false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Define intel_arch
|
-- Run Setup function
|
||||||
local intel_arch = { x64 = true, x86 = true }
|
setup()
|
||||||
local cur_arch = require('data.func').get_system_arch()
|
|
||||||
|
|
||||||
-- Check the platform and disable incompatible plugins
|
|
||||||
if not intel_arch[cur_arch] then
|
|
||||||
vim.g.useimage = false
|
|
||||||
vim.g.useavante = false
|
|
||||||
end
|
|
||||||
|
|||||||
Reference in New Issue
Block a user