Skip to content

Barebone implementation of a Language Server Protocol for Zettelkasten

Notifications You must be signed in to change notification settings

danymat/lsp-zettelkasten

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

lsp-zettelkasten

This repo is a basic implementation of a lsp for zettelkasten markdown files

movie-1

Features

  • ✔️ Support for link completion for type [[link here]].
  • 🚧 Clickable links inside [[..]].
  • ✔️ Support for file content preview in completion (with onCompletionResolve).
  • 🚧 Hover option on clickable links, in order to preview the file.
  • 🚧 Support tag completions with # character (needs a grammar).

Installation

git clone https://github.com/lsp-zettelkasten/lsp-zettelkasten.git
cd lsp-zettelkasten/server
npm install
npm run compile

After compiling, the compiled javascript will be in out directory.

Usage

The command to start the lsp is node out/server.js --stdio.

However, you'll need a working client for your text editor.

~/.config/nvim/init.lua
local lspconfig = require'lspconfig'
local configs = require'lspconfig/configs'

if not lspconfig.zettelkastenlsp then
  configs.zettelkastenlsp = {
    default_config = {
      cmd = {'node',  'path/to/lsp-zettelkasten/out/server.js', '--stdio'};
      filetypes = {'markdown'};
      root_dir = function(fname)
        return lspconfig.util.find_git_ancestor(fname) or vim.loop.os_homedir()
      end;
      settings = {};
    };
  }
end
lspconfig.zettelkastenlsp.setup{}

Releases

No releases published

Packages

No packages published