Ⅰ. 插件描述
Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'urbit/hoon-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'urbit/hoon-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'urbit/hoon-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/urbit/hoon.vim
Ⅳ. 文档说明
Install with your favorite package manager. For
Plug, between plug#begin andplug#end in your .vimrc put:
Plug 'urbit/hoon.vim'This will give you syntax highlighting and some useful keybindings, the
most useful of which is g/ (search for arm name).
For autocomplete, syntax checking, and rune snippets, you should connect
to the [Hoon Language
Server](https://github.com/urbit/hoon-language-server). Install it
with:
npm install -g hoon-language-serverInstall and build Urbit. Then, start
a fake ~zod with:
urbit -lF zod -c zodAnd start the language server at the Urbit Dojo prompt with:
|start %language-serverThen, you can connect to this language server with any vim LSP plugin.
Here's one full-featured configuration, using
UltiSnips for snippets,
asyncomplete.vim
for autocomplete and
vim-lsp to connect to the
language server.
call plug#begin('~/.vim/plugged')
Plug 'SirVer/ultisnips'
Plug 'prabirshrestha/asyncomplete.vim'
Plug 'prabirshrestha/async.vim'
Plug 'prabirshrestha/vim-lsp'
Plug 'prabirshrestha/asyncomplete-lsp.vim'
Plug 'thomasfaingnaert/vim-lsp-snippets'
Plug 'thomasfaingnaert/vim-lsp-ultisnips'
Plug 'urbit/hoon.vim'
call plug#end()
let g:UltiSnipsExpandTrigger="<TAB>"
let g:UltiSnipsJumpForwardTrigger="<TAB>"
let g:UltiSnipsJumpBackwardTrigger="<S-TAB>"
let g:asyncomplete_auto_completeopt = 0
set completeopt=menuone,noinsert
if executable('hoon-language-server')
au User lsp_setup call lsp#register_server({
\ 'name': 'hoon-language-server',
\ 'cmd': ['hoon-language-server'],
\ 'whitelist': ['hoon'],
\ })
endifIf this isn't working, check :LspStatus to see if the language server
started correctly.
This requires python support, and I've only tested it in neovim after
running pip3 install -U neovim. If you're willing to give up rune
snippets, you can get the other features in vanilla vim with this
simpler configuration:
call plug#begin('~/.vim/plugged')
Plug 'prabirshrestha/asyncomplete.vim'
Plug 'prabirshrestha/async.vim'
Plug 'prabirshrestha/vim-lsp'
Plug 'prabirshrestha/asyncomplete-lsp.vim'
Plug 'urbit/hoon.vim'
call plug#end()
let g:asyncomplete_auto_completeopt = 0
set completeopt=menuone,noinsert
if executable('hoon-language-server')
au User lsp_setup call lsp#register_server({
\ 'name': 'hoon-language-server',
\ 'cmd': ['hoon-language-server'],
\ 'whitelist': ['hoon'],
\ })
endifVarious other combinations of plugins are possible, to taste.