mirror of
https://github.com/kogakure/dotfiles.git
synced 2026-02-03 20:25:30 +00:00
fix(vim): problem with LSP and prettier
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
" lspconfig
|
||||
" https://github.com/neovim/nvim-lspconfig
|
||||
|
||||
" Mappings
|
||||
nnoremap <silent> <C-k> <cmd>lua vim.lsp.buf.signature_help()<CR>
|
||||
nnoremap <silent> <leader>D <cmd>lua vim.lsp.buf.type_definition()<CR>
|
||||
nnoremap <silent> <leader>e <cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>
|
||||
|
||||
@@ -61,18 +61,3 @@ lsp_installer.on_server_ready(function(server)
|
||||
|
||||
vim.cmd([[do User LspAttachBuffers]])
|
||||
end)
|
||||
|
||||
--- Global function to install servers automatically
|
||||
function _G.lsp_install_sync()
|
||||
local lsp_installer_servers = require("nvim-lsp-installer.servers")
|
||||
|
||||
local requested = {}
|
||||
for server_name, _ in pairs(servers) do
|
||||
local ok, server = lsp_installer_servers.get_server(server_name)
|
||||
if ok and not server:is_installed() then
|
||||
table.insert(requested, server_name)
|
||||
end
|
||||
end
|
||||
|
||||
lsp_installer.install_sync(requested)
|
||||
end
|
||||
|
||||
17
nvim/plugin-config/neoformat.vim
Normal file
17
nvim/plugin-config/neoformat.vim
Normal file
@@ -0,0 +1,17 @@
|
||||
" Neoformat
|
||||
" https://github.com/sbdchd/neoformat
|
||||
|
||||
" Settings
|
||||
let g:neoformat_try_node_exe = 1
|
||||
let g:neoformat_basic_format_align = 1 " Enable alignment
|
||||
let g:neoformat_basic_format_retab = 1 " Enable tab to spaces conversion
|
||||
let g:neoformat_basic_format_trim = 1 " Enable trimmming of trailing whitespace
|
||||
|
||||
" Mappings
|
||||
nnoremap <silent> nf <cmd>Neoformat<CR>
|
||||
|
||||
" Auto Commands
|
||||
augroup fmt
|
||||
autocmd!
|
||||
autocmd BufWritePre * undojoin | Neoformat
|
||||
augroup END
|
||||
Reference in New Issue
Block a user