terrastruct / d2-vim Goto Github PK
View Code? Open in Web Editor NEWThe Vim plugin for D2 files
Home Page: https://d2-lang.com
License: BSD 3-Clause "New" or "Revised" License
The Vim plugin for D2 files
Home Page: https://d2-lang.com
License: BSD 3-Clause "New" or "Revised" License
I'm hitting the following errors:
E121: Undefined variable: b:included_syntaxes
E116: Invalid arguments for function index
I didn't do any customisations apart from installing the plugin.
Any ideas on how to fix this?
Running LunarVim 1.3 with:
NVIM v0.9.4
Build type: Release
LuaJIT 2.1.1699801871
This is the d2-vim
plugin version that I'm currently using:
Maybe related to #3
Using
~ % vim --version
NVIM v0.8.1
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by bmizerany@blaptopvm
Features: +acl +iconv +tui
See ":help feature-compile"
system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/usr/local/share/nvim"
I installed d2-vim using vim's built-in plugins like:
; git clone https://github.com/terrastruct/d2-vim/ /home/bmizerany/.config/nvim/pack/github/start/d2-vim
Current HEAD is d1cb1e7e22bc0fb4d4034a1b93c2a13cc471acc6
When I opened vim x.d2
, I got:
Error detected while processing /home/bmizerany/.config/nvim/init.lua:
E5113: Error while calling lua chunk: /home/bmizerany/.config/nvim/init.lua:5: Vim(if):E121: Undefined variable: g:d2_block_string_syntaxes
stack traceback:
[C]: in function 'cmd'
/home/bmizerany/.config/nvim/init.lua:5: in main chunk
Press ENTER or type command to continue
I tried pre-defining in my ~/.vimrc
like:
" d2
let g:d2_block_string_syntaxes = {
\ 'd2': ['d2'],
\ 'markdown': ['md', 'markdown'],
\ 'javascript': ['javascript', 'js'],
\ 'html': ['html'],
\ 'json': ['json'],
\ 'c': ['c'],
\ 'go': ['go'],
\ 'sh': ['sh', 'ksh', 'bash'],
\ 'css': ['css'],
\ 'vim': ['vim'],
\ }
but that didn't help.
I'm a little stumped because my vim-script fu is weak. Any pointers would be appreciated.
How do I install this with AstoNvim?
nvim ~/.config/nvim/lua/user/plugins.lua
return {
{ "terrastruct/d2-vim", lazy = "false" },
}
but ft=d2 is not available when I open up a file with a .d2 suffix.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.