[None-LS] Improve formatting for JS/TS/etc
This commit is contained in:
parent
b18160a61b
commit
67363070e3
@ -90,7 +90,7 @@ keymap.set("n", "<leader><leader>r", ":!%:p", opts("run current file with argume
|
||||
keymap.set("n", "<leader>m", ":!chmod +x %:p<CR>", opts("make current file executable"))
|
||||
|
||||
-- script setup
|
||||
keymap.set("n", "<leader>#", ":set syntax=sh<CR>:w<CR>:!chmod +x %:p<CR>:LspStart bashls<CR>i#!/bin/sh<CR><CR>", opts("setup sh script"))
|
||||
keymap.set("n", "<leader>#", ":w<CR>:!chmod +x %:p<CR>ggi#!/bin/sh<CR><CR><Esc>:setfiletype bash<CR>", opts("setup sh script"))
|
||||
keymap.set("n", "<leader><leader>#", ":set syntax=python<CR>:w<CR>:!chmod +x %:p<CR>:LspStart pyright<CR>i#!/usr/bin/env python3<CR><CR>", opts("setup python script"))
|
||||
|
||||
-- select all
|
||||
|
@ -1,5 +1,8 @@
|
||||
return {
|
||||
"nvimtools/none-ls.nvim",
|
||||
dependencies = {
|
||||
'nvimtools/none-ls-extras.nvim'
|
||||
},
|
||||
config = function()
|
||||
local null_ls = require("null-ls")
|
||||
|
||||
@ -7,31 +10,41 @@ return {
|
||||
sources = {
|
||||
null_ls.builtins.formatting.stylua,
|
||||
null_ls.builtins.formatting.prettier.with({
|
||||
filetypes = {
|
||||
"css",
|
||||
"scss",
|
||||
"less",
|
||||
"html",
|
||||
"json",
|
||||
"yaml",
|
||||
"markdown",
|
||||
"graphql",
|
||||
},
|
||||
extra_args = {
|
||||
"--print-width",
|
||||
"120",
|
||||
"--print-width",
|
||||
"120",
|
||||
"--tab-width",
|
||||
"4",
|
||||
"--bracket-spacing",
|
||||
"true",
|
||||
"--arrow-parens",
|
||||
"avoid",
|
||||
"--jsx-single-quote",
|
||||
"true",
|
||||
"--trailing-comma",
|
||||
"es5",
|
||||
"--no-semi",
|
||||
"false",
|
||||
"--single-quote",
|
||||
"true",
|
||||
"--bracket-same-line",
|
||||
"true",
|
||||
"--vue-indent-script-and-style",
|
||||
"true"
|
||||
"--jsx-single-quote",
|
||||
"true",
|
||||
"--trailing-comma",
|
||||
"es5",
|
||||
"--no-semi",
|
||||
"false",
|
||||
"--single-quote",
|
||||
"true",
|
||||
"--bracket-same-line",
|
||||
"true",
|
||||
"--vue-indent-script-and-style",
|
||||
"true",
|
||||
},
|
||||
}),
|
||||
null_ls.builtins.formatting.shfmt,
|
||||
null_ls.builtins.diagnostics.eslint,
|
||||
require( 'none-ls.formatting.eslint' ),
|
||||
null_ls.builtins.formatting.black,
|
||||
},
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user