-
Notifications
You must be signed in to change notification settings - Fork 224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Help request] Key Maps #786
Comments
Since you are using LazyVim, I believe you have a I have a plugins folder, where all my plugins retain including local kmap_normal = function(key, cmd, desc)
vim.api.nvim_set_keymap("n", key, cmd, { noremap = true, desc = desc })
end
local kmap_insert = function(key, cmd, desc)
vim.api.nvim_set_keymap("i", key, cmd, { noremap = true, desc = desc })
end
-- And use it for all keymap configs below. So for your case I would do something like:
kmap_normal("<leader>od", "<cmd>ObsidianDailies<cr>", "Show dailies")
kmap_normal("<leader>of", "<cmd>ObsidianQuickSwitch<cr>", "Find notes")
.... |
It works for me. -- I have to do this for visual mode
vim.keymap.set("x", "<leader>e", ":ObsidianExtractNote<cr>", { desc = "Obsidian extract" })
return {
{
"epwalsh/obsidian.nvim",
-- snip...
opts = {
-- snip...
mappings = {
-- obsidian.nvim register mappings for normal mode only, like this:
-- vim.keymap.set("n", mapping_keys, action, opts)
["<leader>o"] = {
action = "",
opts = { desc = "Obsidian" },
},
["<leader>ot"] = {
action = function()
vim.cmd("ObsidianToday")
end,
opts = { desc = "Today" },
},
},
},
},
} What do you think about this? Let me know your opinions. |
I was able to use to this as a guide and it worked! thank you so much! |
I'm a novice in dealing with my neovim configuration and creating my own settings, and am having trouble setting some keymaps I want for obsidian functions. I was hoping someone could just help me get the settings right, I just can't seem to get there on my own.
the main thing im struggling with is implementing a global key map for opening the quick switch and search function. I'm using lazy vim, and am doing this outside of the obsidian configuration. Im pasting all of the different methods ive tried to implement it as comments, but none of them have worked yet with various different errors of not finding the command and not referencing a nil data table.
as a secondary "problem", I have this code that does work for another keymap, but I just struggle to believe its the right way to do it.
essentially, just doing
obsidian:today()
would create the file, but not actually open it. So i did the open_note wrapper to fix that.Thanks so much to anyone that can help, and I completely understand if this gets closed as irrelevant
The text was updated successfully, but these errors were encountered: