Skip to content
プロジェクト

概要

:book: Base Obsidian functionality in your Neovim

仕事効率化・自動化

この数値の測り方

できること

  • Creating new notes
  • Creating/Opening daily notes
  • Selecting and inserting templates to buffer with support placeholders like: {{title}}, {{date}}, {time}}
  • Searching notes with Telescope integration

計測したスター増加

24時間
0
7日間
0
15日間
0
1か月
0

期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。

Obsidian for Neovim (WIP)

I often use Obsidian to take daily notes and maintain my knowledge base. This plugin allows you to use the basic functionality to work with Obsidian vaults.

For full experience needs nvim-telescope/telescope.nvim plugin, nvim-cmp plugin. And it also needs CLI tools like ripgrep, fd and sd.

See more details in Features and help file.

Features

  • Opening vault
  • Creating new notes
  • Creating/Opening daily notes
  • Selecting and inserting templates to buffer with support placeholders like: {{title}}, {{date}}, {time}}
  • Searching notes with Telescope integration
  • Searching backlinks of the current note
  • Going to file via wiki link
  • Renaming current note with updating wiki links
  • Autocomplete of wiki links with cmp integration
  • Multi vault

Configuration example with lazy.nvim

You do not need to decorate functions in keys if you have only one vault in opts.vaults.

{
  'ada0l/obsidian',
  lazy = 'VeryLazy',
  keys = {
    { '<leader>ov', '<cmd>lua require("obsidian").vault_prompt()<cr>', desc = 'Vault prompt' },
    { '<leader>oc', '<cmd>lua require("obsidian").cd_vault()<cr>', desc = 'Cd vault' },
    { '<leader>on', '<cmd>lua require("obsidian").new_note_prompt()<cr>', desc = 'New note' },
    { '<leader>ot', '<cmd>lua require("obsidian").open_today()<cr>', desc = 'Open today' },
    { '<leader>oT', '<cmd>lua require("obsidian").open_today_prompt()<cr>', desc = 'Open today (shift)' },
    { '<leader>oi', '<cmd>lua require("obsidian").template_picker()<cr>', desc = 'Template picker' },
    { '<leader>of', '<cmd>lua require("obsidian").note_picker()<cr>', desc = 'Note picker' },
    { '<leader>ob', '<cmd>lua require("obsidian").backlinks_picker()<cr>', desc = 'Backlinks picker' },
    { '<leader>or', '<cmd>lua require("obsidian").rename_prompt()<cr>', desc = 'Rename prompt' },
    {
      'gf',
      function()
        if require('obsidian').found_wikilink_under_cursor() ~= nil then
          return '<cmd>lua require("obsidian").go_to()<CR>'
        else
          return 'gf'
        end
      end,
      noremap = false,
      expr = true,
    },
  },
  ---@type ObsidianOptions
  opts = {
    extra_fd_opts = '--exclude assets --exclude journals --exclude _debug_remotely_save',
    vaults = {
      {
        dir = '~/Knowledge/',
        daily = {
          dir = 'journals',
          format = '%Y-%m-%d',
        },
        note = {
          dir = '.',
          transformator = function(filename)
            if filename ~= nil and filename ~= '' then
              return filename
            end
            return string.format('%d', os.time())
          end,
        },
        templates = {
          dir = 'templates',
          date = '%Y-%d-%m',
          time = '%Y-%d-%m',
        },
      },
    },
  },
}

Cmp integration

{
  'hrsh7th/nvim-cmp',
  dependencies = {
    'ada0l/obsidian',
  },
  ---@param opts cmp.ConfigSchema
  opts = function(_, opts)
    local cmp = require('cmp')
    local obsidian = require('obsidian')
    cmp.register_source('obsidian', obsidian.get_cmp_source().new())
    table.insert(opts.sources, { name = 'obsidian' })
  end,
},

Similar plugins

関連プロジェクトを探す

読み込み中…