Skip to content

Commit

Permalink
Revert format changes
Browse files Browse the repository at this point in the history
  • Loading branch information
xulongwu4 committed Oct 17, 2024
1 parent 4413127 commit fcbf8b7
Showing 1 changed file with 44 additions and 44 deletions.
88 changes: 44 additions & 44 deletions doc/obsidian.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ COMMANDS *obsidian-commands*
buffer.
- `:ObsidianTags [TAG ...]` for getting a picker list of all occurrences of the
given tags.
- `:ObsidianAliases` for getting a picker list of aliases of all notes in the
- `:ObsidianAliases` for getting a picker list of aliases of all notes in the
vault.
- `:ObsidianToday [OFFSET]` to open/create a new daily note. This command also
takes an optional offset in days, e.g. use `:ObsidianToday -1` to go to
Expand Down Expand Up @@ -186,7 +186,7 @@ USING LAZY.NVIM ~
dependencies = {
-- Required.
"nvim-lua/plenary.nvim",

-- see below for full list of optional dependencies 👇
},
opts = {
Expand All @@ -200,7 +200,7 @@ USING LAZY.NVIM ~
path = "~/vaults/work",
},
},

-- see below for full list of options 👇
},
}
Expand All @@ -216,7 +216,7 @@ USING PACKER.NVIM ~
requires = {
-- Required.
"nvim-lua/plenary.nvim",

-- see below for full list of optional dependencies 👇
},
config = function()
Expand All @@ -231,7 +231,7 @@ USING PACKER.NVIM ~
path = "~/vaults/work",
},
},

-- see below for full list of options 👇
})
end,
Expand Down Expand Up @@ -297,18 +297,18 @@ carefully and customize it to your needs:
},
},
},

-- Alternatively - and for backwards compatibility - you can set 'dir' to a single path instead of
-- 'workspaces'. For example:
-- dir = "~/vaults/work",

-- Optional, if you keep notes in a specific subdirectory of your vault.
notes_subdir = "notes",

-- Optional, set the log level for obsidian.nvim. This is an integer corresponding to one of the log
-- levels defined by "vim.log.levels.*".
log_level = vim.log.levels.INFO,

daily_notes = {
-- Optional, if you keep daily notes in a separate directory.
folder = "notes/dailies",
Expand All @@ -321,15 +321,15 @@ carefully and customize it to your needs:
-- Optional, if you want to automatically insert a template from your template directory like 'daily.md'
template = nil
},

-- Optional, completion of wiki links, local markdown links, and tags using nvim-cmp.
completion = {
-- Set to false to disable completion.
nvim_cmp = true,
-- Trigger completion at 2 chars.
min_chars = 2,
},

-- Optional, configure key mappings. These are the defaults. If you don't want to set any keymappings this
-- way then set 'mappings = {}'.
mappings = {
Expand All @@ -355,12 +355,12 @@ carefully and customize it to your needs:
opts = { buffer = true, expr = true },
}
},

-- Where to put new notes. Valid options are
-- * "current_dir" - put new notes in same directory as the current buffer.
-- * "notes_subdir" - put new notes in the default notes subdirectory.
new_notes_location = "notes_subdir",

-- Optional, customize how note IDs are generated given an optional title.
---@param title string|?
---@return string
Expand All @@ -380,7 +380,7 @@ carefully and customize it to your needs:
end
return tostring(os.time()) .. "-" .. suffix
end,

-- Optional, customize how note file names are generated given the ID, target directory, and title.
---@param spec { id: string, dir: obsidian.Path, title: string|? }
---@return string|obsidian.Path The full path to the new note.
Expand All @@ -389,7 +389,7 @@ carefully and customize it to your needs:
local path = spec.dir / tostring(spec.id)
return path:with_suffix(".md")
end,

-- Optional, customize how wiki links are formatted. You can set this to one of:
-- * "use_alias_only", e.g. '[[Foo Bar]]'
-- * "prepend_note_id", e.g. '[[foo-bar|Foo Bar]]'
Expand All @@ -399,40 +399,40 @@ carefully and customize it to your needs:
wiki_link_func = function(opts)
return require("obsidian.util").wiki_link_id_prefix(opts)
end,

-- Optional, customize how markdown links are formatted.
markdown_link_func = function(opts)
return require("obsidian.util").markdown_link(opts)
end,

-- Either 'wiki' or 'markdown'.
preferred_link_style = "wiki",

-- Optional, boolean or a function that takes a filename and returns a boolean.
-- `true` indicates that you don't want obsidian.nvim to manage frontmatter.
disable_frontmatter = false,

-- Optional, alternatively you can customize the frontmatter data.
---@return table
note_frontmatter_func = function(note)
-- Add the title of the note as an alias.
if note.title then
note:add_alias(note.title)
end

local out = { id = note.id, aliases = note.aliases, tags = note.tags }

-- `note.metadata` contains any manually added fields in the frontmatter.
-- So here we just make sure those fields are kept in the frontmatter.
if note.metadata ~= nil and not vim.tbl_isempty(note.metadata) then
for k, v in pairs(note.metadata) do
out[k] = v
end
end

