Code Monkey home page Code Monkey logo

forester.nvim's Introduction

๐ŸŒฒ forester.nvim ๐ŸŒฒ

Filetype plugin for forester, a tool for writing mathematical hypertext

Features

This plugin is pre-alpha, expect breaking changes.

  • Tree-sitter syntax highlighting Please report any issues with the grammar in the relevant repository
  • following links and transclusions with gf
  • Searching for trees by title with telescope
  • Creating new trees without leaving your editor

Available user commands:

  • Forester browse: Telescope picker, search trees by title. TODO: support browsing by tag/taxon/...
  • Forester new: Create a new tree by specifying a prefix
  • Forester new_random: Create a new tree with a random adress by specifying a prefix
  • Forester config: Choose the config file from which to source the tree directories
  • Forester transclude_new: transclude a new tree at cursor position
  • Forester link_new: link a new tree at cursor position

There is ongoing work on the Forester LSP, so I am not going to put effort into supporting completion in this plugin.

Installation

With lazy:

  {
    "kentookura/forester.nvim",
    dependencies = {
      { "nvim-telescope/telescope.nvim" },
      { "nvim-treesitter/nvim-treesitter" },
      { "nvim-lua/plenary.nvim" },
      { "hrsh7th/nvim-cmp" },
    },
  },

You might need to run :TSInstall toml and :TSInstall forester.

Configuration

In your forest.toml (or any other config) you should add the list of prefixes:

prefixes = ["foo", "bar"]

When calling :Forester new, you will then be able to choose the prefix of the new tree.

{
  config = function()
    local forester = require("forester")
    vim.g.mapleader = " "

    vim.keymap.set("n", "<leader>n.", "<cmd>Forester browse<CR>", { silent = true })
    vim.keymap.set("n", "<leader>nn", "<cmd>Forester new<CR>", { silent = true })
    vim.keymap.set("n", "<leader>nr", "<cmd>Forester new_random<CR>", { silent = true })
    vim.keymap.set("i", "<C-t>", "<cmd>Forester transclude<CR>", { silent = true })
    vim.keymap.set("i", "<C-l>", "<cmd>Forester link<CR>", { silent = true })
  end,
}

require("nvim-web-devicons").setup({ override_by_extension = { ["tree"] = { icon = "๐ŸŒฒ" } } })

Roadmap

  • Adding more telescope pickers and previewers, making use of the forester query commands
  • Link & transclude existing trees at cursor position.
  • autocomplete
  • ...

forester.nvim's People

Contributors

kentookura avatar nickhu 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.