Skip to content

Commit

Permalink
Format obsidian.lua file
Browse files Browse the repository at this point in the history
  • Loading branch information
thestbar committed May 28, 2024
1 parent 8523574 commit cf1348a
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions lua/plugins/obsidian.lua
Original file line number Diff line number Diff line change
@@ -1,61 +1,61 @@
return {
'epwalsh/obsidian.nvim',
"epwalsh/obsidian.nvim",
lazy = false,
cond = function()
local obsidian_path = vim.fn.expand('~/Documents/obsidian_vault')
return vim.loop.fs_stat(obsidian_path) and vim.loop.fs_stat(obsidian_path).type == 'directory'
local obsidian_path = vim.fn.expand("~/Documents/obsidian_vault")
return vim.loop.fs_stat(obsidian_path) and vim.loop.fs_stat(obsidian_path).type == "directory"
end,
version = '*',
version = "*",
event = {
'BufReadPre ~/Documents/obsidian_vault/**.md',
'BufNewFile ~/Documents/obsidian_vault/**.md',
"BufReadPre ~/Documents/obsidian_vault/**.md",
"BufNewFile ~/Documents/obsidian_vault/**.md",
},
dependencies = {
'nvim-lua/plenary.nvim',
"nvim-lua/plenary.nvim",
},
keys = {
{ '<LEADER>ot', '<CMD>ObsidianToday<CR>', mode = 'n' },
{ '<LEADER>oy', '<CMD>ObsidianYesterday<CR>', mode = 'n' },
{ '<LEADER>os', '<CMD>ObsidianSearch<CR>', mode = 'n' },
{ '<LEADER>oq', '<CMD>ObsidianQuickSwitch<CR>', mode = 'n' },
{ '<LEADER>of', '<CMD>ObsidianFollowLink<CR>', mode = 'n' },
{ '<LEADER>ob', '<CMD>ObsidianBacklinks<CR>', mode = 'n' },
{ '<LEADER>od', '<CMD>ObsidianDailies<CR>', mode = 'n' },
{ '<LEADER>on', '<CMD>ObsidianNew<CR>', mode = 'n' },
{ "<LEADER>ot", "<CMD>ObsidianToday<CR>", mode = "n" },
{ "<LEADER>oy", "<CMD>ObsidianYesterday<CR>", mode = "n" },
{ "<LEADER>os", "<CMD>ObsidianSearch<CR>", mode = "n" },
{ "<LEADER>oq", "<CMD>ObsidianQuickSwitch<CR>", mode = "n" },
{ "<LEADER>of", "<CMD>ObsidianFollowLink<CR>", mode = "n" },
{ "<LEADER>ob", "<CMD>ObsidianBacklinks<CR>", mode = "n" },
{ "<LEADER>od", "<CMD>ObsidianDailies<CR>", mode = "n" },
{ "<LEADER>on", "<CMD>ObsidianNew<CR>", mode = "n" },
},
opts = {
workspaces = {
{
name = 'notes',
path = '~/Documents/obsidian_vault',
name = "notes",
path = "~/Documents/obsidian_vault",
},
},
daily_notes = {
folder = 'standups',
date_format = '%d-%m-%Y',
folder = "standups",
date_format = "%d-%m-%Y",
template = nil,
},
templates = {
folder = '~/Documents/obsidian_vault/templates',
date_format = '%d-%m-%Y',
folder = "~/Documents/obsidian_vault/templates",
date_format = "%d-%m-%Y",
},
ui = {
checkboxes = {
[' '] = { char = '󰄰', hl_group = 'ObsidianTodo' },
['x'] = { char = '󰄴', hl_group = 'ObsidianDone' },
[" "] = { char = "󰄰", hl_group = "ObsidianTodo" },
["x"] = { char = "󰄴", hl_group = "ObsidianDone" },
},
},
note_id_func = function(title)
local filename = ''
local filename = ""

if title ~= nil then
filename = title:gsub(' ', '-'):gsub('[^A-Za-z0-9-]', ''):lower()
filename = title:gsub(" ", "-"):gsub("[^A-Za-z0-9-]", ""):lower()
else
for _ = 1, 4 do
filename = filename .. string.char(math.random(65, 90))
end

filename = tostring(os.time()) .. '-' .. filename
filename = tostring(os.time()) .. "-" .. filename
end

return filename
Expand Down

0 comments on commit cf1348a

Please sign in to comment.