-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathobs-nvim.lua
78 lines (76 loc) · 2.7 KB
/
obs-nvim.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
return {
{
"IlyasYOY/obs.nvim",
dependencies = {
"hrsh7th/nvim-cmp",
"nvim-lua/plenary.nvim",
"nvim-telescope/telescope.nvim",
},
lazy = true,
dev = true,
cmd = {
"ObsNvimFollowLink",
"ObsNvimRandomNote",
"ObsNvimNewNote",
"ObsNvimCopyObsidianLinkToNote",
"ObsNvimOpenInObsidian",
"ObsNvimDailyNote",
"ObsNvimWeeklyNote",
"ObsNvimRename",
"ObsNvimTemplate",
"ObsNvimMove",
"ObsNvimBacklinks",
"ObsNvimFindInJournal",
"ObsNvimFindNote",
"ObsNvimFindInNotes",
},
keys = {
"<leader>nn",
"<leader>nr",
"<leader>nN",
"<leader>ny",
"<leader>no",
"<leader>nd",
"<leader>nw",
"<leader>nrn",
"<leader>nT",
"<leader>nM",
"<leader>nb",
"<leader>nfj",
"<leader>nff",
"<leader>nfg",
},
config = function()
local obs = require "obs"
obs.setup {
vault_home = "~/vimwiki",
vault_name = "vimwiki",
journal = {
daily_template_name = "daily",
weekly_template_name = "weekly",
},
}
vim.keymap.set("n", "<leader>nn", "<cmd>ObsNvimFollowLink<cr>")
vim.keymap.set("n", "<leader>nr", "<cmd>ObsNvimRandomNote<cr>")
vim.keymap.set("n", "<leader>nN", "<cmd>ObsNvimNewNote<cr>")
vim.keymap.set(
"n",
"<leader>ny",
"<cmd>ObsNvimCopyObsidianLinkToNote<cr>"
)
vim.keymap.set("n", "<leader>no", "<cmd>ObsNvimOpenInObsidian<cr>")
vim.keymap.set("n", "<leader>nd", "<cmd>ObsNvimDailyNote<cr>")
vim.keymap.set("n", "<leader>nw", "<cmd>ObsNvimWeeklyNote<cr>")
vim.keymap.set("n", "<leader>nrn", "<cmd>ObsNvimRename<cr>")
vim.keymap.set("n", "<leader>nT", "<cmd>ObsNvimTemplate<cr>")
vim.keymap.set("n", "<leader>nM", "<cmd>ObsNvimMove<cr>")
vim.keymap.set("n", "<leader>nb", "<cmd>ObsNvimBacklinks<cr>")
vim.keymap.set("n", "<leader>nfj", "<cmd>ObsNvimFindInJournal<cr>")
vim.keymap.set("n", "<leader>nff", "<cmd>ObsNvimFindNote<cr>")
vim.keymap.set("n", "<leader>nfg", "<cmd>ObsNvimFindInNotes<cr>")
local cmp = require "cmp"
local cmp_source = require "obs.cmp-source"
cmp.register_source("obs", cmp_source.new())
end,
},
}