General updates
This commit is contained in:
parent
410498b2c1
commit
91f122bcd1
5 changed files with 19 additions and 10 deletions
|
|
@ -2,14 +2,14 @@ local lspconfig = require "lspconfig"
|
|||
lspconfig.gopls.setup {
|
||||
on_attach = function(client, bufnr)
|
||||
require "lsp_signature".on_attach({
|
||||
bind = false,
|
||||
bind = true,
|
||||
-- floating_window = true,
|
||||
--hint_enable = true,
|
||||
fix_pos = true,
|
||||
use_lspsaga = true,
|
||||
--handler_opts = {
|
||||
-- border = "single" -- double, single, shadow, none
|
||||
--},
|
||||
handler_opts = {
|
||||
border = "rounded" -- double, single, shadow, none
|
||||
},
|
||||
})
|
||||
end,
|
||||
cmd = {"gopls", "serve"},
|
||||
|
|
@ -27,8 +27,6 @@ lspconfig.gopls.setup {
|
|||
init_options = {usePlaceholders = true, completeUnimported = true},
|
||||
}
|
||||
|
||||
local saga = require 'lspsaga'
|
||||
saga.init_lsp_saga()
|
||||
|
||||
------ Configre vim-go
|
||||
-- Disable autocomplete since we already have it with native lsp.
|
||||
|
|
|
|||
|
|
@ -1,7 +1,14 @@
|
|||
local lsp = vim.lsp
|
||||
local handlers = lsp.handlers
|
||||
|
||||
-- Hover doc popup
|
||||
local pop_opts = { border = "rounded", max_width = 80 }
|
||||
handlers["textDocument/hover"] = lsp.with(handlers.hover, pop_opts)
|
||||
handlers["textDocument/signatureHelp"] = lsp.with(handlers.signature_help, pop_opts)
|
||||
|
||||
vim.api.nvim_set_keymap('n', '<Leader>lgd', '<cmd>lua vim.lsp.buf.definition()<CR>', {noremap = true, silent = true})
|
||||
vim.api.nvim_set_keymap('n', '<Leader>lgD', '<cmd>lua vim.lsp.buf.declaration()<CR>', {noremap = true, silent = true})
|
||||
vim.api.nvim_set_keymap('n', '<Leader>lgr', '<cmd>lua vim.lsp.buf.references()<CR>', {noremap = true, silent = true})
|
||||
vim.api.nvim_set_keymap('n', '<Leader>lgi', '<cmd>lua vim.lsp.buf.implementation()<CR>', {noremap = true, silent = true})
|
||||
vim.api.nvim_set_keymap('n', '<Leader>lr', '<cmd>lua require("lspsaga.rename").rename()<CR>', {noremap = true, silent = true})
|
||||
|
||||
vim.cmd('nnoremap <silent> K <cmd>lua require("lspsaga.hover").render_hover_doc()<CR>')
|
||||
vim.api.nvim_set_keymap('n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>', {noremap = true, silent = true})
|
||||
|
|
|
|||
|
|
@ -3,5 +3,5 @@ require'lspconfig'.pyright.setup{
|
|||
}
|
||||
|
||||
-- Autoformat on save.
|
||||
vim.cmd("autocmd BufWritePre *.py call Black()")
|
||||
vim.cmd("autocmd BufWritePre *.py execute ':Black'")
|
||||
|
||||
|
|
|
|||
|
|
@ -56,7 +56,10 @@ return require('packer').startup(function(use)
|
|||
use 'fatih/vim-go'
|
||||
|
||||
-- Pyhton
|
||||
use 'a-vrma/black-nvim'
|
||||
-- use 'a-vrma/black-nvim'
|
||||
use {
|
||||
'psf/black', branch = "stable"
|
||||
}
|
||||
|
||||
-- Comments
|
||||
use 'tpope/vim-commentary'
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ vim.o.timeoutlen = 500 -- By default timeoutlen is 1000 ms
|
|||
|
||||
vim.cmd(":set number relativenumber")
|
||||
vim.cmd("highlight ColorColumn ctermbg=0 guibg=grey")
|
||||
|
||||
------ Folding
|
||||
-- vim.o.foldlevel = 99
|
||||
-- Persist folds.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue