tokyonight theme, highlights/injections
This commit is contained in:
+6
-6
@@ -74,12 +74,12 @@ silent_map("i", "<Home>", "<C-o>g<Home>")
|
||||
silent_map("i", "<End>", "<C-o>g<End>")
|
||||
|
||||
-- half page movement
|
||||
silent_map("n", "<PageDown>", "<C-d>zz")
|
||||
silent_map("n", "<PageUp>", "<C-u>zz")
|
||||
silent_map("v", "<PageDown>", "<C-d>zz")
|
||||
silent_map("v", "<PageUp>", "<C-u>zz")
|
||||
silent_map("i", "<PageDown>", "<C-o><C-d><C-o>zz")
|
||||
silent_map("i", "<PageUp>", "<C-o><C-u><C-o>zz")
|
||||
silent_map("n", "<PageDown>", "M<C-d>")
|
||||
silent_map("n", "<PageUp>", "M<C-u>")
|
||||
silent_map("v", "<PageDown>", "M<C-d>")
|
||||
silent_map("v", "<PageUp>", "M<C-u>")
|
||||
silent_map("i", "<PageDown>", "<C-o>M<C-o><C-d>")
|
||||
silent_map("i", "<PageUp>", "<C-o>M<C-o><C-u>")
|
||||
|
||||
-- dynamic tab
|
||||
silent_map("n", "<Tab>", ":lua require('dynamic_tab').tab()<CR>")
|
||||
|
||||
+18
-7
@@ -119,7 +119,8 @@ function M.lualine()
|
||||
end
|
||||
|
||||
require("lualine").setup({
|
||||
options = { theme = "onedark", icons_enabled = true },
|
||||
--options = { theme = "onedark", icons_enabled = true },
|
||||
options = { theme = "tokyonight", icons_enabled = true },
|
||||
sections = {
|
||||
lualine_a = { "mode" },
|
||||
lualine_b = {
|
||||
@@ -183,7 +184,7 @@ function M.nvim_treesitter()
|
||||
javascript = true,
|
||||
cpp = true,
|
||||
}
|
||||
local rainbow_disable = vim.tbl_extend("force", highlight_disable, { svelte = true, html = true })
|
||||
local rainbow_disable = vim.tbl_extend("force", highlight_disable, { svelte = true, html = true, query = true })
|
||||
|
||||
local too_many_lines = function(bufnr)
|
||||
return vim.api.nvim_buf_line_count(bufnr) > 5000
|
||||
@@ -191,11 +192,13 @@ function M.nvim_treesitter()
|
||||
|
||||
require("nvim-treesitter.configs").setup({
|
||||
ensure_installed = "all",
|
||||
ignore_install = { "html" },
|
||||
highlight = {
|
||||
enable = true,
|
||||
disable = function(lang, bufnr)
|
||||
return highlight_disable[lang] or too_many_lines(bufnr)
|
||||
end,
|
||||
additional_vim_regex_highlighting = { "htmldjango", "html" },
|
||||
},
|
||||
rainbow = {
|
||||
enable = true,
|
||||
@@ -207,6 +210,9 @@ function M.nvim_treesitter()
|
||||
--colors = {}, -- table of hex strings
|
||||
--termcolors = {},
|
||||
},
|
||||
indent = {
|
||||
enable = false,
|
||||
}
|
||||
})
|
||||
|
||||
local version = vim.version()
|
||||
@@ -218,14 +224,14 @@ function M.nvim_treesitter()
|
||||
local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
|
||||
parser_config.htmldjango = {
|
||||
install_info = {
|
||||
url = "~/code/treesitter/tree-sitter-htmldjango", -- local path or git repo
|
||||
url = "/home/guy/code/treesitter/tree-sitter-htmldjango-myown", -- local path or git repo
|
||||
files = { "src/parser.c" },
|
||||
-- optional entries:
|
||||
branch = "main", -- default branch in case of git repo if different from master
|
||||
generate_requires_npm = false, -- if stand-alone parser without npm dependencies
|
||||
requires_generate_from_grammar = false, -- if folder contains pre-generated src/parser.c
|
||||
--branch = "main", -- default branch in case of git repo if different from master
|
||||
--generate_requires_npm = false, -- if stand-alone parser without npm dependencies
|
||||
requires_generate_from_grammar = true, -- if folder contains pre-generated src/parser.c
|
||||
},
|
||||
filetype = "htmldjango", -- if filetype does not match the parser name
|
||||
filetype = "html", -- if filetype does not match the parser name
|
||||
}
|
||||
end
|
||||
|
||||
@@ -436,4 +442,9 @@ function M.nvim_cmp()
|
||||
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done({ map_char = { tex = "" } }))
|
||||
end
|
||||
|
||||
function M.tokyonight()
|
||||
require("tokyonight").setup()
|
||||
vim.cmd([[colorscheme tokyonight-night]])
|
||||
end
|
||||
|
||||
return M
|
||||
|
||||
@@ -17,5 +17,6 @@ config.nvim_fzf()
|
||||
config.nvim_lsp_installer()
|
||||
config.nvim_lspconfig()
|
||||
config.nvim_treesitter()
|
||||
config.onedark()
|
||||
--config.onedark()
|
||||
config.rnvimr()
|
||||
config.tokyonight()
|
||||
|
||||
@@ -5,7 +5,8 @@ require("packer").startup(function(use)
|
||||
use("phaazon/hop.nvim")
|
||||
|
||||
-- VIM THEMING
|
||||
use("navarasu/onedark.nvim")
|
||||
--use("navarasu/onedark.nvim")
|
||||
use("folke/tokyonight.nvim")
|
||||
|
||||
-- FILE MANAGEMENT
|
||||
use("junegunn/fzf")
|
||||
|
||||
+79
-41
@@ -1,13 +1,12 @@
|
||||
; inherits: html
|
||||
|
||||
(attribute_name) @keyword
|
||||
|
||||
[
|
||||
"<"
|
||||
">"
|
||||
"</"
|
||||
"/>"
|
||||
] @punctuation.bracket
|
||||
;[
|
||||
; "<"
|
||||
; ">"
|
||||
; "</"
|
||||
; "/>"
|
||||
;] @punctuation.bracket
|
||||
|
||||
(doctype) @comment
|
||||
|
||||
@@ -15,41 +14,80 @@
|
||||
|
||||
((tag_name) @comment (#eq? @comment "html"))
|
||||
|
||||
(element
|
||||
(start_tag
|
||||
((tag_name) @function)
|
||||
(attribute (attribute_name) @_alpine))
|
||||
;(element (start_tag ((tag_name) @function) (#eq? @function "template")))
|
||||
;(element (end_tag ((tag_name) @function) (#eq? @function "template")))
|
||||
|
||||
;(attribute_name) @constant
|
||||
|
||||
;(element
|
||||
; (start_tag
|
||||
; ((tag_name) @function)
|
||||
; (attribute (attribute_name) @_alpine))
|
||||
; (#lua-match? @_alpine "^[@:]%l+.-$"))
|
||||
;
|
||||
;(element
|
||||
; (start_tag
|
||||
; (attribute (attribute_name) @_alpine))
|
||||
; (end_tag ((tag_name) @function))
|
||||
; (#lua-match? @_alpine "^[@:]%l+.-$"))
|
||||
;
|
||||
;(element
|
||||
; (start_tag
|
||||
; ((tag_name) @function)
|
||||
; (attribute (attribute_name) @_alpine))
|
||||
; (#lua-match? @_alpine "^x[-]%l+$"))
|
||||
;
|
||||
;(element
|
||||
; (start_tag
|
||||
; (attribute (attribute_name) @_alpine))
|
||||
; (end_tag ((tag_name) @function))
|
||||
; (#lua-match? @_alpine "^x[-]%l+$"))
|
||||
;
|
||||
;(element
|
||||
; (self_closing_tag
|
||||
; ((tag_name) @function)
|
||||
; (attribute (attribute_name) @_alpine))
|
||||
; (#lua-match? @_alpine "^[@:]%l+.-$"))
|
||||
;
|
||||
;(element
|
||||
; (self_closing_tag
|
||||
; ((tag_name) @function)
|
||||
; (attribute (attribute_name) @_alpine))
|
||||
; (#lua-match? @_alpine "^x[-]%l+$"))
|
||||
;
|
||||
;(element
|
||||
; (start_tag
|
||||
; (attribute (attribute_name) @parameter))
|
||||
; (#lua-match? @parameter "^[@:]%l+.-$"))
|
||||
;
|
||||
;(element
|
||||
; (start_tag
|
||||
; (attribute (attribute_name) @parameter))
|
||||
; (#lua-match? @parameter "^x[-]%l+$"))
|
||||
;
|
||||
;(element
|
||||
; (self_closing_tag
|
||||
; (attribute (attribute_name) @parameter))
|
||||
; (#lua-match? @parameter "^[@:]%l+.-$"))
|
||||
;
|
||||
;(element
|
||||
; (self_closing_tag
|
||||
; (attribute (attribute_name) @parameter))
|
||||
; (#lua-match? @parameter "^x[-]%l+$"))
|
||||
|
||||
((attribute_name) @parameter
|
||||
(#lua-match? @parameter "^x[-]%l+$"))
|
||||
|
||||
((attribute_name) @parameter
|
||||
(#lua-match? @parameter "^[@:]%l+.-$"))
|
||||
|
||||
((attribute
|
||||
(attribute_name) @_alpine
|
||||
(quoted_attribute_value (attribute_value) @operator))
|
||||
(#lua-match? @_alpine "^[@:]%l+.-$"))
|
||||
|
||||
(element
|
||||
(start_tag
|
||||
(attribute (attribute_name) @_alpine))
|
||||
(end_tag ((tag_name) @function))
|
||||
(#lua-match? @_alpine "^[@:]%l+.-$"))
|
||||
|
||||
(element
|
||||
(start_tag
|
||||
((tag_name) @function)
|
||||
(attribute (attribute_name) @_alpine))
|
||||
((attribute
|
||||
(attribute_name) @_alpine
|
||||
(quoted_attribute_value (attribute_value) @operator))
|
||||
(#lua-match? @_alpine "^x[-]%l+$"))
|
||||
|
||||
(element
|
||||
(start_tag
|
||||
(attribute (attribute_name) @_alpine))
|
||||
(end_tag ((tag_name) @function))
|
||||
(#lua-match? @_alpine "^x[-]%l+$"))
|
||||
|
||||
(element
|
||||
(self_closing_tag
|
||||
((tag_name) @function)
|
||||
(attribute (attribute_name) @_alpine))
|
||||
(#lua-match? @_alpine "^[@:]%l+.-$"))
|
||||
|
||||
(element
|
||||
(self_closing_tag
|
||||
((tag_name) @function)
|
||||
(attribute (attribute_name) @_alpine))
|
||||
(#lua-match? @_alpine "^x[-]%l+$"))
|
||||
|
||||
(element (start_tag ((tag_name) @function) (#eq? @function "template")))
|
||||
(element (end_tag ((tag_name) @function) (#eq? @function "template")))
|
||||
|
||||
@@ -11,11 +11,11 @@
|
||||
(script_element
|
||||
(raw_text) @javascript)
|
||||
|
||||
((text) @python (#lua-match? @python "^{%p%s+%l+%s+.-%s+%p}$"))
|
||||
((text) @htmldjango (#lua-match? @htmldjango "^{%p%s+%l+.-%s+%p}$"))
|
||||
|
||||
((text) @python (#lua-match? @python "^{{%s+.-%s+}}$"))
|
||||
((text) @htmldjango (#lua-match? @htmldjango "^{{%s+.-%s+}}$"))
|
||||
|
||||
((attribute
|
||||
(attribute_name) @_hyperscript
|
||||
(quoted_attribute_value (attribute_value) @python))
|
||||
(#eq? @_hyperscript "_"))
|
||||
(quoted_attribute_value (attribute_value) @htmldjango))
|
||||
(#lua-match? @htmldjango "^{{%s+.-%s+}}$"))
|
||||
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
[
|
||||
"|"
|
||||
":"
|
||||
] @punctuation
|
||||
|
||||
[
|
||||
"{%"
|
||||
"%}"
|
||||
"{{"
|
||||
"}}"
|
||||
] @comment
|
||||
|
||||
(string) @string
|
||||
|
||||
(integer) @number
|
||||
(float) @float
|
||||
|
||||
(true) @boolean
|
||||
(false) @boolean
|
||||
(none) @boolean
|
||||
|
||||
(identifier) @variable
|
||||
(attribute object: (primary_expression) @variable)
|
||||
(attribute attribute: (identifier) @property)
|
||||
|
||||
(tag_statement tag_name: (identifier) @keyword)
|
||||
|
||||
(tag_statement tag_argument:
|
||||
(keyword_argument keyword_name:
|
||||
((identifier) @parameter)))
|
||||
|
||||
(filter filter_name: ((identifier) @function))
|
||||
|
||||
[
|
||||
"for"
|
||||
"if"
|
||||
"not"
|
||||
"in"
|
||||
"and"
|
||||
"is"
|
||||
"as"
|
||||
] @keyword
|
||||
Reference in New Issue
Block a user