Add italics variant to TS highlights
authorSlotos <slotos@gmail.com>
Sun, 9 Jan 2022 12:12:57 +0000 (14:12 +0200)
committerSlotos <slotos@gmail.com>
Sun, 9 Jan 2022 12:12:57 +0000 (14:12 +0200)
Also, tabularize everything in a way dictated by the
first block of asignments.

lua/nord/theme.lua

index b4c56de6a673458ca119b1198a1a51f271fc28c4..b3cc9101c1b461d74e099253319c5241e5f133dd 100644 (file)
@@ -36,38 +36,38 @@ theme.loadSyntax = function ()
     Conceal =        { fg = nord.none, bg = nord.nord0_gui },
 
 
-    htmlLink = { fg = nord.nord14_gui, style = "underline" },
-    htmlH1 =   { fg = nord.nord8_gui, style = "bold" },
-    htmlH2 =   { fg = nord.nord11_gui, style = "bold" },
-    htmlH3 =   { fg = nord.nord14_gui, style = "bold" },
-    htmlH4 =   { fg = nord.nord15_gui, style = "bold" },
-    htmlH5 =   { fg = nord.nord9_gui, style = "bold" },
-    markdownH1 = { fg = nord.nord8_gui, style = "bold" },
-    markdownH2 = { fg = nord.nord11_gui, style = "bold" },
-    markdownH3 = { fg = nord.nord14_gui, style = "bold" },
+    htmlLink =            { fg = nord.nord14_gui, style = "underline" },
+    htmlH1 =              { fg = nord.nord8_gui, style = "bold" },
+    htmlH2 =              { fg = nord.nord11_gui, style = "bold" },
+    htmlH3 =              { fg = nord.nord14_gui, style = "bold" },
+    htmlH4 =              { fg = nord.nord15_gui, style = "bold" },
+    htmlH5 =              { fg = nord.nord9_gui, style = "bold" },
+    markdownH1 =          { fg = nord.nord8_gui, style = "bold" },
+    markdownH2 =          { fg = nord.nord11_gui, style = "bold" },
+    markdownH3 =          { fg = nord.nord14_gui, style = "bold" },
     markdownH1Delimiter = { fg = nord.nord8_gui },
     markdownH2Delimiter = { fg = nord.nord11_gui },
     markdownH3Delimiter = { fg = nord.nord14_gui },
   }
 
-       -- Italic comments
-       if vim.g.nord_italic == true then
-               syntax.Conditional =            { fg = nord.nord9_gui, bg = nord.none, style = 'italic' } -- italic if, then, else, endif, switch, etc.
-               syntax.Keyword =                        { fg = nord.nord9_gui, bg = nord.none, style = 'italic' } -- italic for, do, while, etc.
-               syntax.Repeat =                         { fg = nord.nord9_gui, bg = nord.none, style = 'italic' } -- italic any other keyword
-               syntax.Comment =                { fg = nord.nord3_gui_bright, bg = nord.none, style = 'italic' } -- italic comments
-               syntax.Function =               { fg = nord.nord8_gui, bg = nord.none, style = 'italic' } -- italic funtion names
-               syntax.Identifier =             { fg = nord.nord9_gui, bg = nord.none, style = 'italic' }; -- any variable name
-    syntax.String = { fg = nord.nord14_gui, bg = nord.none, style= 'italic' } -- any string
-       else
-               syntax.Comment =                {fg = nord.nord3_gui_bright} -- normal comments
-               syntax.Conditional =            { fg = nord.nord9_gui } -- normal if, then, else, endif, switch, etc.
-               syntax.Keyword =                        { fg = nord.nord9_gui } -- normal for, do, while, etc.
-               syntax.Repeat =                         { fg = nord.nord9_gui } -- normal any other keyword
-               syntax.Function =               { fg = nord.nord8_gui} -- normal function names
-               syntax.Identifier =             { fg = nord.nord9_gui}; -- any variable name
-    syntax.String = { fg = nord.nord14_gui } -- any string
-       end
+    -- Italic comments
+  if vim.g.nord_italic == false then
+    syntax.Comment =     {fg = nord.nord3_gui_bright} -- normal comments
+    syntax.Conditional = { fg = nord.nord9_gui } -- normal if, then, else, endif, switch, etc.
+    syntax.Function =    { fg = nord.nord8_gui} -- normal function names
+    syntax.Identifier =  { fg = nord.nord9_gui}; -- any variable name
+    syntax.Keyword =     { fg = nord.nord9_gui } -- normal for, do, while, etc.
+    syntax.Repeat =      { fg = nord.nord9_gui } -- normal any other keyword
+    syntax.String =      { fg = nord.nord14_gui } -- any string
+  else
+    syntax.Comment =     { fg = nord.nord3_gui_bright, bg = nord.none, style = 'italic' } -- italic comments
+    syntax.Conditional = { fg = nord.nord9_gui, bg = nord.none, style = 'italic' } -- italic if, then, else, endif, switch, etc.
+    syntax.Function =    { fg = nord.nord8_gui, bg = nord.none, style = 'italic' } -- italic funtion names
+    syntax.Identifier =  { fg = nord.nord9_gui, bg = nord.none, style = 'italic' }; -- any variable name
+    syntax.Keyword =     { fg = nord.nord9_gui, bg = nord.none, style = 'italic' } -- italic for, do, while, etc.
+    syntax.Repeat =      { fg = nord.nord9_gui, bg = nord.none, style = 'italic' } -- italic any other keyword
+    syntax.String =      { fg = nord.nord14_gui, bg = nord.none, style= 'italic' } -- any string
+  end
 
   return syntax
 
