Skip to content

Commit

Permalink
Update lsp
Browse files Browse the repository at this point in the history
  • Loading branch information
dadgar committed Jan 21, 2021
1 parent 3662edb commit 353062a
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions .vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,11 @@ Plug 'shime/vim-livedown'
Plug 'junegunn/goyo.vim'
Plug 'gabesoft/vim-ags'
Plug 'pechorin/any-jump.vim'
Plug 'camspiers/lens.vim'

" LSP
Plug 'neovim/nvim-lsp'
Plug 'nvim-lua/completion-nvim'
Plug 'nvim-lua/lsp-status.nvim'
Plug 'nvim-lua/diagnostic-nvim'

" Snippets
Plug 'hrsh7th/vim-vsnip'
Expand All @@ -60,6 +58,10 @@ Plug 'nvim-treesitter/completion-treesitter'

call plug#end()

" Light colorscheme
let ayucolor="light"
colorscheme ayu

" Colorscheme
set termguicolors
let g:sonokai_style = 'maia'
Expand Down Expand Up @@ -296,11 +298,6 @@ set completeopt=menuone,noinsert,noselect
" Avoid showing message extra message when using completion
set shortmess+=c

" Diagnostic settings
let g:diagnostic_insert_delay = 1
let g:diagnostic_show_sign = 1
let g:diagnostic_enable_virtual_text = 1

" Snippets
let g:completion_enable_snippet = 'vim-vsnip'

Expand Down Expand Up @@ -330,15 +327,11 @@ smap S <Plug>(vsnip-cut-text)
" LSP
lua << EOF
local lsp_status = require('lsp-status')
local diagnostic = require('diagnostic')
local completion = require('completion')
local nvim_lsp = require('nvim_lsp')
local configs = require('nvim_lsp/configs')
local util = require('nvim_lsp/util')
local configs = require('lspconfig')

local on_attach = function(client, bufnr)
lsp_status.on_attach(client, bufnr)
diagnostic.on_attach(client, bufnr)
completion.on_attach(client, bufnr)

-- Keybindings for LSPs
Expand All @@ -364,25 +357,33 @@ lsp_status.config({
indicator_ok = 'ok',
})

nvim_lsp.gopls.setup{
configs.gopls.setup{
on_attach = on_attach,
capabilities = lsp_status.capabilities,
settings = {
gopls = {
usePlaceholders = true,
codelens = {
codelenses = {
upgrade_dependency = true,
test = true
}
},
experimentalWorkspaceModule = true
}
}
}

nvim_lsp.jsonls.setup{
configs.jsonls.setup{
on_attach = on_attach,
capabilities = lsp_status.capabilities,
}

vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(
vim.lsp.diagnostic.on_publish_diagnostics, {
signs = true,
update_in_insert = false,
}
)

EOF

" Treesitter highligting
Expand Down

0 comments on commit 353062a

Please sign in to comment.