GithubHelp home page GithubHelp logo

sqve / notebox.nvim Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 10 KB

Notebox is a lightweight Neovim plugin for efficient management and retrieval of Markdown-based notes

License: MIT License

Lua 100.00%

notebox.nvim's Introduction

๐Ÿ“ฅ notebox

Notebox is a plugin for Neovim designed to help you manage your Markdown-based notes. It is intentionally lightweight, adhering to the Unix philosophy, and focuses on streamlining the creation and retrieval of notes.

Additional note-taking features, such as highlighting and LSP support, are accessible through other plugins; see the [companions] section for more information.



โœจ Key features

  • Key: Value


โšก Requirements


๐Ÿ“ฆ Installation

{
  'sQVe/notebox.nvim',
  dependencies = { 'nvim-lua/plenary.nvim' },
  opts = {
    -- Input configuration here.
    -- Refer to the configuration section below for options.
  }
},
use({
  'sQVe/notebox.nvim',
  requires = { 'nvim-lua/plenary.nvim' },
  config = function()
    require('notebox').setup({
      -- Input configuration here.
      -- Refer to the configuration section below for options.
    })
  end,
})


๐Ÿ”Œ Configuration

The following code block shows the available options and their defaults:

{
  generate_note_id = nil,
  get_open_options = nil,
  root_directory = vim.fn.expand('$HOME') .. '/notebox',
  subdirectories = {
    dailies = 'dailies',
    new_notes = 'inbox',
    templates = 'templates',
  },
}


generate_note_id

A callback function that generates the id of a note. The builtin handler for this provides the following ids:

Type Format Example
Daily %Y%m%d-%A 20230131-wednesday
Note %Y%m%d- + title 20230131-my-note-title

Parameters

  • type: ('daily' | 'note')? - The note type.
  • title: string? - The note title.

Return

Returns the note id string.


get_open_options

A callback function that returns the options to feed into the opening process. The built-in handler supports opening the file on macOS (open) and Linux (xdg-open) in the program associated with its type.

Return

Returns a table: { command: string, args: string[] } with arguments to pass to the open process.

Example


root_directory

A string value that determines the root directory for notebox.


subdirectories

A table that sets sub directory names within the root_directory.

dailies

A string value that determines where daily notes will be stored.

new_notes

A string value that determines where new notes will be stored.

templates

A string value that determines where templates are stored.

The following template files are used:

  1. daily.md: When creating a new daily note.
  2. note.md: When creating a new note.


๐Ÿ“— Usage

Notebox works out-of-the-box with the auto_start option enabled. The following API is available under require('notebox') if you want to handle things manually:


require('notebox').setup

Sets up the plugin, see configuration for further information.


require('notebox/note').new_note

Create a new note.

Parameters

  • note_type: ('daily' | 'note')? - The type of note. Defaults to 'note'.
  • note_title: string? - The title of the note. The user will be prompted for the title if it is not provided.
  • use_buffer_directory: boolean? - Determines whether to create the new note in the same directory as the current buffer. Defaults to false.


require('notebox/note').open_note

Open the current note in the system default application.


require('notebox/telescope').find_note

Find notes by their filename.

Parameters

  • root_directory: string? - The root directory, defaults to config.root_directory config if unspecified.


require('notebox/telescope').live_grep_note

Find notes by their content.

Parameters

  • root_directory: string? - The root directory, defaults to config.root_directory config if unspecified.


๐Ÿ‘ฅ Companions

The purpose of notebox is to provide frictionless creation and retrieval of notes. It is just one piece of a larger puzzle when it comes to creating a cozy environment for managing Markdown-based notes. The remaining information in this section will give you an opinionated view on how I ([sQVe]) have set up other Neovim plugins to create my note-taking environment.


LSP and completion

One essential part of any note-taking environment is the ability to easily navigate and reference other notes. The following plugins provide a rich set of features for this purpose:


Syntax and highlighting


๐Ÿ’ก Inspiration

The following plugins inspired this plugin:

  • obsidian.nvim
    • This plugin kick-started my note-taking journey and helped me discover my preferred method for working with markdown-based notes. See alternatives to notebox for a comparison.
    • It provided insights into how to open notes in Obsidian, which is the GUI note-taking application that I personally use.
  • nvim-lspconfig
    • It provided insights into how to safely resolve the current operating system, especially when it comes to Windows.


๐Ÿ”€ Alternatives to notebox

There are multiple alternatives to notebox, most of which aim to provide a feature-rich or even feature-complete note-taking environment. The following plugins are excellent options if you are willing to commit to a specific workflow and don't need to assemble your environment by yourself.

  • mkdnflow.nvim: Boosts Markdown navigation and management. Offers features inspired by Vimwiki, such as link syncing and file renaming.
  • neorg: Provides a variety of tools for note-taking and project management in the .norg format, including time tracking and authoring features.
  • obsidian.nvim: Allows writing and interacting with Obsidian vaults directly in Neovim.
  • vimwiki: Acts as a personal wiki for Vim, facilitating note-taking, task management, and content exporting to HTML.


โž• Contributing

All contributions to notebox are greatly appreciated, whether it's a bug fix or a feature request. If you would like to contribute, please don't hesitate to reach out via the [issue tracker].

Before making a pull request, please consider the following:

  • Follow the existing code style and formatting conventions.
    • Install Stylua to ensure proper formatting.
  • Write clear and concise commit messages that describe the changes you've made.


๐Ÿ Roadmap

  • Ability to customize the template name for new notes and daily notes.
  • Create a week's worth of daily notes. Useful for writing to-dos for each day of the week.
  • Customize template attributes.
  • Generate a list of notes created today within the daily note.
  • Generate a weekly review note.
  • Handle non-flat daily note structures.
  • Open notes backward or forward from the current date or from the date of the current note.

notebox.nvim's People

Contributors

sqve avatar

Stargazers

Felix Zeller avatar  avatar Yuta Katayama avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.