@@ -199,7 +199,7 @@ theme.loadTreeSitter = function ()
   local treesitter = {
     TSAnnotation =        { fg = nord.nord12_gui },    -- For C++/Dart attributes, annotations thatcan be attached to the code to denote some kind of meta information.
     TSCharacter=          { fg = nord.nord14_gui },    -- For characters.
-    TSConstructor =       { fg = nord.nord9_gui }, -- For constructor calls and definitions: `=                                                                          { }` in Lua, and Java constructors.
+    TSConstructor =       { fg = nord.nord9_gui }, -- For constructor calls and definitions: `= { }` in Lua, and Java constructors.
     TSConstant =          { fg = nord.nord13_gui },    -- For constants
     TSFloat =             { fg = nord.nord15_gui },    -- For floats
     TSNumber =            { fg = nord.nord15_gui },    -- For all number
@@ -240,16 +240,29 @@ theme.loadTreeSitter = function ()
 
   }
 
-  treesitter.TSComment=          { fg = nord.nord3_gui_bright }
-  treesitter.TSConditional =     { fg = nord.nord9_gui }   -- For keywords related to conditionnals.
-  treesitter.TSKeyword =         { fg = nord.nord9_gui } -- For keywords that don't fall in previous categories.
-  treesitter.TSRepeat =          { fg = nord.nord9_gui }    -- For keywords related to loops.
-  treesitter.TSKeywordFunction = { fg = nord.nord8_gui }
-  treesitter.TSFunction =        { fg = nord.nord8_gui }    -- For fuction (calls and definitions).
-  treesitter.TSMethod =          { fg = nord.nord7_gui }    -- For method calls and definitions.
-  treesitter.TSFuncBuiltin =     { fg = nord.nord8_gui }
-  treesitter.TSVariable =        { fg = nord.nord4_gui }-- Any variable name that does not have another highlight.
-  treesitter.TSVariableBuiltin = { fg = nord.nord4_gui }
+  if vim.g.nord_italic == false then
+    treesitter.TSComment         = { fg = nord.nord3_gui_bright }
+    treesitter.TSConditional     = { fg = nord.nord9_gui }   -- For keywords related to conditionnals.
+    treesitter.TSKeyword         = { fg = nord.nord9_gui } -- For keywords that don't fall in previous categories.
+    treesitter.TSRepeat          = { fg = nord.nord9_gui }    -- For keywords related to loops.
+    treesitter.TSKeywordFunction = { fg = nord.nord8_gui }
+    treesitter.TSFunction        = { fg = nord.nord8_gui }    -- For fuction (calls and definitions).
+    treesitter.TSMethod          = { fg = nord.nord7_gui }    -- For method calls and definitions.
+    treesitter.TSFuncBuiltin     = { fg = nord.nord8_gui }
+    treesitter.TSVariable        = { fg = nord.nord4_gui }-- Any variable name that does not have another highlight.
+    treesitter.TSVariableBuiltin = { fg = nord.nord4_gui }
+  else
+    treesitter.TSComment         = { fg = nord.nord3_gui_bright, style = 'italic' }
+    treesitter.TSConditional     = { fg = nord.nord9_gui, style = 'italic' }   -- For keywords related to conditionnals.
+    treesitter.TSKeyword         = { fg = nord.nord9_gui, style = 'italic' } -- For keywords that don't fall in previous categories.
+    treesitter.TSRepeat          = { fg = nord.nord9_gui, style = 'italic' }    -- For keywords related to loops.
+    treesitter.TSKeywordFunction = { fg = nord.nord8_gui, style = 'italic' }
+    treesitter.TSFunction        = { fg = nord.nord8_gui, style = 'italic' }    -- For fuction (calls and definitions).
+    treesitter.TSMethod          = { fg = nord.nord7_gui, style = 'italic' }    -- For method calls and definitions.
+    treesitter.TSFuncBuiltin     = { fg = nord.nord8_gui, style = 'italic' }
+    treesitter.TSVariable        = { fg = nord.nord4_gui, style = 'italic' }-- Any variable name that does not have another highlight.
+    treesitter.TSVariableBuiltin = { fg = nord.nord4_gui, style = 'italic' }
+  end
 
   return treesitter
 