return out
end,

-- Optional, for templates (see below).
templates = {
folder = "templates",
Expand All @@ -441,7 +441,7 @@ carefully and customize it to your needs:
-- A map for custom variables, the key should be the variable and the value a function
substitutions = {},
},

-- Optional, by default when you use `:ObsidianFollowLink` on a link to an external
-- URL it will be ignored but you can customize this behavior here.
---@param url string
Expand All @@ -452,7 +452,7 @@ carefully and customize it to your needs:
-- vim.cmd(':silent exec "!start ' .. url .. '"') -- Windows
-- vim.ui.open(url) -- need Neovim 0.10.0+
end,

-- Optional, by default when you use `:ObsidianFollowLink` on a link to an image
-- file it will be ignored but you can customize this behavior here.
---@param img string
Expand All @@ -461,14 +461,14 @@ carefully and customize it to your needs:
-- vim.fn.jobstart({"xdg-open", url}) -- linux
-- vim.cmd(':silent exec "!start ' .. url .. '"') -- Windows
end,

-- Optional, set to true if you use the Obsidian Advanced URI plugin.
-- https://github.com/Vinzent03/obsidian-advanced-uri
use_advanced_uri = false,

-- Optional, set to true to force ':ObsidianOpen' to bring the app to the foreground.
open_app_foreground = false,

picker = {
-- Set your preferred picker. Can be one of 'telescope.nvim', 'fzf-lua', or 'mini.pick'.
name = "telescope.nvim",
Expand All @@ -487,49 +487,49 @@ carefully and customize it to your needs:
insert_tag = "<C-l>",
},
},

-- Optional, sort search results by "path", "modified", "accessed", or "created".
-- The recommend value is "modified" and `true` for `sort_reversed`, which means, for example,
-- that `:ObsidianQuickSwitch` will show the notes sorted by latest modified time
sort_by = "modified",
sort_reversed = true,

-- Set the maximum number of lines to read from notes on disk when performing certain searches.
search_max_lines = 1000,

-- Optional, determines how certain commands open notes. The valid options are:
-- 1. "current" (the default) - to always open in the current window
-- 2. "vsplit" - to open in a vertical split if there's not already a vertical split
-- 3. "hsplit" - to open in a horizontal split if there's not already a horizontal split
open_notes_in = "current",

-- Optional, define your own callbacks to further customize behavior.
callbacks = {
-- Runs at the end of `require("obsidian").setup()`.
---@param client obsidian.Client
post_setup = function(client) end,

-- Runs anytime you enter the buffer for a note.
---@param client obsidian.Client
---@param note obsidian.Note
enter_note = function(client, note) end,

-- Runs anytime you leave the buffer for a note.
---@param client obsidian.Client
---@param note obsidian.Note
leave_note = function(client, note) end,

-- Runs right before writing the buffer for a note.
---@param client obsidian.Client
---@param note obsidian.Note
pre_write_note = function(client, note) end,

-- Runs anytime the workspace is set/changed.
---@param client obsidian.Client
---@param workspace obsidian.Workspace
post_set_workspace = function(client, workspace) end,
},

-- Optional, configure additional syntax highlighting / extmarks.
-- This requires you have `conceallevel` set to 1 or 2. See `:help conceallevel` for more details.
ui = {
Expand All @@ -547,7 +547,7 @@ carefully and customize it to your needs:
-- Replace the above with this if you don't have a patched font:
-- [" "] = { char = "☐", hl_group = "ObsidianTodo" },
-- ["x"] = { char = "✔", hl_group = "ObsidianDone" },

-- You can also add more custom ones...
},
-- Use bullet marks for non-checkbox lists.
Expand All @@ -574,21 +574,21 @@ carefully and customize it to your needs:
ObsidianHighlightText = { bg = "#75662e" },
},
},

-- Specify how to handle attachments.
attachments = {
-- The default folder to place images in via `:ObsidianPasteImg`.
-- If this is a relative path it will be interpreted as relative to the vault root.
-- You can always override this per image by passing a full path to the command instead of just a filename.
img_folder = "assets/imgs", -- This is the default

-- Optional, customize the default name or prefix when pasting images via `:ObsidianPasteImg`.
---@return string
img_name_func = function()
-- Prefix image names with timestamp.
return string.format("%s-", os.time())
end,

-- A function that determines the text to insert in the note when pasting an image.
-- It takes two arguments, the `obsidian.Client` and an `obsidian.Path` to the image file.
-- This is the default implementation.
Expand Down Expand Up @@ -784,7 +784,7 @@ are supported out-of-the-box. For example, with the following configuration
>lua
{
-- other fields ...

templates = {
folder = "my-templates-folder",
date_format = "%Y-%m-%d-%a",
Expand All @@ -797,7 +797,7 @@ and the file `~/my-vault/my-templates-folder/note template.md`:

>markdown
# {{title}}

Date created: {{date}}
<

Expand All @@ -806,7 +806,7 @@ will insert

>markdown
# Configuring Neovim

Date created: 2023-03-01-Wed
<

Expand Down

0 comments on commit fcbf8b7

Please sign in to comment.