diff options
| author | Robert Günzler <r@gnzler.io> | 2021-11-02 19:11:49 +0100 |
|---|---|---|
| committer | Robert Günzler <r@gnzler.io> | 2021-11-02 19:11:49 +0100 |
| commit | 4208ff58c13d9e02ea4ba737cabfdb952dd6eabb (patch) | |
| tree | 11117cd0c893bc3ffd123199268b40b8783bd810 | |
| parent | 44641c5e6a1a7aab269b32589effc2d91cb81a16 (diff) | |
vim: set a default title_dir for zk integration
| -rw-r--r-- | .vim/lua/zk.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/.vim/lua/zk.lua b/.vim/lua/zk.lua index 4cd8389..bb7fe35 100644 --- a/.vim/lua/zk.lua +++ b/.vim/lua/zk.lua @@ -4,6 +4,8 @@ local function zk_new(path, title_dir) if not (path and #path > 0) then return end title_dir = title_dir or vim.fn.input('New Zettel: ') + if not title_dir or (title_dir == "") then return end + local o = {} local parts = vim.split(title_dir, '/') if not parts[2] then @@ -24,7 +26,7 @@ local function zk_new(path, title_dir) range = {start={line=2, character=0}}, } vim.cmd('startinsert') - end, + end ) end |