@@ -413,14 +426,14 @@ theme.loadPlugins = function()
         -- Sneak
     Sneak =      { fg = nord.nord0_gui, bg = nord.nord4_gui },
     SneakScope = { bg = nord.nord1_gui },
-               
+    
     -- Cmp
-    CmpItemKind =      { fg = nord.nord15_gui },
-    CmpItemAbbrMatch = { fg = nord.nord5_gui, style = 'bold' },
+    CmpItemKind =           { fg = nord.nord15_gui },
+    CmpItemAbbrMatch =      { fg = nord.nord5_gui, style = 'bold' },
     CmpItemAbbrMatchFuzzy = { fg = nord.nord5_gui, style = 'bold' },
-    CmpItemAbbr =      { fg = nord.nord4_gui},
-    CmpItemMenu =       { fg = nord.nord14_gui },
-               
+    CmpItemAbbr =           { fg = nord.nord4_gui},
+    CmpItemMenu =           { fg = nord.nord14_gui },
+    
     -- Indent Blankline
     IndentBlanklineChar =        { fg = nord.nord3_gui },
     IndentBlanklineContextChar = { fg = nord.nord10_gui },
@@ -452,20 +465,20 @@ theme.loadPlugins = function()
     rainbowcol7 = { fg = nord.nord13_gui },
 
     -- lightspeed
-    LightspeedLabel = { fg = nord.nord8_gui, style = "bold" },
-    LightspeedLabelOverlapped = { fg = nord.nord8_gui, style = "bold,underline" },
-    LightspeedLabelDistant = { fg = nord.nord15_gui, style = "bold" },
+    LightspeedLabel =                  { fg = nord.nord8_gui, style = "bold" },
+    LightspeedLabelOverlapped =        { fg = nord.nord8_gui, style = "bold,underline" },
+    LightspeedLabelDistant =           { fg = nord.nord15_gui, style = "bold" },
     LightspeedLabelDistantOverlapped = { fg = nord.nord15_gui, style = "bold,underline" },
-    LightspeedShortcut = { fg = nord.nord10_gui, style = "bold" },
-    LightspeedShortcutOverlapped = { fg = nord.nord10_gui, style = "bold,underline" },
-    LightspeedMaskedChar = { fg = nord.nord4_gui, bg = nord.nord2_gui, style = "bold" },
-    LightspeedGreyWash = { fg = nord.nord3_gui_bright },
-    LightspeedUnlabeledMatch = { fg = nord.nord4_gui, bg = nord.nord1_gui },
-    LightspeedOneCharMatch = { fg = nord.nord8_gui, style = "bold,reverse" },
-    LightspeedUniqueChar = { style = "bold,underline" },
-    -- LightspeedPendingOpArea = { style = "strikethrough" },
-    -- LightspeedPendingChangeOpArea = { style = "strikethrough" },
-    -- LightspeedCursor = { fg = nord.nord7_gui, style = "underline,reverse" },
+    LightspeedShortcut =               { fg = nord.nord10_gui, style = "bold" },
+    LightspeedShortcutOverlapped =     { fg = nord.nord10_gui, style = "bold,underline" },
+    LightspeedMaskedChar =             { fg = nord.nord4_gui, bg = nord.nord2_gui, style = "bold" },
+    LightspeedGreyWash =               { fg = nord.nord3_gui_bright },
+    LightspeedUnlabeledMatch =         { fg = nord.nord4_gui, bg = nord.nord1_gui },
+    LightspeedOneCharMatch =           { fg = nord.nord8_gui, style = "bold,reverse" },
+    LightspeedUniqueChar =             { style = "bold,underline" },
+    -- LightspeedPendingOpArea =          { style = "strikethrough" },
+    -- LightspeedPendingChangeOpArea =    { style = "strikethrough" },
+    -- LightspeedCursor =                 { fg = nord.nord7_gui, style = "underline,reverse" },
   }
   -- Options: