This commit is contained in:
elkowar 2021-04-22 19:54:37 +02:00
parent 4b9ab46ce7
commit d79ff1ce13
3 changed files with 23 additions and 28 deletions

View file

@ -37,36 +37,32 @@
(local capabilities (vim.lsp.protocol.make_client_capabilities))
(set capabilities.textDocument.completion.completionItem.snippetSupport true)
(set capabilities.textDocument.completion.completionItem.resolveSupport
{ :properties ["documentation" "detail" "additionalTextEdits"]})
{ :properties ["documentation" "detail" "additionalTextEdits"]})
(lsp.rust_analyzer.setup { :on_attach on_attach
:capabilities capabilities})
(lsp.vimls.setup { :on_attach on_attach})
(lsp.tsserver.setup { :on_attach on_attach :root_dir (lsp.util.root_pattern "package.json")})
(lsp.bashls.setup { :on_attach on_attach })
(lsp.html.setup { :on_attach on_attach})
(lsp.denols.setup { :on_attach on_attach
:root_dir (better_root_pattern [".git"] ["package.json"])})
(lsp.hls.setup { :on_attach on_attach
:settings { :languageServerHaskell { :formattingProvider "stylish-haskell"}}})
(fn init-lsp [lsp-name ?opts]
"initialize a language server with defaults"
(let [merged-opts {:on_attach on_attach}]
(each [k v (pairs (or opts {}))]
(tset merged-opts k v))
((. lsp lsp-name :setup) merged-opts)))
(lsp.jsonls.setup
{ :on_attach on_attach
:commands { :Format [ (fn [] (vim.lsp.buf.range_formatting [] [0 0] [(vim.fn.line "$") 0]))]}})
(init-lsp :rust_analyzer { :capabilities capabilities})
(init-lsp :tsserver { :root_dir (lsp.util.root_pattern "package.json")})
(init-lsp :jsonls { :commands { :Format [ #(vim.lsp.buf.range_formatting [] [0 0] [(vim.fn.line "$") 0])]}})
(init-lsp :denols { :root_dir (better_root_pattern [".git"] ["package.json"])})
(init-lsp :hls { :settings { :languageServerHaskell { :formattingProvider "stylish-haskell"}}})
(init-lsp :vimls)
(init-lsp :bashls)
(init-lsp :erlangls)
(init-lsp :yamlls)
(init-lsp :html)
(init-lsp :cssls)
;(lsp.vimls.setup { :on_attach on_attach})
(when (not lsp.erlangls)
(set lsp-configs.erlangls
{ :default_config
{ :cmd ["erlang_ls"]
:filetypes ["lua"]
:root_dir (lsp.util.root_pattern "rebar.config")
:settings {}}}))
(lsp.erlangls.setup {})
(compe.setup
{ :enabled true

View file

@ -13,5 +13,5 @@
{:defaults
{:i { "<esc>" actions.close}}})
(telescope.load_extension "media_files")

View file

@ -123,7 +123,7 @@ augroup basics
autocmd BufRead,BufNewFile *.ddl setlocal filetype=sql
" Auto-close quickfix list after entry is selected
" Auto-close quickfix list when element
autocmd FileType qf nnoremap <buffer> <CR> <CR>:cclose<CR>
augroup END
@ -214,7 +214,6 @@ au Syntax * RainbowParenthesesLoadBraces
nnoremap <silent> <C-p> :Telescope find_files<CR>
lua require('telescope').load_extension('media_files')
"map <Leader>f <Plug>(easymotion-bd-f)