Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/pyrho/nerveux.nvim

A neovim plugin written in lua to interact with the neuron Zettelkasten software.
https://github.com/pyrho/nerveux.nvim

neovim neuron nvim zettelkasten

Last synced: 16 days ago
JSON representation

A neovim plugin written in lua to interact with the neuron Zettelkasten software.

Lists

README

        

# ⚠️ This repo is unmaintained

I've migrated from neuron to [zk](https://github.com/mickael-menu/zk) and it's great neovim plugin [zk.nvim](https://github.com/mickael-menu/zk-nvim).

# Nerveux

A neovim lua plugin to interact with [neuron](http://neuron.zettel.page) (tested with neovim v0.7.0-dev+1033-g51b432a7d and
neuron version 1.9.35.3).

![nerveux_normal](https://raw.githubusercontent.com/pyrho/static-imgs/c4ed4fd7844b2306d228128540dc290e75b221ff/nerveux.jpeg)
See [this](https://asciinema.org/a/422065) asciinema recording for a little demo.

## Highlights

- Display zettle titles inline via virtual text overlays
- in `insert` mode, the virtual text is place at the end of line
- Search Zettels and their content (including tags) with [telescope.nvim](https://github.com/nvim-telescope/telescope.nvim)
- Cached queries via neuron daemon (for moar speed!)
- daemon lifecycle is handled by the plugin

## Install
Using [vim-plug](https://github.com/junegunn/vim-plug)

```vimL
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-lua/popup.nvim'
Plug 'nvim-telescope/telescope.nvim'
Plug 'pyrho/nerveux.nvim'

" Optional but recommended for better markdown syntax
Plug 'plasticboy/vim-markdown'
```

or [packer](https://github.com/wbthomason/packer.nvim/)

```lua
use {
'pyrho/nerveux.nvim',
requires = {
'nvim-lua/plenary.nvim',
'nvim-lua/popup.nvim',
'nvim-telescope/telescope.nvim',
},
config = function() require"nerveux".setup() end,
}
-- Optional but recommended for better markdown syntax
use 'plasticboy/vim-markdown'
```

## Setup

Simply add the following somewhere in your config to use the default settings.

```lua
require 'nerveux'.setup()
```

You can override the defaults like so:

```lua
require 'nerveux'.setup {
--- path to neuron executable (default: neuron in PATH)
neuron_cmd = "neuron",

--- no trailing slash, (default: current directory)
neuron_dir = "/my/zettel/root/dir",

--- Use the cache, significantly faster (default: false)
use_cache = true,

--- start the neuron daemon to keep the cache up to date (default: false)
start_daemon = true,

--- show zettel titles inline as virtual text (default: false)
virtual_titles = true,

--- Automatically create mappings (default: false)
create_default_mappings = true,

--- The Highlight Group used for the inline zettel titles (default: Special)
virtual_title_hl = "Special",
virtual_title_hl_folge = "Repeat",

--- `kill -9` the pid of the daemon at exit (VimPreLeave), only valid is
-- start_daemon is true (default: false)
kill_daemon_at_exit = true,

--- You can overwrite this table partially
-- and your settings will get merged with the defaults
-- You can also disable a single mapping by settings it's value to an empty string.
mappings = {

-- Search all your zettels
-- * then `` to edit
-- * or `` to insert the selected zettel ID under your cursor
search_zettels = "gzz" ,

-- Search the backlinks to the current zettel
backlinks_search = "gzb" ,

-- Search the only the uplinks to the current zettel
uplinks_search = "gzu" ,

-- Create a new zettel via neuron and :edit it
new = "gzn" ,

-- Search for content inside all the zettels
search_content = "gzs" ,

-- Insert the ID of the previously visited zettel
insert_link = "gzl" ,

-- Insert the ID of the previously visited zettel, but as a folgezettel
insert_link_folge = "gzL" ,

-- Open the zettel ID that's under the cursor
follow = "" ,

-- Show the help
help = "gz?" ,
}
}
```

## Troubleshooting

You can run `:checkhealth nerveux` to run a basic diagnostic.

You can also start neovim like this:

```sh
$> DEBUG_NERVEUX=1 nvim a_zettel.md
```

This will write debug logs to the following file: `~/.cache/nvim/nerveux.log`.

### Known issues

- Hiding the (see #3) zettel link with virtual text will not work if the opening brackets start on the first column.
As far as I known this is an issue with nvim itself.

## Similar plugins

- [oberblastmeister/neuron.nvim](https://github.com/oberblastmeister/neuron.nvim)
- feature rich
- from which nerveux.nvim borrows a lot of code
- still active afaik
- that's the one you should be using really :P
- [ihsanturk/neuron.vim](https://github.com/ihsanturk/neuron.vim)
- OG vim neuron plugin, but long defunct
- [fiatjaf/neuron.vim](https://github.com/fiatjaf/neuron.vim)
- A fork of the previous one, also defunct
- [chiefnoah/neuron-v2.vim](https://github.com/chiefnoah/neuron-v2.vim)
- neuron v2 compatible, but also now defunct