Giter VIP home page Giter VIP logo

neuron-v2.vim's Introduction

neuron-v2.vim

Manage your Zettelkasten with the help of neuron in {n}vim. This is a fork of a fork that supports Neuron's V2 format.

(This is an actively maintaned fork of ihsanturk/neuron.vim that works with newer versions of neuron and changes basically everything, with extra features, commands and different options.)

usage-photo

Requirements

  • neuron
  • fzf
  • ag if you intend to use the content search command.

Installation

Using vim-plug

Plug 'junegunn/fzf.vim'
Plug 'chiefnoah/neuron-v2.vim'

There are several ways to manage {n}vim plugins with home-manager. The current release has been tested with the programs.neovim module (tracking nixpkgs-unstable) like so:

{
  programs.neovim = {
    enable = true;
    plugins = with pkgs.vimPlugins; [
      neuron-vim
      # ...
    ];
  };
  # ...
}

Usage

  1. Open a zettel with vim or nvim. On nvim it should
    • show a virtual floating text on the first line saying how many backlinks it has;
    • show a virtual title for each linked zettel in the body.

Most operations are executed in normal mode

  1. gzZ shows a list of backlinks. Selecting one will navigate to it.
  2. gzz shows a list of all zettels, you can search their titles. Selecting one will navigate to it.
  3. Type gzi to show the same gzz list. Selecting one will insert a link to it right in front of the your cursor. gzI instead will insert a folgezettel link ([[[...]]]). You can also select a zettel from insert mode with <c-x><c-u> or <c-x><c-y> and then insert a normal link or a folgezettel link respectively.
  4. If you put your cursor on top of a link to another zettel and press gzo you'll navigate to that.
  5. gzl inserts a link to the previous zettel you visited.
    • gzL will do the same but with a folgezettel.
  6. gzu goes back after editing another zettel type.
    • gzu repeatedly will cycle between the two last visited zettels.
  7. gzU goes back multiple times in the history of visited zettels (and gzP will go forward).
  8. gzn creates a new blank zettel buffer, inserts the id into the current buffer under the cursor, and edits the new zettel buffer
  9. gzc creates a new blank zettel buffer and opens it
  10. gzN creates a new zettel using the current word under the cursor as its title.
    • if you're in visual selection mode gzN will instead use the selected text (only the first line if there are more than one selected). This will replace the selected text or current word with a link to the newly-created zettel.
  11. gzs works like gzz, but instead it searches the content of the zettels, not only the title. For this it calls the external command ag.
  12. gzt will allow you to insert new tags or gzT will show you a list of existing tags to then insert.

Customization

  • neuron.vim uses a custom function to generate ids for new zettels that it creates, bypassing neuron new completely. By default it generates a random hex string of 8 characters. You can hook into the process by defining a function g:CustomNeuronIDGenerator in your .vimrc that takes an optional title argument. For example:

    To make it use the title as kebab-cased ID (when using gzN):

    func! g:CustomNeuronIDGenerator(title)
    	return substitute(a:title, " ", "-", "g")
    endf
    

    If g:CustomNeuronIDGenerator is not defined in your .vimrc or returns an empty string, neuron.vim will fall back to generating random IDs.

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.