Code Monkey home page Code Monkey logo

hoon.vim's Introduction

Install with your favorite package manager. For Plug, between plug#begin and plug#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. Install it with:

npm install -g @urbit/hoon-language-server

Install and build Urbit. Then, start a fake ~zod with:

urbit -lF zod -c zod

And start the language server at the Urbit Dojo prompt with:

|start %language-server

Then, 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'],
        \ })
endif

If 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'],
        \ })
endif

Various other combinations of plugins are possible, to taste.

For using this language server with Neovim refer to the configuration provided by nvim-lspconfig.

hoon.vim's People

Contributors

arthropodseven avatar belisarius222 avatar crides avatar ericfode avatar hoclun-rigsep avatar hunner avatar jtobin avatar liam-fitzgerald avatar matthiasschaub avatar patosullivan avatar philipcmonk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hoon.vim's Issues

Set shiftwidth to 2

This will make foldmethod=indent useful for sorting out the structure of our big library cores etc.

hard tabs should be disabled

We should probably put set expandtab and set shiftwidth=2 in here somewhere, since tabs are syntax errors (and somewhat confusing for new users).

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.