Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rescript-lang/vim-rescript
https://github.com/rescript-lang/vim-rescript
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/rescript-lang/vim-rescript
- Owner: rescript-lang
- License: mit
- Created: 2020-08-17T22:03:37.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-07-29T00:58:02.000Z (5 months ago)
- Last Synced: 2024-11-05T21:44:46.429Z (about 1 month ago)
- Language: Vim Script
- Size: 78.9 MB
- Stars: 152
- Watchers: 5
- Forks: 15
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- awesome-list - vim-rescript - lang | 90 | (Vim script)
- awesome-rescript - VIM-ReScript
README
# vim-rescript
Vim runtime files for ReScript.
> If you are experiencing any troubles, open an issue or visit our [Forum](https://forum.rescript-lang.org) and ask for guidance.
## Features
- Syntax highlighting for ReSript files
- Filetype detection for `.res`, `.resi`
- Basic automatic indentationSee `:h rescript` for the detailed [helpfile](./doc/rescript.txt).
## Installation
`vim-rescript` can be installed either manually or by using your favourite plugin manager.
```vim
" vim-plug
Plug 'rescript-lang/vim-rescript'" Vundle
Plugin 'rescript-lang/vim-rescript'" NeoBundle
NeoBundle 'rescript-lang/vim-rescript'
``````lua
-- Lazy.nvim
{ 'rescript-lang/vim-rescript', ft="rescript" }
```You can also pin your installation to specific tags (check our releases [here](https://github.com/rescript-lang/vim-rescript/releases)):
With Plug:
```vim
Plug 'rescript-lang/vim-rescript', {'tag': 'v2.1.0'}
```With [Lazy.nvim](https://github.com/folke/lazy.nvim):
```lua
{ 'rescript-lang/vim-rescript', tag = "v2.1.0" }
```## Setup LSP
First you need install the language server for ReScript from npm
> **Note**
> If you are using [mason.nvim](https://github.com/williamboman/mason.nvim) you can install the ReScript Language Server using the command `MasonInstall rescript-language-server````sh
npm install -g @rescript/language-server
```The binary is called `rescript-language-server`
### Neovim LSP builtin
Install the [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig) package and setup the LSP
```lua
local lspconfig = require('lspconfig')lspconfig.rescriptls.setup{}
```For more details, see [server configuration](https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#rescriptls)
### COC (Vim or Neovim)
(`:h rescript-coc`)
After the installation, open your coc config (`:CocConfig`) and add the following configuration:
```json
"languageserver": {
"rescript": {
"enable": true,
"module": "rescript-language-server",
"args": ["--node-ipc"],
"filetypes": ["rescript"],
"rootPatterns": ["rescript.json", "bsconfig.json"]
}
}
```## Credits
- [amirales](https://github.com/amiralies): Started the plugin w/ syntax & indent functionality