commit 7c6c7db7acfc536bc3202aa7c7b8e219bef81911
parent 1e9faa333c721d110a6c99e8b487fddb37ae15b3
Author: Tomas Nemec <owl@gtms.dev>
Date: Mon, 13 Nov 2023 10:59:02 +0100
update
Diffstat:
3 files changed, 24 insertions(+), 8 deletions(-)
diff --git a/after/plugin/colorizer.lua b/after/plugin/colorizer.lua
@@ -1,6 +1,6 @@
if pcall(require, 'colorizer') then
require'colorizer'.setup({
- filetypes = { '*' },
+ filetypes = { 'css', 'scss', 'html' },
user_default_options = {
css = true, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB
sass = { enable = true }, -- Enable sass colors
diff --git a/after/plugin/ng_html.lua b/after/plugin/ng_html.lua
@@ -1,12 +1,12 @@
-- TODO(tms) 06.09.22: Handle single line template string
local template_query = vim.treesitter.query.parse('dart', [[
(annotation
- (arguments
- (named_argument
+ (arguments
+ (named_argument
(label (identifier) @_identifier)
(string_literal) @template
)
- )
+ )
(#eq? @_identifier "template")
(#offset! @template 0 3 0 -3)
)
@@ -23,7 +23,10 @@ local function prettier_html(text)
local result = table.concat(vim.list_slice(split, 2, #split - 1), '\n')
local job = require('plenary.job'):new{
command = 'prettier',
- args = { '--parser=html', '--tab-width=4' },
+ args = {
+ '--plugin=/home/tms/.local/share/npm/lib/node_modules/prettier-plugin-organize-attributes/lib/index.js',
+ '--parser=html',
+ },
writer = { result },
}
diff --git a/after/plugin/nulls.lua b/after/plugin/nulls.lua
@@ -31,7 +31,7 @@ null_ls.setup({
filetypes = { 'typescript' },
args = h.range_formatting_args_factory({
'--parser',
- vim.api.nvim_buf_get_option(0, 'filetype'),
+ vim.api.nvim_get_option_value('filetype', { scope = 'local' }),
'--trailing-comma',
'all',
'--tab-width',
@@ -41,10 +41,23 @@ null_ls.setup({
}, '--range-start', '--range-end'),
},
builtins.formatting.prettier.with {
- filetypes = { 'html', 'yaml', 'css', 'scss', 'markdown' },
+ filetypes = { 'html' },
args = h.range_formatting_args_factory({
'--parser',
- vim.api.nvim_buf_get_option(0, 'filetype'),
+ vim.api.nvim_get_option_value('filetype', { scope = 'local' }),
+ '--stdin-filepath',
+ '$FILENAME',
+ '--prose-wrap',
+ 'always',
+ '--plugin',
+ '/home/tms/.local/share/npm/lib/node_modules/prettier-plugin-organize-attributes/lib/index.js',
+ }, '--range-start', '--range-end'),
+ },
+ builtins.formatting.prettier.with {
+ filetypes = { 'yaml', 'css', 'scss', 'markdown' },
+ args = h.range_formatting_args_factory({
+ '--parser',
+ vim.api.nvim_get_option_value('filetype', { scope = 'local' }),
'--stdin-filepath',
'$FILENAME',
'--prose-wrap',