Tried lua lsp ecosystem, but it's confusing and frustrating... using equalprg for formatting now.
This commit is contained in:
parent
86063719de
commit
4b2b8dfdaa
|
|
@ -0,0 +1,6 @@
|
||||||
|
vim.bo.autoindent = true
|
||||||
|
vim.bo.expandtab = true
|
||||||
|
vim.bo.shiftwidth = 2
|
||||||
|
vim.bo.softtabstop = 2
|
||||||
|
vim.bo.tabstop = 2
|
||||||
|
vim.bo.textwidth = 120
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
vim.bo.autoindent = true
|
||||||
|
vim.bo.expandtab = true
|
||||||
|
vim.bo.shiftwidth = 2
|
||||||
|
vim.bo.softtabstop = 2
|
||||||
|
vim.bo.tabstop = 2
|
||||||
|
vim.bo.textwidth = 120
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
vim.bo.autoindent = true
|
||||||
|
vim.bo.expandtab = true
|
||||||
|
vim.bo.shiftwidth = 2
|
||||||
|
vim.bo.softtabstop = 2
|
||||||
|
vim.bo.tabstop = 2
|
||||||
|
vim.bo.textwidth = 120
|
||||||
|
|
@ -89,3 +89,20 @@ let g:neomake_virtualtext_current_error = 1
|
||||||
" autocmd!
|
" autocmd!
|
||||||
" autocmd BufWritePre * :call s:MkNonExDir(expand('<afile>'), +expand('<abuf>'))
|
" autocmd BufWritePre * :call s:MkNonExDir(expand('<afile>'), +expand('<abuf>'))
|
||||||
" augroup END
|
" augroup END
|
||||||
|
|
||||||
|
|
||||||
|
" Auto Format javascript files.
|
||||||
|
" requires: pip3 install --user jsbeautifier
|
||||||
|
autocmd FileType javascript setlocal equalprg=js-beautify\ --stdin
|
||||||
|
"autocmd FileType javascript BufWritePre :%!js-beautify
|
||||||
|
|
||||||
|
"lua <<EOF
|
||||||
|
"vim.api.nvim_create_augroup('AutoFormatting', {})
|
||||||
|
"vim.api.nvim_create_autocmd('BufWritePre', {
|
||||||
|
"pattern = '*.lua',
|
||||||
|
"group = 'AutoFormatting',
|
||||||
|
"callback = function()
|
||||||
|
"vim.lsp.buf.format({ async = true })
|
||||||
|
"end,
|
||||||
|
"})
|
||||||
|
"EOF
|
||||||
|
|
|
||||||
|
|
@ -238,9 +238,46 @@ Plug 'mkitt/tabline.vim'
|
||||||
|
|
||||||
Plug 'prisma/vim-prisma'
|
Plug 'prisma/vim-prisma'
|
||||||
|
|
||||||
|
"" LSP Support
|
||||||
|
"Plug 'neovim/nvim-lspconfig' " Required
|
||||||
|
"Plug 'williamboman/mason.nvim', {'do': ':MasonUpdate'} " Optional
|
||||||
|
"Plug 'williamboman/mason-lspconfig.nvim' " Optional
|
||||||
|
|
||||||
|
""" Autocompletion
|
||||||
|
""Plug 'hrsh7th/nvim-cmp' " Required
|
||||||
|
""Plug 'hrsh7th/cmp-nvim-lsp' " Required
|
||||||
|
""Plug 'L3MON4D3/LuaSnip' " Required
|
||||||
|
|
||||||
|
"Plug 'VonHeikemen/lsp-zero.nvim', {'branch': 'v2.x'}
|
||||||
|
|
||||||
|
"Plug 'lukas-reineke/lsp-format.nvim'
|
||||||
|
|
||||||
|
|
||||||
" Tell vim-plug we finished declaring plugins, so it can load them
|
" Tell vim-plug we finished declaring plugins, so it can load them
|
||||||
call plug#end()
|
call plug#end()
|
||||||
|
|
||||||
|
"lua <<EOF
|
||||||
|
"local lsp = require('lsp-zero').preset({})
|
||||||
|
|
||||||
|
"lsp.on_attach(function(client, bufnr)
|
||||||
|
"lsp.default_keymaps({buffer = bufnr})
|
||||||
|
"end)
|
||||||
|
|
||||||
|
"-- " (Optional) Configure lua language server for neovim
|
||||||
|
"require('lspconfig').lua_ls.setup(lsp.nvim_lua_ls())
|
||||||
|
|
||||||
|
"require("lsp-format").setup {}
|
||||||
|
|
||||||
|
"local on_attach = function(client)
|
||||||
|
"require("lsp-format").on_attach(client)
|
||||||
|
|
||||||
|
"-- ... custom code ...
|
||||||
|
"end
|
||||||
|
"require("lspconfig").gopls.setup { on_attach = on_attach }
|
||||||
|
|
||||||
|
"lsp.setup()
|
||||||
|
"EOF
|
||||||
|
|
||||||
" ============================================================================
|
" ============================================================================
|
||||||
" Install plugins the first time vim runs
|
" Install plugins the first time vim runs
|
||||||
if vim_plug_just_installed
|
if vim_plug_just_installed
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue