This commit is contained in:
Alex Yatskov 2022-10-02 19:29:12 -07:00
parent d0eeef18a5
commit 4285368c21
2 changed files with 23 additions and 12 deletions

View File

@ -100,18 +100,6 @@ lua << EOF
-- Set completeopt to have a better completion experience -- Set completeopt to have a better completion experience
vim.o.completeopt = 'menuone,noselect' vim.o.completeopt = 'menuone,noselect'
-- Helper for dumping Lua tables
function _G.put(...)
local objects = {}
for i = 1, select('#', ...) do
local v = select(i, ...)
table.insert(objects, vim.inspect(v))
end
print(table.concat(objects, '\n'))
return ...
end
EOF EOF
endif endif

View File

@ -25,3 +25,26 @@ function! s:guid()
endfunction endfunction
command! Guid call s:guid() command! Guid call s:guid()
if has('nvim')
lua << EOF
function _G.put(...)
local objects = {}
for i = 1, select('#', ...) do
local v = select(i, ...)
table.insert(objects, vim.inspect(v))
end
print(table.concat(objects, '\n'))
return ...
end
function _G.list_packages()
for key, value in pairs(package.loaded) do
print(key)
end
end
EOF
endif