Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/danymat/lsp-zettelkasten

Barebone implementation of a Language Server Protocol for Zettelkasten
https://github.com/danymat/lsp-zettelkasten

language-server language-server-protocol lsp obsidian obsidian-md zettelkasten zettelkasten-methodology

Last synced: 2 months ago
JSON representation

Barebone implementation of a Language Server Protocol for Zettelkasten

Awesome Lists containing this project

README

        

# lsp-zettelkasten

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

![movie-1](https://github.com/lsp-zettelkasten/lsp-zettelkasten/blob/main/.assets/vid1.mov)

## 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

```bash
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.

- Neovim (using [lspconfig](https://github.com/lsp-zettelkasten/lsp-zettelkasten.git))

~/.config/nvim/init.lua

```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{}
```