From ffd076d2c434d6c850dd1a05a19ff477c2a29023 Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Sun, 19 May 2024 23:27:57 +0800 Subject: Update --- alias | 3 +-- vim/kickstarter.lua | 26 +++++++++++++++++++++++--- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/alias b/alias index 71f54f2..359737c 100644 --- a/alias +++ b/alias @@ -54,13 +54,12 @@ vll() { nvim -c 'Telescope oldfiles' } # Apply defaut session -alias vv="vim -S ~/.vim.session" +alias vS="vim -S /tmp/vim.session" #alias vl="vim $(sed -n '/^[^#]/{p;q}' ~/.vim_mru_files)" alias ve="vim ~/.config/nvim/nvim.lua" alias vq='vim ~/buffer' alias cdv='cd ~/.vim/vim-init' vs() { which $1 && vim $(which $1); } -alias vS='vim -S ~/.vim.session' [ "$shell" = zsh ] && compdef vs=which alias vim.dos2unix="vim '+set ff=unix' '+x'" diff --git a/vim/kickstarter.lua b/vim/kickstarter.lua index e4b6238..1805fa2 100644 --- a/vim/kickstarter.lua +++ b/vim/kickstarter.lua @@ -193,9 +193,27 @@ require('lazy').setup({ end, opts = { buffer = true, expr = true }, } - } - + }, -- see below for full list of options 👇 + note_id_func = function(title) + return title + -- Create note IDs in a Zettelkasten format with a timestamp and a suffix. + -- In this case a note with the title 'My new note' will be given an ID that looks + -- like '1657296016-my-new-note', and therefore the file name '1657296016-my-new-note.md' + -- local suffix = "" + -- title = title:gsub(" ", "-"):gsub("[^A-Za-z0-9-]", ""):lower() + -- if title ~= nil and title ~= "" then + -- -- If title is given, transform it into valid file name. + -- suffix = "-" .. title + -- else + -- -- If title is nil, just add 4 random uppercase letters to the suffix. + -- for _ = 1, 4 do + -- suffix = suffix .. string.char(math.random(65, 90)) + -- end + -- suffix = "-" .. title + -- end + -- return tostring(os.time()) .. suffix + end, }, }, @@ -470,6 +488,8 @@ vim.cmd('nmap V') vim.keymap.set('n', "oo", ':Obsidian') vim.keymap.set('n', "ot", ':ObsidianTags') vim.keymap.set('n', "os", ':ObsidianSearch') +vim.keymap.set('n', "oq", ':ObsidianQuickSwitch') +vim.keymap.set('v', "on", ':ObsidianLinkNew') -- [[ Configure Telescope ]] -- See `:help telescope` and `:help telescope.setup()` @@ -509,7 +529,7 @@ require('telescope').setup { -- Display symbols as .. show_nesting = { ["_"] = false, -- This key will be the default - json = true, -- You can set the option for specific filetypes + json = true, -- You can set the option for specific filetypes yaml = true, }, }, -- cgit v1.2.3-70-g09d2