Skip to content

Instantly share code, notes, and snippets.

@Gabriella439
Created January 9, 2022 16:26
Show Gist options
  • Save Gabriella439/8cd898bc7f3d83b28db0ee6e12cc4431 to your computer and use it in GitHub Desktop.
Save Gabriella439/8cd898bc7f3d83b28db0ee6e12cc4431 to your computer and use it in GitHub Desktop.
First draft of init.vim for haskell-language-server
call plug#begin()
Plug 'neovim/nvim-lspconfig'
call plug#end()
lua << EOF
require('lspconfig').hls.setup({
settings = {
haskell = {
formattingProvider = 'stylish-haskell',
},
},
on_attach = function(client)
vim.api.nvim_buf_set_keymap(0, 'n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>', {noremap = true})
vim.api.nvim_buf_set_keymap(0, 'n', '<C-n>', '<cmd>lua vim.lsp.diagnostic.goto_next()<CR>', {noremap = true})
vim.api.nvim_buf_set_keymap(0, 'n', '<C-p>', '<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>', {noremap = true})
vim.api.nvim_buf_set_option(0, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
vim.api.nvim_buf_set_option(0, 'tagfunc', 'v:lua.vim.lsp.tagfunc')
end,
})
EOF
:set nohlsearch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment