You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Since you are using LazyVim, I believe you have a keymaps.lua file right ? Is the code you mentioned in that file ?
I have a plugins folder, where all my plugins retain including obsidian.nvim. I have defined keymaps there itself. However, the keymaps can be defined in the keymaps file as well.
This is how I do it in keymaps.lua. I have a keymaps function at the top. You don't have to define a function everytime in every keymap call. Hope this helps.
localkmap_normal=function(key, cmd, desc)
vim.api.nvim_set_keymap("n", key, cmd, { noremap=true, desc=desc })
endlocalkmap_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")
....
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: