Skip to content

itsvinayak/nvim-notes.nvim

Repository files navigation

nvim-notes.nvim

Lua Format

nvim-notes

nvim-notes is a simple Neovim plugin for managing notes. It integrates with Telescope.nvim to help you create, search, and manage notes easily within Neovim

Features

  • Create Notes: Quickly create notes with :Notes write.
  • Search Notes: Search through your notes with :Notes find using Telescope.
  • List Notes: Retrieve a list of all notes with :Notes get.
  • Custom Setup: Configure note paths, logging, and more with :Notes setup.

Installation (Using Lazy.nvim)

Add the following lines to your init to install the plugin with Lazy.nvim.lua:

  • Add nvim-notes to your Lazy.nvim setup:
require('lazy').setup {
  {
    'itsvinayak/nvim-notes.nvim',
    dependencies = {
      'nvim-telescope/telescope.nvim', -- Add Telescope as a dependency
      'folke/which-key.nvim', -- Add WhichKey as a dependency (optional)
    },
    config = function()
      require('notes').setup {
        -- Optional configurations
        path = '~/.my_notes', -- Custom path for notes (default is '~/.notes')
        log_enabled = true, -- Enable logging (default is false)
        log_level = 'INFO', -- Set log level to INFO
        filetype = 'txt', -- Sets the notes filetype default is 'md'
      }

      -- Add WhichKey mappings (optional)
      if pcall(require, 'which-key') then
        local wk = require 'which-key'
        wk.add {
          { '<leader>nw', 'New Note' },
          { '<leader>nf', 'Find Note' },
          { '<leader>ng', 'Get Note' },
        }
      end
    end,
  },
}
  • Synchronize Plugins: After adding the above, run:
:Lazy sync

Commands

  • :Notes write Opens a new buffer to create a note. The note is saved in the specified notes directory.
  • :Notes find Searches for notes using Telescope.
  • :Notes get Lists all the notes in the notes directory.

Key Mappings

You can add key mappings to your init.lua or Neovim configuration to make working with the plugin easier:

vim.api.nvim_set_keymap('n', '<leader>nw', ':Notes write<CR>', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<leader>nf', ':Notes find<CR>', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<leader>ng', ':Notes get<CR>', { noremap = true, silent = true })

Configuration

The plugin comes with default settings, which you can customize during setup:

require('notes').setup {
  path = '~/.notes',               -- Directory where notes are saved
  log_level = 'INFO',              -- Log level: INFO, DEBUG, ERROR, etc.
  log_enabled = false,             -- Enable or disable logging
  filetype = 'txt',                      -- Sets the notes filetype
}

Dependencies

  • Neovim 0.5+: Make sure you're running Neovim 0.5 or higher.
  • Telescope.nvim: This plugin requires Telescope to perform note searches.

Contributors

vinayak
vinayak

💻 📖
Michael Connell
Michael Connell

📖
Georgi Chochev
Georgi Chochev

💻 📖

License

This project is licensed under the GNU License. See the LICENSE file for more information.

About

nvim-notes is a simple Neovim plugin for managing notes.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages