option to skip creation of user commands

pull/8/head
Karim Abou Zeid 2 years ago
parent 89179f1949
commit cd66837e8c

@ -34,6 +34,9 @@ require("telescope").load_extension("zk")
#### Default configuration
```lua
require("zk").setup({
-- create user commands such as :ZkNew
create_user_commands = true,
lsp = {
-- automatically attach buffers in a zk notebook that match the given filetypes
auto_attach = {

@ -9,9 +9,15 @@ M.lsp = require("zk.lsp")
function M.setup(options)
config.options = vim.tbl_deep_extend("force", config.defaults, options or {})
if config.options.lsp.auto_attach.enabled then
util.setup_lsp_auto_attach()
end
if config.options.create_user_commands then
vim.cmd("command! ZkIndex lua require('zk').index()")
vim.cmd("command! -nargs=? ZkNew lua require('zk').new(nil, { dir = [=[<args>]=]})")
end
end
-- Commands
@ -28,7 +34,4 @@ function M.new(path, args)
end)
end
vim.cmd("command! ZkIndex lua require('zk').index()")
vim.cmd("command! -nargs=? ZkNew lua require('zk').new(nil, { dir = [=[<args>]=]})")
return M

@ -1,6 +1,7 @@
local M = {}
M.defaults = {
create_user_commands = true,
lsp = {
auto_attach = {
enabled = true,

Loading…
Cancel
Save