A Neovim plugin for seamless integration with Joplin, the open-source note-taking and to-do application. This plugin allows you to manage your Joplin notes and notebooks directly from Neovim, providing a powerful and efficient workflow for developers and writers who love both applications.
telescope.nvim
.curl
command-line tool.You can install joplin.nvim
using your favorite plugin manager.
{
"happyeric77/joplin.nvim",
dependencies = {
"nvim-telescope/telescope.nvim",
"nvim-lua/plenary.nvim",
},
config = function()
require("joplin").setup({
-- Your configuration options here
})
end,
},
use {
"happyeric77/joplin.nvim",
requires = {
"nvim-telescope/telescope.nvim",
"nvim-lua/plenary.nvim",
},
config = function()
require("joplin").setup({
-- Your configuration options here
})
end,
}
-- Basic setup (using environment variable JOPLIN_TOKEN)
require("joplin").setup()
-- Custom configuration
require("joplin").setup({
-- API Configuration (flat structure, NOT nested under 'api')
token_env = "JOPLIN_TOKEN", -- Environment variable for token
token = nil, -- Or directly specify token (overrides env var)
port = 41184,
host = "localhost",
-- Tree view settings
tree = {
height = 12,
position = "botright",
focus_after_open = false,
auto_sync = true,
},
-- Keymap settings
keymaps = {
enter = "replace", -- Enter behavior: replace/vsplit
o = "vsplit", -- o behavior: vsplit/replace
search = "<leader>js",
search_notebook = "<leader>jsnb",
toggle_tree = "<leader>jt",
},
-- Startup validation settings
startup = {
validate_on_load = true, -- Validate requirements on startup
show_warnings = true, -- Show warning messages
async_validation = true, -- Async validation to avoid blocking
validation_delay = 100, -- Delay before validation starts
},
})
Important Notes:
api
)token
is specified, it overrides the token_env
environment variableJOPLIN_TOKEN
takes priority unless token
is explicitly setImportant: You need to provide your Joplin Web Clipper authorization token. You can either set the JOPLIN_TOKEN
environment variable (recommanded) or specify the token directly in the setup()
function. You can find your token in Joplin's settings under Web Clipper -> Advanced Options -> Authorization Token
.
The easiest way to diagnose issues is to run the comprehensive health check:
:checkhealth joplin
This will check:
The health check provides detailed error messages and step-by-step fix instructions for any issues found.
For a quick connection test, you can use:
:JoplinPing
joplin.nvim
automatically validates your setup when the plugin loads. If you see warnings, here's how to fix them:
This means the plugin can't find your Joplin API token. To fix this:
Set environment variable (recommended):
export JOPLIN_TOKEN="your_token_here"
Or configure directly in setup:
require("joplin").setup({
token = "your_token_here"
})
Find your token:
Tools > Options > Web Clipper
This means the plugin can't connect to Joplin's Web Clipper service. To fix this:
Ensure Joplin is running:
Enable Web Clipper service:
Tools > Options > Web Clipper
Check port availability:
curl http://localhost:41184/ping
# Should return: JoplinClipperServer
If using non-default port:
require("joplin").setup({
port = 41185, -- Your custom port
})
If you want to disable startup validation:
require("joplin").setup({
startup = {
validate_on_load = false, -- Disable validation
show_warnings = false, -- Disable warning messages
}
})
For more detailed help, run :JoplinHelp
in Neovim.
joplin.nvim
provides the following commands:
:JoplinTree
: Open the interactive tree browser.:JoplinFind
: Search for notes using Telescope.:JoplinSearch
: Same as :JoplinFind
.:JoplinFindNotebook
: Search for notebooks using Telescope.:JoplinBrowse
: Open a simple text-based list browser.:JoplinPing
: Test the connection to the Joplin Web Clipper service.:JoplinHelp
: Show the help message with all commands and keymaps.The following keymaps are available in the tree browser:
Key | Action |
---|---|
<CR> |
Open a note (behavior defined by keymaps.enter ) or expand/collapse a notebook. |
o |
Open a note (behavior defined by keymaps.o ). |
a |
Create a new item (ending with / creates a folder, otherwise a note). |
A |
Create a new folder (shortcut). |
d |
Delete a note or folder (with confirmation). |
r |
Rename a note or folder. |
m |
Move a note or folder (uses Telescope to select the destination). |
R |
Refresh the tree structure. |
q |
Close the tree browser. |
When searching with :JoplinFind
or :JoplinFindNotebook
, you can use the following keymaps in the Telescope window:
Key | Action |
---|---|
<CR> |
Open the selected note. |
<C-v> |
Open the selected note in a vertical split. |
To run the tests for joplin.nvim
, you can use the following command:
nvim --headless -c "PlenaryBustedDirectory tests/" -c "qa"
This project is licensed under the MIT License. See the LICENSE file for details.