vim-lsp-settingsI am managing LSP using.
LspDocumentFormatI want to run jq with, so
~/.vimrcI wrote in.
augroup jsonSettings autocmd! autocmd BufNewFile, BufRead * .json setlocal equalprg = jq \ -M \ "." autocmd BufWritePre * .json LspDocumentFormat augroup END
In this state
test.jsonOpen with vim
: wWill not format even if you do.
If i make a similar description in Python, it will be formatted.
augroup pythonSettings autocmd! autocmd BufNewFile, BufRead * .py setlocal colorcolumn = 88 tabstop = 4 softtabstop = 4 shiftwidth = 4 equalprg = yapf \ 2>/dev/null autocmd BufWritePre * .py LspDocumentFormat augroup END
Document formatting not supported for json
Is output, but how do you think it will work?
Thanks for your professor.
Answer # 1
jq itself is a simple CLI program and has nothing to do with lsp, so it seems that the expected behavior is not achieved even with the description settings.
This is miso, but I made the following settings with my own plug-in. (Use a tool called efm-langserver to handle the input and output of cli programs well with lsp)
I think that if you set the same setting to the efm-lang server that you put in vim-lsp-setting, it will work as expected.
jq-format:&jq-format format-command:'jq.' format-stdin: true
json: -<<: * jq-format
- convert json format data acquired using axios with vue-cli from utc to jst
- ruby on rails - [rails] i want to pass json from controller to html (erb)
- i want to convert json in python
- json - format is effective when saving jsx with react, line breaks are not reflected
- python 3x - i want to format the file
- php - i want to post data using curl
- linux - i want to generate json from a list
- i want to change the display format of date by using regular expression in python
- vba - i want to save in xls format
- i want to send json data with mosquitto_pub
- i want to output in [h]: mm format using phpspreadsheet
- i want to download a file from a bucket using a uri in c # with a format starting with s3: //
- jquery - i want to rewrite it to json embedded code, but i don't know
- i want to run a python file using git on ec2
- typescript - i want to apply css using scss in nuxt