nvim
This commit is contained in:
parent
7a68bbae2a
commit
9db09eae81
6 changed files with 21 additions and 308 deletions
|
@ -80,7 +80,7 @@ local server_configs = function()
|
|||
schemas = vim.tbl_extend('force',
|
||||
require('schemastore').yaml.schemas(),
|
||||
{
|
||||
kubernetes = {'k8s/*.yaml', 'k8s/*/*.yaml', 'kubernetes/*.yaml', },
|
||||
kubernetes = {'k8s/*.yaml', '**/k8s/**/*.yaml', 'kubernetes/*.yaml', },
|
||||
}),
|
||||
},
|
||||
},
|
||||
|
|
|
@ -182,7 +182,7 @@ function M.config()
|
|||
filesystem = {
|
||||
filtered_items = {
|
||||
visible = true, -- when true, they will just be displayed differently than normal items
|
||||
hide_dotfiles = true,
|
||||
hide_dotfiles = false,
|
||||
hide_gitignored = true,
|
||||
hide_hidden = true, -- only works on Windows for hidden files/directories
|
||||
hide_by_name = {
|
||||
|
|
|
@ -3,9 +3,20 @@ local M = {
|
|||
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||
}
|
||||
|
||||
local ensure = {
|
||||
'hadolint',
|
||||
}
|
||||
|
||||
function M.config()
|
||||
local nls = require 'null-ls'
|
||||
|
||||
for _, pkg in pairs(ensure) do
|
||||
local p = require('mason-registry').get_package(pkg)
|
||||
if not p:is_installed() then
|
||||
p:install()
|
||||
end
|
||||
end
|
||||
|
||||
nls.setup({
|
||||
debug = false,
|
||||
temp_dir = vim.env.XDG_RUNTIME_DIR or '/tmp',
|
||||
|
@ -16,16 +27,13 @@ function M.config()
|
|||
-- nls.builtins.formatting.sqlfluff.with({
|
||||
-- extra_args = { '--dialect', 'mysql' },
|
||||
-- }),
|
||||
-- nls.builtins.diagnostics.sqlfluff.with({
|
||||
-- extra_args = { '--dialect', 'mysql' },
|
||||
-- }),
|
||||
nls.builtins.diagnostics.phpstan.with({
|
||||
cwd = function(params)
|
||||
-- falls back to root if return value is nil
|
||||
return params.root:match('jopixel') and not params.root:match('repo') and 'www';
|
||||
end,
|
||||
}),
|
||||
nls.builtins.formatting.phpcsfixer.with({
|
||||
nls.builtins.formatting.phpcsfixer.with({ ---{{{
|
||||
extra_args = {
|
||||
'--rules',
|
||||
[[{
|
||||
|
@ -59,8 +67,9 @@ function M.config()
|
|||
}
|
||||
}]],
|
||||
},
|
||||
}),
|
||||
}), -- }}}
|
||||
nls.builtins.diagnostics.shellcheck,
|
||||
nls.builtins.diagnostics.hadolint,
|
||||
nls.builtins.formatting.eslint,
|
||||
-- nls.builtins.diagnostics.eslint,
|
||||
nls.builtins.code_actions.eslint,
|
||||
|
|
|
@ -17,7 +17,7 @@ local M = {
|
|||
{ '<Space>Tg', [[<Cmd>Telescope grep_string<CR>]], desc = 'Telescope grep string' },
|
||||
{ '<Space>Td', [[<Cmd>Telescope diagnostics<CR>]], desc = 'Telescope workspace diagnostics' },
|
||||
{ '<Space>Tj', [[<Cmd>Telescope jumplist<CR>]], desc = 'Telescope jumplist' },
|
||||
{ '<Space>Th', [[<Cmd>Telescope help_tags<CR>]], desc = 'Telescope help' },
|
||||
{ '<Space>Th', [[<Cmd>Telescope help_tags<CR>]], desc = 'Telescope help' },
|
||||
{ '<Space>TT', [[<Cmd>Telescope resume<CR>]], desc = 'Telescope resume' },
|
||||
},
|
||||
}
|
||||
|
@ -56,6 +56,9 @@ function M.config()
|
|||
},
|
||||
},
|
||||
},
|
||||
find_files = {
|
||||
hidden = true,
|
||||
},
|
||||
live_grep = {
|
||||
mappings = {
|
||||
i = {
|
||||
|
|
|
@ -1,294 +1,6 @@
|
|||
; Variables
|
||||
|
||||
(variable_name) @variable
|
||||
|
||||
; Types
|
||||
|
||||
[
|
||||
(primitive_type)
|
||||
(cast_type)
|
||||
] @type.builtin
|
||||
(named_type (name)) @type
|
||||
(named_type (qualified_name)) @type
|
||||
(class_declaration
|
||||
name: (name) @type)
|
||||
(base_clause
|
||||
[(name) (qualified_name)] @type)
|
||||
(enum_declaration
|
||||
name: (name) @type)
|
||||
(interface_declaration
|
||||
name: (name) @type)
|
||||
(namespace_use_clause
|
||||
[(name) (qualified_name)] @type)
|
||||
(namespace_aliasing_clause (name)) @type.definition
|
||||
(class_interface_clause
|
||||
[(name) (qualified_name)] @type)
|
||||
(scoped_call_expression
|
||||
scope: [(name) (qualified_name)] @type)
|
||||
(class_constant_access_expression
|
||||
(relative_scope)
|
||||
(name) @constant)
|
||||
(trait_declaration
|
||||
name: (name) @type)
|
||||
(use_declaration
|
||||
(name) @type)
|
||||
(relative_scope) @type
|
||||
|
||||
|
||||
; Functions, methods, constructors
|
||||
|
||||
(array_creation_expression "array" @function.builtin)
|
||||
(list_literal "list" @function.builtin)
|
||||
|
||||
(method_declaration
|
||||
name: (name) @method)
|
||||
|
||||
(function_call_expression
|
||||
function: (qualified_name (name)) @function.call)
|
||||
|
||||
(function_call_expression
|
||||
(name) @function.call)
|
||||
|
||||
(scoped_call_expression
|
||||
name: (name) @function.call)
|
||||
|
||||
(member_call_expression
|
||||
name: (name) @method.call)
|
||||
|
||||
(function_definition
|
||||
name: (name) @function)
|
||||
|
||||
(nullsafe_member_call_expression
|
||||
name: (name) @method)
|
||||
|
||||
(method_declaration
|
||||
name: (name) @constructor
|
||||
(#eq? @constructor "__construct"))
|
||||
(object_creation_expression
|
||||
[(name) (qualified_name)] @constructor)
|
||||
|
||||
; Parameters
|
||||
[
|
||||
(simple_parameter)
|
||||
(variadic_parameter)
|
||||
] @parameter
|
||||
|
||||
(argument
|
||||
(name) @parameter)
|
||||
|
||||
; Member
|
||||
|
||||
(property_element
|
||||
(variable_name) @property)
|
||||
|
||||
(member_access_expression
|
||||
name: (variable_name (name)) @property)
|
||||
|
||||
(member_access_expression
|
||||
name: (name) @property)
|
||||
|
||||
; Variables
|
||||
|
||||
((name) @constant
|
||||
(#vim-match? @constant "^_?[A-Z][A-Z\d_]*$"))
|
||||
((name) @constant.builtin
|
||||
(#vim-match? @constant.builtin "^__[A-Z][A-Z\d_]+__$"))
|
||||
|
||||
(const_declaration (const_element (name) @constant))
|
||||
|
||||
((variable_name) @variable.builtin
|
||||
(#eq? @variable.builtin "$this"))
|
||||
|
||||
; Namespace
|
||||
(namespace_definition
|
||||
name: (namespace_name) @namespace)
|
||||
|
||||
; Attributes
|
||||
(attribute_list) @attribute
|
||||
|
||||
; Conditions ( ? : )
|
||||
(conditional_expression) @conditional
|
||||
; Basic tokens
|
||||
|
||||
[
|
||||
(string)
|
||||
(encapsed_string)
|
||||
(heredoc_body)
|
||||
(nowdoc_body)
|
||||
(shell_command_expression) ; backtick operator: `ls -la`
|
||||
] @string @spell
|
||||
(escape_sequence) @string.escape
|
||||
|
||||
(boolean) @boolean
|
||||
(null) @constant.builtin
|
||||
(integer) @number
|
||||
(float) @float
|
||||
(comment) @comment @spell
|
||||
|
||||
(named_label_statement) @label
|
||||
; Keywords
|
||||
|
||||
[
|
||||
"and"
|
||||
"as"
|
||||
"instanceof"
|
||||
"or"
|
||||
"xor"
|
||||
] @keyword.operator
|
||||
|
||||
[
|
||||
"fn"
|
||||
"function"
|
||||
] @keyword.function
|
||||
;; extends
|
||||
|
||||
[
|
||||
"$"
|
||||
"break"
|
||||
"class"
|
||||
"clone"
|
||||
"declare"
|
||||
"default"
|
||||
"echo"
|
||||
"enddeclare"
|
||||
"enum"
|
||||
"extends"
|
||||
"global"
|
||||
"goto"
|
||||
"implements"
|
||||
"insteadof"
|
||||
"interface"
|
||||
"namespace"
|
||||
"new"
|
||||
"trait"
|
||||
"unset"
|
||||
] @keyword
|
||||
|
||||
[
|
||||
"abstract"
|
||||
"const"
|
||||
"final"
|
||||
"private"
|
||||
"protected"
|
||||
"public"
|
||||
"readonly"
|
||||
"static"
|
||||
] @type.qualifier
|
||||
|
||||
[
|
||||
"return"
|
||||
"yield"
|
||||
] @keyword.return
|
||||
|
||||
[
|
||||
"case"
|
||||
"else"
|
||||
"elseif"
|
||||
"endif"
|
||||
"endswitch"
|
||||
"if"
|
||||
"switch"
|
||||
"match"
|
||||
"??"
|
||||
] @conditional
|
||||
|
||||
[
|
||||
"continue"
|
||||
"do"
|
||||
"endfor"
|
||||
"endforeach"
|
||||
"endwhile"
|
||||
"for"
|
||||
"foreach"
|
||||
"while"
|
||||
] @repeat
|
||||
|
||||
[
|
||||
"catch"
|
||||
"finally"
|
||||
"throw"
|
||||
"try"
|
||||
] @exception
|
||||
|
||||
[
|
||||
"include_once"
|
||||
"include"
|
||||
"require_once"
|
||||
"require"
|
||||
"use"
|
||||
] @include
|
||||
|
||||
[
|
||||
","
|
||||
";"
|
||||
] @punctuation.delimiter
|
||||
|
||||
[
|
||||
(php_tag)
|
||||
"?>"
|
||||
"("
|
||||
")"
|
||||
"["
|
||||
"]"
|
||||
"{"
|
||||
"}"
|
||||
"#["
|
||||
] @punctuation.bracket
|
||||
|
||||
[
|
||||
"="
|
||||
|
||||
"."
|
||||
"-"
|
||||
"*"
|
||||
"/"
|
||||
"+"
|
||||
"%"
|
||||
"**"
|
||||
|
||||
"~"
|
||||
"|"
|
||||
"^"
|
||||
"&"
|
||||
"<<"
|
||||
">>"
|
||||
|
||||
"->"
|
||||
"?->"
|
||||
|
||||
"=>"
|
||||
|
||||
"<"
|
||||
"<="
|
||||
">="
|
||||
">"
|
||||
"<>"
|
||||
"=="
|
||||
"!="
|
||||
"==="
|
||||
"!=="
|
||||
|
||||
"!"
|
||||
"&&"
|
||||
"||"
|
||||
|
||||
".="
|
||||
"-="
|
||||
"+="
|
||||
"*="
|
||||
"/="
|
||||
"%="
|
||||
"**="
|
||||
"&="
|
||||
"|="
|
||||
"^="
|
||||
"<<="
|
||||
">>="
|
||||
"??="
|
||||
"--"
|
||||
"++"
|
||||
|
||||
"@"
|
||||
"::"
|
||||
] @operator
|
||||
|
||||
(ERROR) @error
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
;; extends
|
||||
|
||||
(heredoc
|
||||
(heredoc_start) @_start
|
||||
(heredoc_body) @sql
|
||||
(#lua-match? @_start SQL))
|
||||
|
||||
(heredoc
|
||||
(heredoc_start) @_start
|
||||
(heredoc_body) @html
|
||||
(#lua-match? @_start HTML))
|
Loading…
Add table
Reference in a new issue