From 7bd57b7e93a80b171b88431fca40cedcd28ba7b3 Mon Sep 17 00:00:00 2001 From: siduck76 Date: Tue, 11 May 2021 08:02:03 +0530 Subject: [PATCH] add all highlights in one file --- init.lua | 22 ++------------- lua/custom_highlights.lua | 59 +++++++++++++++++++++++++++++++++++++++ lua/gitsigns-nvim.lua | 6 ---- lua/nvim-lspconfig.lua | 18 +----------- lua/nvimTree.lua | 9 ------ lua/statusline.lua | 9 +----- lua/telescope-nvim.lua | 9 ------ 7 files changed, 64 insertions(+), 68 deletions(-) create mode 100644 lua/custom_highlights.lua diff --git a/init.lua b/init.lua index 651860b..b30a74e 100644 --- a/init.lua +++ b/init.lua @@ -9,7 +9,7 @@ require "statusline" require("colorizer").setup() require("neoscroll").setup() -- smooth scroll --- lsp +-- lsp stuff require "nvim-lspconfig" require "compe-completion" @@ -20,12 +20,13 @@ g.mapleader = " " g.auto_save = 0 -- colorscheme related stuff - cmd "syntax on" local base16 = require "base16" base16(base16.themes["onedark"], true) +require "custom_highlights" + -- blankline local indent = 2 @@ -33,8 +34,6 @@ local indent = 2 g.indentLine_enabled = 1 g.indent_blankline_char = "▏" -cmd "hi IndentBlanklineChar guifg=#2a2e36" - g.indent_blankline_filetype_exclude = {"help", "terminal"} g.indent_blankline_buftype_exclude = {"terminal"} @@ -44,15 +43,6 @@ g.indent_blankline_show_first_indent_level = false require "treesitter-nvim" require "mappings" --- highlights -- -cmd "hi LineNr guifg=#42464e" -cmd "hi Comment guifg=#42464e" - -cmd "hi VertSplit guifg=#2a2e36" -cmd "hi EndOfBuffer guifg=#1e222a" -cmd "hi PmenuSel guibg=#98c379" -cmd "hi Pmenu guibg=#282c34" - require "telescope-nvim" require "nvimTree" @@ -66,11 +56,5 @@ vim.api.nvim_exec([[ au BufEnter term://* setlocal nonumber ]], false) --- inactive statuslines as thin splitlines -cmd("highlight! StatusLineNC gui=underline guifg=#383c44") - -cmd "hi clear CursorLine" -cmd "hi cursorlinenr guifg=#abb2bf" - -- setup for TrueZen.nvim require "zenmode" diff --git a/lua/custom_highlights.lua b/lua/custom_highlights.lua new file mode 100644 index 0000000..34a7017 --- /dev/null +++ b/lua/custom_highlights.lua @@ -0,0 +1,59 @@ +local cmd = vim.cmd +-- blankline + +cmd "hi IndentBlanklineChar guifg=#383c44" + +-- misc -- +cmd "hi LineNr guifg=#42464e" +cmd "hi Comment guifg=#42464e" +cmd "hi NvimInternalError guifg=#f9929b" +cmd "hi VertSplit guifg=#2a2e36" +cmd "hi EndOfBuffer guifg=#1e222a" + +-- Pmenu +cmd "hi PmenuSel guibg=#98c379" +cmd "hi Pmenu guibg=#282c34" +cmd "hi PmenuSbar guibg =#353b45" +cmd "hi PmenuThumb guibg =#81A1C1" + +-- inactive statuslines as thin splitlines +cmd("highlight! StatusLineNC gui=underline guifg=#383c44") + +-- line n.o +cmd "hi clear CursorLine" +cmd "hi cursorlinenr guifg=#abb2bf" + +-- git signs --- +cmd "hi DiffAdd guifg=#81A1C1 guibg = none" +cmd "hi DiffChange guifg =#3A3E44 guibg = none" +cmd "hi DiffModified guifg = #81A1C1 guibg = none" + +-- NvimTree +cmd "hi NvimTreeFolderIcon guifg = #61afef" +cmd "hi NvimTreeFolderName guifg = #61afef" +cmd "hi NvimTreeIndentMarker guifg=#383c44" +cmd "hi NvimTreeNormal guibg=#1b1f27" +cmd "hi NvimTreeVertSplit guifg=#1e222a" +cmd "hi NvimTreeRootFolder guifg=#f9929b" + +-- telescope +cmd "hi TelescopeBorder guifg=#2a2e36" +cmd "hi TelescopePromptBorder guifg=#2a2e36" +cmd "hi TelescopeResultsBorder guifg=#2a2e36" +cmd "hi TelescopePreviewBorder guifg=#525865" + +-- LspDiagnostics --- + +-- error / warnings +cmd "hi LspDiagnosticsSignError guifg=#f9929b" +cmd "hi LspDiagnosticsVirtualTextError guifg=#BF616A" +cmd "hi LspDiagnosticsSignWarning guifg=#EBCB8B" +cmd "hi LspDiagnosticsVirtualTextWarning guifg=#EBCB8B" + +-- info +cmd "hi LspDiagnosticsSignInformation guifg=#A3BE8C" +cmd "hi LspDiagnosticsVirtualTextInformation guifg=#A3BE8C" + +-- hint +cmd "hi LspDiagnosticsSignHint guifg=#b6bdca" +cmd "hi LspDiagnosticsVirtualTextHint guifg=#b6bdca" diff --git a/lua/gitsigns-nvim.lua b/lua/gitsigns-nvim.lua index 83bf7d7..1fa4325 100644 --- a/lua/gitsigns-nvim.lua +++ b/lua/gitsigns-nvim.lua @@ -25,9 +25,3 @@ require("gitsigns").setup { sign_priority = 5, status_formatter = nil -- Use default } - -local cmd = vim.cmd - -cmd "hi DiffAdd guifg=#81A1C1 guibg = none" -cmd "hi DiffChange guifg =#3A3E44 guibg = none" -cmd "hi DiffModified guifg = #81A1C1 guibg = none" diff --git a/lua/nvim-lspconfig.lua b/lua/nvim-lspconfig.lua index 3c5faa9..13a111e 100644 --- a/lua/nvim-lspconfig.lua +++ b/lua/nvim-lspconfig.lua @@ -44,7 +44,7 @@ for k, lang in pairs(servers) do } end --- remove the lsp servers with their configs you don want +-- vls example local vls_binary = '/usr/local/bin/vls' require'lspconfig'.vls.setup { cmd = {vls_binary}, @@ -88,19 +88,3 @@ vim.fn.sign_define("LspDiagnosticsSignError", {text = "", numhl = "LspDiagnos vim.fn.sign_define("LspDiagnosticsSignWarning", {text = "", numhl = "LspDiagnosticsDefaultWarning"}) vim.fn.sign_define("LspDiagnosticsSignInformation", {text = "", numhl = "LspDiagnosticsDefaultInformation"}) vim.fn.sign_define("LspDiagnosticsSignHint", {text = "", numhl = "LspDiagnosticsDefaultHint"}) - --- diagnostics highlights - -local cmd = vim.cmd - -cmd "hi LspDiagnosticsSignError guifg=#f9929b" -cmd "hi LspDiagnosticsVirtualTextError guifg=#BF616A" - -cmd "hi LspDiagnosticsSignWarning guifg=#EBCB8B" -cmd "hi LspDiagnosticsVirtualTextWarning guifg=#EBCB8B" - -cmd "hi LspDiagnosticsSignInformation guifg=#A3BE8C" -cmd "hi LspDiagnosticsVirtualTextInformation guifg=#A3BE8C" - -cmd "hi LspDiagnosticsSignHint guifg=#b6bdca" -cmd "hi LspDiagnosticsVirtualTextHint guifg=#b6bdca" diff --git a/lua/nvimTree.lua b/lua/nvimTree.lua index 9220fa7..137b986 100644 --- a/lua/nvimTree.lua +++ b/lua/nvimTree.lua @@ -1,5 +1,3 @@ - -local cmd = vim.cmd local g = vim.g vim.o.termguicolors = true @@ -84,10 +82,3 @@ g.nvim_tree_bindings = { ["-"] = get_lua_cb("dir_up"), ["q"] = get_lua_cb("close") } - -cmd "hi NvimTreeFolderIcon guifg = #61afef" -cmd "hi NvimTreeFolderName guifg = #61afef" -cmd "hi NvimTreeIndentMarker guifg=#383c44" -cmd "hi NvimTreeNormal guibg=#1b1f27" -cmd "hi NvimTreeVertSplit guifg=#1e222a" -cmd "hi NvimTreeRootFolder guifg=#f9929b" diff --git a/lua/statusline.lua b/lua/statusline.lua index ad3d9df..6d3013b 100644 --- a/lua/statusline.lua +++ b/lua/statusline.lua @@ -7,15 +7,8 @@ local colors = { bg = "#1e222a", line_bg = "#1e222a", fg = "#D8DEE9", - fg_green = "#65a380", - yellow = "#A3BE8C", - cyan = "#22262C", - darkblue = "#61afef", green = "#BBE67E", orange = "#FF8800", - purple = "#252930", - magenta = "#c678dd", - blue = "#22262C", red = "#DF8890", lightbg = "#282c34", nord = "#81A1C1", @@ -135,7 +128,7 @@ gls.left[12] = { DiagnosticWarn = { provider = "DiagnosticWarn", icon = "  ", - highlight = {colors.blue, colors.bg} + highlight = {colors.red, colors.bg} } } diff --git a/lua/telescope-nvim.lua b/lua/telescope-nvim.lua index 744cb7b..b338935 100644 --- a/lua/telescope-nvim.lua +++ b/lua/telescope-nvim.lua @@ -73,12 +73,3 @@ vim.api.nvim_set_keymap("n", "fb", [[lua require('telescope.builtin vim.api.nvim_set_keymap("n", "fh", [[lua require('telescope.builtin').help_tags()]], opt) vim.api.nvim_set_keymap("n", "fo", [[lua require('telescope.builtin').oldfiles()]], opt) vim.api.nvim_set_keymap("n", "fm", [[ Neoformat]], opt) - --- highlights - -local cmd = vim.cmd - -cmd "hi TelescopeBorder guifg=#2a2e36" -cmd "hi TelescopePromptBorder guifg=#2a2e36" -cmd "hi TelescopeResultsBorder guifg=#2a2e36" -cmd "hi TelescopePreviewBorder guifg=#525865"