move old nvim config
This commit is contained in:
parent
c9ae53e233
commit
e7740e9989
27 changed files with 492 additions and 704 deletions
|
|
@ -27,35 +27,7 @@ vim.lsp.config('*', {
|
|||
flags = { debounce_text_changes = 0 },
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd('LspAttach', {
|
||||
callback = function(opts)
|
||||
local client = vim.lsp.get_client_by_id(opts.data.client_id)
|
||||
|
||||
if
|
||||
client
|
||||
and (
|
||||
client:supports_method('textDocument/formatting')
|
||||
or client:supports_method('formatting')
|
||||
)
|
||||
then
|
||||
local modes = { 'n' }
|
||||
|
||||
if
|
||||
client:supports_method('textDocument/rangeFormatting')
|
||||
or client:supports_method('rangeFormatting')
|
||||
then
|
||||
table.insert(modes, 'x')
|
||||
end
|
||||
|
||||
bmap({
|
||||
modes,
|
||||
'gF',
|
||||
lsp.format,
|
||||
}, { buffer = opts.buf, silent = false })
|
||||
end
|
||||
end,
|
||||
group = vim.api.nvim_create_augroup('ALspFormat', { clear = true }),
|
||||
})
|
||||
map({ { 'n', 'x' }, 'gF', lsp.format })
|
||||
|
||||
for _, server in ipairs({
|
||||
'bashls',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue