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>")
|
silent_map("i", "<End>", "<C-o>g<End>")
|
||||||
|
|
||||||
-- half page movement
|
-- half page movement
|
||||||
silent_map("n", "<PageDown>", "<C-d>zz")
|
silent_map("n", "<PageDown>", "M<C-d>")
|
||||||
silent_map("n", "<PageUp>", "<C-u>zz")
|
silent_map("n", "<PageUp>", "M<C-u>")
|
||||||
silent_map("v", "<PageDown>", "<C-d>zz")
|
silent_map("v", "<PageDown>", "M<C-d>")
|
||||||
silent_map("v", "<PageUp>", "<C-u>zz")
|
silent_map("v", "<PageUp>", "M<C-u>")
|
||||||
silent_map("i", "<PageDown>", "<C-o><C-d><C-o>zz")
|
silent_map("i", "<PageDown>", "<C-o>M<C-o><C-d>")
|
||||||
silent_map("i", "<PageUp>", "<C-o><C-u><C-o>zz")
|
silent_map("i", "<PageUp>", "<C-o>M<C-o><C-u>")
|
||||||
|
|
||||||
-- dynamic tab
|
-- dynamic tab
|
||||||
silent_map("n", "<Tab>", ":lua require('dynamic_tab').tab()<CR>")
|
silent_map("n", "<Tab>", ":lua require('dynamic_tab').tab()<CR>")
|
||||||
|
|||||||
+18
-7
@@ -119,7 +119,8 @@ function M.lualine()
|
|||||||
end
|
end
|
||||||
|
|
||||||
require("lualine").setup({
|
require("lualine").setup({
|
||||||
options = { theme = "onedark", icons_enabled = true },
|
--options = { theme = "onedark", icons_enabled = true },
|
||||||
|
options = { theme = "tokyonight", icons_enabled = true },
|
||||||
sections = {
|
sections = {
|
||||||
lualine_a = { "mode" },
|
lualine_a = { "mode" },
|
||||||
lualine_b = {
|
lualine_b = {
|
||||||
@@ -183,7 +184,7 @@ function M.nvim_treesitter()
|
|||||||
javascript = true,
|
javascript = true,
|
||||||
cpp = 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)
|
local too_many_lines = function(bufnr)
|
||||||
return vim.api.nvim_buf_line_count(bufnr) > 5000
|
return vim.api.nvim_buf_line_count(bufnr) > 5000
|
||||||
@@ -191,11 +192,13 @@ function M.nvim_treesitter()
|
|||||||
|
|
||||||
require("nvim-treesitter.configs").setup({
|
require("nvim-treesitter.configs").setup({
|
||||||
ensure_installed = "all",
|
ensure_installed = "all",
|
||||||
|
ignore_install = { "html" },
|
||||||
highlight = {
|
highlight = {
|
||||||
enable = true,
|
enable = true,
|
||||||
disable = function(lang, bufnr)
|
disable = function(lang, bufnr)
|
||||||
return highlight_disable[lang] or too_many_lines(bufnr)
|
return highlight_disable[lang] or too_many_lines(bufnr)
|
||||||
end,
|
end,
|
||||||
|
additional_vim_regex_highlighting = { "htmldjango", "html" },
|
||||||
},
|
},
|
||||||
rainbow = {
|
rainbow = {
|
||||||
enable = true,
|
enable = true,
|
||||||
@@ -207,6 +210,9 @@ function M.nvim_treesitter()
|
|||||||
--colors = {}, -- table of hex strings
|
--colors = {}, -- table of hex strings
|
||||||
--termcolors = {},
|
--termcolors = {},
|
||||||
},
|
},
|
||||||
|
indent = {
|
||||||
|
enable = false,
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
local version = vim.version()
|
local version = vim.version()
|
||||||
@@ -218,14 +224,14 @@ function M.nvim_treesitter()
|
|||||||
local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
|
local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
|
||||||
parser_config.htmldjango = {
|
parser_config.htmldjango = {
|
||||||
install_info = {
|
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" },
|
files = { "src/parser.c" },
|
||||||
-- optional entries:
|
-- optional entries:
|
||||||
branch = "main", -- default branch in case of git repo if different from master
|
--branch = "main", -- default branch in case of git repo if different from master
|
||||||
generate_requires_npm = false, -- if stand-alone parser without npm dependencies
|
--generate_requires_npm = false, -- if stand-alone parser without npm dependencies
|
||||||
requires_generate_from_grammar = false, -- if folder contains pre-generated src/parser.c
|
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
|
end
|
||||||
|
|
||||||
@@ -436,4 +442,9 @@ function M.nvim_cmp()
|
|||||||
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done({ map_char = { tex = "" } }))
|
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done({ map_char = { tex = "" } }))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function M.tokyonight()
|
||||||
|
require("tokyonight").setup()
|
||||||
|
vim.cmd([[colorscheme tokyonight-night]])
|
||||||
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|||||||
@@ -17,5 +17,6 @@ config.nvim_fzf()
|
|||||||
config.nvim_lsp_installer()
|
config.nvim_lsp_installer()
|
||||||
config.nvim_lspconfig()
|
config.nvim_lspconfig()
|
||||||
config.nvim_treesitter()
|
config.nvim_treesitter()
|
||||||
config.onedark()
|
--config.onedark()
|
||||||
config.rnvimr()
|
config.rnvimr()
|
||||||
|
config.tokyonight()
|
||||||
|
|||||||
@@ -5,7 +5,8 @@ require("packer").startup(function(use)
|
|||||||
use("phaazon/hop.nvim")
|
use("phaazon/hop.nvim")
|
||||||
|
|
||||||
-- VIM THEMING
|
-- VIM THEMING
|
||||||
use("navarasu/onedark.nvim")
|
--use("navarasu/onedark.nvim")
|
||||||
|
use("folke/tokyonight.nvim")
|
||||||
|
|
||||||
-- FILE MANAGEMENT
|
-- FILE MANAGEMENT
|
||||||
use("junegunn/fzf")
|
use("junegunn/fzf")
|
||||||
|
|||||||
+77
-39
@@ -1,13 +1,12 @@
|
|||||||
; inherits: html
|
; inherits: html
|
||||||
|
|
||||||
(attribute_name) @keyword
|
|
||||||
|
|
||||||
[
|
;[
|
||||||
"<"
|
; "<"
|
||||||
">"
|
; ">"
|
||||||
"</"
|
; "</"
|
||||||
"/>"
|
; "/>"
|
||||||
] @punctuation.bracket
|
;] @punctuation.bracket
|
||||||
|
|
||||||
(doctype) @comment
|
(doctype) @comment
|
||||||
|
|
||||||
@@ -15,41 +14,80 @@
|
|||||||
|
|
||||||
((tag_name) @comment (#eq? @comment "html"))
|
((tag_name) @comment (#eq? @comment "html"))
|
||||||
|
|
||||||
(element
|
;(element (start_tag ((tag_name) @function) (#eq? @function "template")))
|
||||||
(start_tag
|
;(element (end_tag ((tag_name) @function) (#eq? @function "template")))
|
||||||
((tag_name) @function)
|
|
||||||
(attribute (attribute_name) @_alpine))
|
|
||||||
(#lua-match? @_alpine "^[@:]%l+.-$"))
|
|
||||||
|
|
||||||
(element
|
;(attribute_name) @constant
|
||||||
(start_tag
|
|
||||||
(attribute (attribute_name) @_alpine))
|
|
||||||
(end_tag ((tag_name) @function))
|
|
||||||
(#lua-match? @_alpine "^[@:]%l+.-$"))
|
|
||||||
|
|
||||||
(element
|
;(element
|
||||||
(start_tag
|
; (start_tag
|
||||||
((tag_name) @function)
|
; ((tag_name) @function)
|
||||||
(attribute (attribute_name) @_alpine))
|
; (attribute (attribute_name) @_alpine))
|
||||||
(#lua-match? @_alpine "^x[-]%l+$"))
|
; (#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+$"))
|
||||||
|
|
||||||
(element
|
((attribute_name) @parameter
|
||||||
(start_tag
|
(#lua-match? @parameter "^x[-]%l+$"))
|
||||||
(attribute (attribute_name) @_alpine))
|
|
||||||
(end_tag ((tag_name) @function))
|
|
||||||
(#lua-match? @_alpine "^x[-]%l+$"))
|
|
||||||
|
|
||||||
(element
|
((attribute_name) @parameter
|
||||||
(self_closing_tag
|
(#lua-match? @parameter "^[@:]%l+.-$"))
|
||||||
((tag_name) @function)
|
|
||||||
(attribute (attribute_name) @_alpine))
|
|
||||||
(#lua-match? @_alpine "^[@:]%l+.-$"))
|
|
||||||
|
|
||||||
(element
|
((attribute
|
||||||
(self_closing_tag
|
(attribute_name) @_alpine
|
||||||
((tag_name) @function)
|
(quoted_attribute_value (attribute_value) @operator))
|
||||||
(attribute (attribute_name) @_alpine))
|
(#lua-match? @_alpine "^[@:]%l+.-$"))
|
||||||
(#lua-match? @_alpine "^x[-]%l+$"))
|
|
||||||
|
((attribute
|
||||||
|
(attribute_name) @_alpine
|
||||||
|
(quoted_attribute_value (attribute_value) @operator))
|
||||||
|
(#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
|
(script_element
|
||||||
(raw_text) @javascript)
|
(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
|
||||||
(attribute_name) @_hyperscript
|
(quoted_attribute_value (attribute_value) @htmldjango))
|
||||||
(quoted_attribute_value (attribute_value) @python))
|
(#lua-match? @htmldjango "^{{%s+.-%s+}}$"))
|
||||||
(#eq? @_hyperscript "_"))
|
|
||||||
|
|||||||
@@ -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