A support plugin for LanguageClient_NeoVim which integrates pureScript-language-server for easy access to a PureScript development environment with Vim/NeoVim.
Use your favorite plugin manager.
Using vim-plug:
Plug 'shivamashtikar/vimmer-ps'
Using vundle:
Plugin 'shivamashtikar/vimmer-ps'
Using neobundle:
NeoBundle 'shivamashtikar/vimmer-ps'
With pathogen.vim, just clone this repository inside ~/.vim/bundle
:
vimmers-ps requires purescript-language-server to be installed. You will want to install this either globally or locally for npm, e.g.
npm i -g purescript-language-server
If you are a yarn user, do this instead.
yarn global add purescript-language-server
This plugin is dependent on the following plugins
- LanguageClient_NeoVim
- Fzf.vim
- deoplete, (Optional for suggestions, see LanguageClient_NeoVim for other completion plugins)
This plugin adds some default Keybindings that we prefer at work. If these conflict with yours or you wanted to customize them, then you can disable default key mapping and set your own.
let g:vimmerps_disable_mappings = v:true
Here is how this plugin sets the default Keybindings. You can modify them to suite your own taste.
" Note: following are default key bindings
autocmd filetype purescript nm <buffer> <silent> <leader>a :Papply<CR>
autocmd filetype purescript nm <buffer> <silent> <leader>i :Pimport<CR>
autocmd filetype purescript nm <buffer> <silent> <leader>g :call LanguageClient_textDocument_definition()<CR>
autocmd filetype purescript nm <buffer> <silent> <leader>h :call LanguageClient_textDocument_hover()<CR>
autocmd filetype purescript nm <buffer> <silent> <leader>l :Pbuild<CR>
You can also change the configuration that is passed to the language server. If not a default configuration is passed. In order to change it, use g:vimmerps_config
variable and set it to a dictionary.
let g:vimmerps_config =
\ { 'autoStartPscIde': v:true
\ , 'pscIdePort': v:null
\ , 'autocompleteAddImport': v:true
\ , 'pursExe': 'purs'
\ , 'addNpmPath': v:true
\ }
You can find the available options in the VSCode plugin. When you do that, omit the purescript.
prefix. It will be added automatically.
This command registers some buffer commands. Here's a list of them.
- Start server if not running
:Pstart
- Stop server
:Pend
- Restart server
Prestart
- Search functions
:Psearch catMaybes
- Import functions, type classes, datatypes with
:Pimport
- Apply code actions
:Papply
- Issue custom commands directly to language-server with
:Pcommand
If you like this plugin, please star it on Github. Also please give a star to all the awesome plugins we depend on. It's a great way of encouraging people. Same goes for issues reports or feature requests.