Skip to content

Commit

Permalink
vim: upgrade to #12655, delete diagnostic, delete completion
Browse files Browse the repository at this point in the history
  • Loading branch information
sentriz committed Nov 19, 2020
1 parent 6d4d5e9 commit 341cd9e
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 50 deletions.
6 changes: 0 additions & 6 deletions .gitmodules
Expand Up @@ -25,12 +25,6 @@
[submodule "conf_common/.local/share/nvim/site/pack/meta/opt/neovim/nvim-lsp"]
path = conf_common/.local/share/nvim/site/pack/meta/opt/neovim/nvim-lsp
url = https://github.com/neovim/nvim-lsp
[submodule "conf_common/.local/share/nvim/site/pack/meta/opt/nvim-lua/completion-nvim"]
path = conf_common/.local/share/nvim/site/pack/meta/opt/nvim-lua/completion-nvim
url = https://github.com/nvim-lua/completion-nvim
[submodule "conf_common/.local/share/nvim/site/pack/meta/opt/nvim-lua/diagnostic-nvim"]
path = conf_common/.local/share/nvim/site/pack/meta/opt/nvim-lua/diagnostic-nvim
url = https://github.com/nvim-lua/diagnostic-nvim
[submodule "conf_common/.local/share/nvim/site/pack/meta/opt/rhysd/committia.vim"]
path = conf_common/.local/share/nvim/site/pack/meta/opt/rhysd/committia.vim
url = https://github.com/rhysd/committia.vim
Expand Down
56 changes: 25 additions & 31 deletions conf_common/.config/nvim/conf_lang_server.vim
Expand Up @@ -8,11 +8,17 @@
" vue npm install -g typescript vls

lua <<EOF
local lsp = require "nvim_lsp"
local configs = require "nvim_lsp/configs"
local util = require "nvim_lsp/util"
local diagnostic = require "diagnostic"
local completion = require "completion"
vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(
vim.lsp.diagnostic.on_publish_diagnostics, {
virtual_text = false,
signs = true,
update_in_insert = false,
}
)

local lsp = require "lspconfig"
local configs = require "lspconfig/configs"
local util = require "lspconfig/util"

local sync_timeout = 150

Expand Down Expand Up @@ -206,33 +212,22 @@ configs.custom_java = {
}
}

local configs = {
lsp.custom_bash,
lsp.custom_clang,
lsp.custom_docker,
lsp.custom_go,
lsp.custom_python,
lsp.custom_typescript,
lsp.custom_vue,
lsp.custom_dart,
lsp.custom_java,
}

for i, config in pairs(configs) do
config.setup({
on_attach = function(client, buffer)
diagnostic.on_attach(client, buffer)
completion.on_attach(client, buffer)
end
})
end
lsp.custom_bash.setup({})
lsp.custom_clang.setup({})
lsp.custom_docker.setup({})
lsp.custom_go.setup({})
lsp.custom_python.setup({})
lsp.custom_typescript.setup({})
lsp.custom_vue.setup({})
lsp.custom_dart.setup({})
lsp.custom_java.setup({})
EOF

" lsp mappings
nnoremap <silent> gd <cmd>lua vim.lsp.buf.declaration()<cr>
nnoremap <silent> <c-]> <cmd>lua vim.lsp.buf.definition()<cr>
nnoremap <silent> K <cmd>lua vim.lsp.buf.hover()<cr>
nnoremap <silent> J <cmd>lua vim.lsp.util.show_line_diagnostics()<cr>
nnoremap <silent> J <cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<cr>
nnoremap <silent> gD <cmd>lua vim.lsp.buf.implementation()<cr>
nnoremap <silent> 1gD <cmd>lua vim.lsp.buf.type_definition()<cr>
nnoremap <silent> gr <cmd>lua vim.lsp.buf.references()<cr>
Expand All @@ -256,8 +251,7 @@ autocmd Filetype dart autocmd BufWritePre * silent! lua document_form
autocmd Filetype go autocmd BufWritePre * silent! lua document_format_and_organise_sync()
autocmd Filetype python autocmd BufWritePre * silent! lua document_format_and_organise_sync()

" the bar on the left symbols
call sign_define('LspDiagnosticsErrorSign', {'text': 'ee', 'texthl': 'LspDiagnosticsError'})
call sign_define('LspDiagnosticsWarningSign', {'text': 'ww', 'texthl': 'LspDiagnosticsWarning'})
call sign_define('LspDiagnosticsInformationSign', {'text': 'ii', 'texthl': 'LspDiagnosticsInformation'})
call sign_define('LspDiagnosticsHintSign', {'text': 'hh', 'texthl': 'LspDiagnosticsHint'})
sign define LspDiagnosticsSignError text=ee texthl=LspDiagnosticsSignError
sign define LspDiagnosticsSignWarning text=ww texthl=LspDiagnosticsSignWarning
sign define LspDiagnosticsSignInformation text=ii texthl=LspDiagnosticsSignInformation
sign define LspDiagnosticsSignHint text=hh texthl=LspDiagnosticsSignHint
10 changes: 0 additions & 10 deletions conf_common/.config/nvim/conf_plugins.vim
Expand Up @@ -5,14 +5,6 @@ let g:SpiffyFoldtext_format = "%c{ } ... }%f{ }"
let g:tmux_navigator_no_mappings = 1
let g:tmux_navigator_save_on_switch = 1

let g:diagnostic_enable_virtual_text = 0
let g:diagnostic_insert_delay = 1
let g:diagnostic_show_sign = 1

let g:completion_enable_auto_popup = 1
let g:completion_enable_auto_paren = 1
let g:completion_enable_auto_hover = 0

let g:monotone_color = [10, 3, 100]
let g:monotone_secondary_hue_offset = 0

Expand All @@ -25,8 +17,6 @@ packadd! christoomey/vim-tmux-navigator
packadd! inkarkat/SyntaxAttr.vim
packadd! machakann/vim-highlightedyank
packadd! neovim/nvim-lsp
packadd! nvim-lua/completion-nvim
packadd! nvim-lua/diagnostic-nvim
packadd! nvim-lua/popup.nvim
packadd! nvim-lua/plenary.nvim
packadd! nvim-lua/telescope.nvim
Expand Down
Submodule completion-nvim deleted from 857fb1
Submodule diagnostic-nvim deleted from bef1c6

0 comments on commit 341cd9e

Please sign in to comment.