mirror of
https://github.com/jdhao/nvim-config.git
synced 2025-06-08 14:14:33 +02:00
global.vim --> global.lua
fix 2 fix 3
This commit is contained in:
@@ -1,10 +1,5 @@
|
||||
local fn = vim.fn
|
||||
|
||||
-- inspect something
|
||||
function _G.inspect(item)
|
||||
vim.pretty_print(item)
|
||||
end
|
||||
|
||||
local M = {}
|
||||
|
||||
function M.executable(name)
|
||||
@@ -15,6 +10,18 @@ function M.executable(name)
|
||||
return false
|
||||
end
|
||||
|
||||
--- check whether a feature exists in Nvim
|
||||
--- @feat: string
|
||||
--- the feature name, like `nvim-0.7` or `unix`.
|
||||
--- return: bool
|
||||
M.has = function(feat)
|
||||
if fn.has(feat) == 1 then
|
||||
return true
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
--- Create a dir if it does not exist
|
||||
function M.may_create_dir(dir)
|
||||
local res = fn.isdirectory(dir)
|
||||
|
||||
Reference in New Issue
Block a user