organized highlights config , added new features like dashboard!

This commit is contained in:
siduck76 2021-06-14 07:57:56 +05:30
parent 30f9f00c9e
commit 5fc205068f
11 changed files with 265 additions and 238 deletions

View File

@ -24,14 +24,14 @@ cmd "syntax on"
local base16 = require "base16"
base16(base16.themes["onedark"], true)
require "colors"
require "highlights"
-- blankline
g.indentLine_enabled = 1
g.indent_blankline_char = ""
g.indent_blankline_filetype_exclude = {"help", "terminal"}
g.indent_blankline_filetype_exclude = {"help", "terminal", "dashboard"}
g.indent_blankline_buftype_exclude = {"terminal"}
g.indent_blankline_show_trailing_blankline_indent = false
@ -54,6 +54,34 @@ vim.api.nvim_exec([[
au BufEnter term://* setlocal nonumber
]], false)
-- setup for TrueZen.nvim
require "zenmode"
require "whichkey"
-- dashboard
g.dashboard_default_executive = "telescope"
g.dashboard_custom_header = {
" ",
" ",
" ⣴⣶⣤⡤⠦⣤⣀⣤⠆ ⣈⣭⣿⣶⣿⣦⣼⣆ ",
" ⠉⠻⢿⣿⠿⣿⣿⣶⣦⠤⠄⡠⢾⣿⣿⡿⠋⠉⠉⠻⣿⣿⡛⣦ ",
" ⠈⢿⣿⣟⠦ ⣾⣿⣿⣷ ⠻⠿⢿⣿⣧⣄ ",
" ⣸⣿⣿⢧ ⢻⠻⣿⣿⣷⣄⣀⠄⠢⣀⡀⠈⠙⠿⠄ ",
" ⢠⣿⣿⣿⠈ ⣻⣿⣿⣿⣿⣿⣿⣿⣛⣳⣤⣀⣀ ",
" ⢠⣧⣶⣥⡤⢄ ⣸⣿⣿⠘ ⢀⣴⣿⣿⡿⠛⣿⣿⣧⠈⢿⠿⠟⠛⠻⠿⠄ ",
" ⣰⣿⣿⠛⠻⣿⣿⡦⢹⣿⣷ ⢊⣿⣿⡏ ⢸⣿⣿⡇ ⢀⣠⣄⣾⠄ ",
" ⣠⣿⠿⠛ ⢀⣿⣿⣷⠘⢿⣿⣦⡀ ⢸⢿⣿⣿⣄ ⣸⣿⣿⡇⣪⣿⡿⠿⣿⣷⡄ ",
" ⠙⠃ ⣼⣿⡟ ⠈⠻⣿⣿⣦⣌⡇⠻⣿⣿⣷⣿⣿⣿ ⣿⣿⡇ ⠛⠻⢷⣄ ",
" ⢻⣿⣿⣄ ⠈⠻⣿⣿⣿⣷⣿⣿⣿⣿⣿⡟ ⠫⢿⣿⡆ ",
" ⠻⣿⣿⣿⣿⣶⣶⣾⣿⣿⣿⣿⣿⣿⣿⣿⡟⢀⣀⣤⣾⡿⠃ ",
" "
}
g.dashboard_custom_section = {
a = {description = {" Find File SPC f f"}, command = "Telescope find_files"},
b = {description = {" Recents SPC f o"}, command = "Telescope oldfiles"},
c = {description = {" Find Word SPC f w"}, command = "Telescope live_grep"},
d = {description = {"洛 New File SPC f b"}, command = "DashboardNewFile"},
e = {description = {"󰓏 Bookmarks SPC f b"}, command = "Telescope marks"},
f = {description = {" Load Last Session SPC f s"}, command = "SessionLoad"}
}

View File

@ -1,118 +0,0 @@
local cmd = vim.cmd
-- blankline
cmd "hi IndentBlanklineChar guifg=#282c34"
-- 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("hi! 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=#1b1f27"
-- 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"
-- bufferline
local function add_hi(item, fg, bg)
local buf_hi = "hi BufferLine" .. item .. " guifg=" .. fg .. " guibg=" .. bg
if item == "BufferSelected" then
vim.cmd(buf_hi .. " gui=bold")
else
vim.cmd(buf_hi)
end
end
local function bufferline_colors()
-- colors ---
local fg = "#565c64"
local bg = "#252931"
-- active buffer
local darkerBg = "#1e222a" -- nvim's bg
local activeBuffer_fg = "#c8ccd4"
-- unfocused opened buffer
local grey_dark = "#9298a0"
-- tabs
local bg2 = "#30343c" -- should be lighter than bg
local red = "#d47d85"
-- modified buffers
local green = "#A3BE8C"
add_hi("Background", fg, bg)
add_hi("Fill", fg, bg)
add_hi("BufferSelected", activeBuffer_fg, darkerBg)
add_hi("BufferVisible", grey_dark, bg)
add_hi("Tab", grey_dark, bg2)
add_hi("TabSelected", bg, "#81A1C1")
add_hi("TabClose", red, bg)
-- making separates transparent
add_hi("Indicator", bg, bg)
add_hi("IndicatorSelected", bg, bg)
add_hi("Separator", bg, bg)
add_hi("SeparatorVisible", bg, bg)
add_hi("SeparatorSelected", darkerBg, darkerBg)
-- modified buffers
add_hi("Modified", red, bg)
add_hi("ModifiedVisible", red, bg)
add_hi("ModifiedSelected", green, darkerBg)
end
bufferline_colors()

View File

@ -1,59 +0,0 @@
local cmd = vim.cmd
-- blankline
cmd "hi IndentBlanklineChar guifg=#282c34"
-- 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=#1b1f27"
-- 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"

View File

@ -1,108 +1,110 @@
local colors = require "themes/onedark"
require "nvim-web-devicons".setup {
override = {
html = {
icon = "",
color = "#DE8C92",
color = colors.baby_pink,
name = "html"
},
css = {
icon = "",
color = "#61afef",
color = colors.blue,
name = "css"
},
js = {
icon = "",
color = "#EBCB8B",
color = colors.sun,
name = "js"
},
ts = {
icon = "",
color = "#519ABA",
color = colors.teal,
name = "ts"
},
kt = {
icon = "󱈙",
color = "#ffcb91",
color = colors.orange,
name = "kt"
},
png = {
icon = "",
color = "#BD77DC",
icon = "",
color = colors.dark_purple,
name = "png"
},
jpg = {
icon = "",
color = "#BD77DC",
icon = "",
color = colors.dark_purple,
name = "jpg"
},
jpeg = {
icon = "",
color = "#BD77DC",
icon = "",
color = "colors.dark_purple",
name = "jpeg"
},
mp3 = {
icon = "",
color = "#C8CCD4",
color = colors.white,
name = "mp3"
},
mp4 = {
icon = "",
color = "#C8CCD4",
color = colors.white,
name = "mp4"
},
out = {
icon = "",
color = "#C8CCD4",
color = colors.white,
name = "out"
},
Dockerfile = {
icon = "",
color = "#b8b5ff",
color = colors.cyan,
name = "Dockerfile"
},
rb = {
icon = "",
color = "#ff75a0",
color = colors.pink,
name = "rb"
},
vue = {
icon = "",
color = "#7eca9c",
color = colors.vibrant_green,
name = "vue"
},
py = {
icon = "",
color = "#a7c5eb",
color = colors.cyan,
name = "py"
},
toml = {
icon = "",
color = "#61afef",
color = colors.blue,
name = "toml"
},
lock = {
icon = "",
color = "#DE6B74",
color = colors.red,
name = "lock"
},
zip = {
icon = "",
color = "#EBCB8B",
color = colors.sun,
name = "zip"
},
xz = {
icon = "",
color = "#EBCB8B",
color = colors.sun,
name = "xz"
},
deb = {
icon = "",
color = "#a3b8ef",
color = colors.cyan,
name = "deb"
},
rpm = {
icon = "",
color = "#fca2aa",
color = colors.orange,
name = "rpm"
}
}

137
lua/highlights.lua Normal file
View File

@ -0,0 +1,137 @@
local cmd = vim.cmd
local colors = require "themes/onedark"
local white = colors.white
local darker_black = colors.darker_black
local black = colors.black
local black2 = colors.black2
local one_bg = colors.one_bg
local one_bg2 = colors.one_bg2
local one_bg3 = colors.one_bg3
local light_grey = colors.light_grey
local grey = colors.grey
local grey_fg = colors.grey_fg
local red = colors.red
local line = colors.line
local green = colors.green
local nord_blue = colors.nord_blue
local blue = colors.blue
local yellow = colors.yellow
local purple = colors.purple
-- for guifg , bg
local function fg(group, color)
cmd("hi " .. group .. " guifg=" .. color)
end
local function bg(group, color)
cmd("hi " .. group .. " guibg=" .. color)
end
local function fg_bg(group, fgcol, bgcol)
cmd("hi " .. group .. " guifg=" .. fgcol .. " guibg=" .. bgcol)
end
-- blankline
fg("IndentBlanklineChar", line)
-- misc --
fg("LineNr", grey)
fg("Comment", grey)
fg("NvimInternalError", red)
fg("VertSplit", line)
fg("EndOfBuffer", black)
-- Pmenu
bg("Pmenu", one_bg)
bg("PmenuSbar", one_bg2)
bg("PmenuSel", green)
bg("PmenuThumb", nord_blue)
-- inactive statuslines as thin splitlines
cmd("hi! StatusLineNC gui=underline guifg=" .. line)
-- line n.o
cmd "hi clear CursorLine"
fg("cursorlinenr", white)
-- git signs ---
fg_bg("DiffAdd", nord_blue, "none")
fg_bg("DiffChange", one_bg2, "none")
fg_bg("DiffModified", nord_blue, "none")
-- NvimTree
fg("NvimTreeFolderIcon", blue)
fg("NvimTreeFolderName", blue)
fg("NvimTreeIndentMarker", one_bg2)
fg("NvimTreeVertSplit", darker_black)
bg("NvimTreeVertSplit", darker_black)
fg("NvimTreeRootFolder", darker_black)
bg("NvimTreeNormal", darker_black)
fg_bg("NvimTreeStatuslineNc", darker_black, darker_black)
-- telescope
fg("TelescopeBorder", line)
fg("TelescopePromptBorder", line)
fg("TelescopeResultsBorder", line)
fg("TelescopePreviewBorder", grey)
-- LspDiagnostics ---
-- error / warnings
fg("LspDiagnosticsSignError", red)
fg("LspDiagnosticsVirtualTextError", red)
fg("LspDiagnosticsSignWarning", yellow)
fg("LspDiagnosticsVirtualTextWarning", yellow)
-- info
fg("LspDiagnosticsSignInformation", green)
fg("LspDiagnosticsVirtualTextInformation", green)
-- hint
fg("LspDiagnosticsSignHint", purple)
fg("LspDiagnosticsVirtualTextHint", purple)
-- bufferline
fg_bg("BufferLineFill", grey_fg, black2)
fg_bg("BufferLineBackground", light_grey, black2)
fg_bg("BufferLineBufferVisible", light_grey, one_bg)
fg_bg("BufferLineBufferSelected", white, black)
cmd "hi BufferLineBufferSelected gui=bold"
-- tabs
fg_bg("BufferLineTab", light_grey, one_bg3)
fg_bg("BufferLineTabSelected", black2, nord_blue)
fg_bg("BufferLineTabClose", red, black)
fg_bg("BufferLineIndicator", black2, black2)
fg_bg("BufferLineIndicatorSelected", black, black)
-- separators
fg_bg("BufferLineSeparator", line, black2)
fg_bg("BufferLineSeparatorVisible", line, black2)
fg_bg("BufferLineSeparatorSelected", black, black2)
-- modified buffers
fg_bg("BufferLineModified", red, black2)
fg_bg("BufferLineModifiedVisible", red, black2)
fg_bg("BufferLineModifiedSelected", green, black)
-- close buttons
fg_bg("BufferLineCLoseButtonVisible", light_grey, black2)
fg_bg("BufferLineCLoseButton", light_grey, black2)
fg_bg("BufferLineCLoseButtonSelected", red, black)
-- dashboard
fg("DashboardHeader", grey_fg)
fg("DashboardCenter", grey_fg)
fg("DashboardShortcut", grey_fg)
fg("DashboardFooter", black)

View File

@ -3,7 +3,7 @@ local g = vim.g
vim.o.termguicolors = true
g.nvim_tree_side = "left"
g.nvim_tree_width = 26
g.nvim_tree_width = 25
g.nvim_tree_ignore = {".git", "node_modules", ".cache"}
g.nvim_tree_auto_open = 0
g.nvim_tree_auto_close = 0
@ -39,7 +39,7 @@ g.nvim_tree_icons = {
open = "",
symlink = "",
empty = "",
empty_open = "",
empty_open = "",
symlink_open = ""
}
}

View File

@ -38,6 +38,7 @@ return require("packer").startup(
use "nvim-lua/popup.nvim"
-- misc
use "glepnir/dashboard-nvim"
use "tweekmonster/startuptime.vim"
use "907th/vim-auto-save"
use "karb94/neoscroll.nvim"

View File

@ -4,16 +4,13 @@ local condition = require("galaxyline.condition")
gl.short_line_list = {" "}
local colors = {
bg = "#22262e",
fg = "#abb2bf",
green = "#97C378",
red = "#d47d85",
lightbg = "#2d3139",
lightbg2 = "#262a32",
blue = "#81A1C1",
yellow = "#e0c080",
grey = "#6f737b"
local colors = require "themes/onedark"
gls.left[1] = {
FirstElement = {
provider = function() return '' end,
highlight = { colors.nord_blue, colors.nord_blue }
},
}
gls.left[2] = {
@ -21,9 +18,9 @@ gls.left[2] = {
provider = function()
return ""
end,
highlight = {colors.bg, colors.blue},
highlight = {colors.statusline_bg, colors.nord_blue},
separator = "",
separator_highlight = {colors.blue, colors.lightbg}
separator_highlight = {colors.nord_blue, colors.lightbg}
}
}
@ -31,7 +28,7 @@ gls.left[3] = {
FileIcon = {
provider = "FileIcon",
condition = condition.buffer_not_empty,
highlight = {colors.fg, colors.lightbg}
highlight = {colors.white, colors.lightbg}
}
}
@ -39,7 +36,7 @@ gls.left[4] = {
FileName = {
provider = {"FileName"},
condition = condition.buffer_not_empty,
highlight = {colors.fg, colors.lightbg},
highlight = {colors.white, colors.lightbg},
separator = "",
separator_highlight = {colors.lightbg, colors.lightbg2}
}
@ -51,9 +48,9 @@ gls.left[5] = {
local dir_name = vim.fn.fnamemodify(vim.fn.getcwd(), ":t")
return "" .. dir_name .. " "
end,
highlight = {colors.grey, colors.lightbg2},
highlight = {colors.grey_fg2, colors.lightbg2},
separator = "",
separator_highlight = {colors.lightbg2, colors.bg}
separator_highlight = {colors.lightbg2, colors.statusline_bg}
}
}
@ -70,7 +67,7 @@ gls.left[6] = {
provider = "DiffAdd",
condition = checkwidth,
icon = "",
highlight = {colors.fg, colors.bg}
highlight = {colors.white, colors.statusline_bg}
}
}
@ -79,7 +76,7 @@ gls.left[7] = {
provider = "DiffModified",
condition = checkwidth,
icon = "",
highlight = {colors.grey, colors.bg}
highlight = {colors.grey_fg2, colors.statusline_bg}
}
}
@ -88,7 +85,7 @@ gls.left[8] = {
provider = "DiffRemove",
condition = checkwidth,
icon = "",
highlight = {colors.grey, colors.bg}
highlight = {colors.grey_fg2, colors.statusline_bg}
}
}
@ -96,7 +93,7 @@ gls.left[9] = {
DiagnosticError = {
provider = "DiagnosticError",
icon = "",
highlight = {colors.red, colors.bg}
highlight = {colors.red, colors.statusline_bg}
}
}
@ -104,22 +101,21 @@ gls.left[10] = {
DiagnosticWarn = {
provider = "DiagnosticWarn",
icon = "",
highlight = {colors.yellow, colors.bg}
highlight = {colors.yellow, colors.statusline_bg}
}
}
gls.right[1] = {
lsp_status = {
provider = function(msg)
msg = msg or "No Active Lsp"
provider = function()
local clients = vim.lsp.get_active_clients()
if next(clients) ~= nil then
return " " .. "" .. " active "
return " " .. "" .. " LSP "
else
return ""
end
end,
highlight = {colors.grey, colors.bg}
highlight = {colors.grey_fg2, colors.statusline_bg}
}
}
@ -129,9 +125,9 @@ gls.right[2] = {
return ""
end,
condition = require("galaxyline.provider_vcs").check_git_workspace,
highlight = {colors.grey, colors.lightbg},
highlight = {colors.grey_fg2, colors.lightbg},
separator = "",
separator_highlight = {colors.lightbg, colors.bg}
separator_highlight = {colors.lightbg, colors.statusline_bg}
}
}
@ -139,7 +135,7 @@ gls.right[3] = {
GitBranch = {
provider = "GitBranch",
condition = require("galaxyline.provider_vcs").check_git_workspace,
highlight = {colors.grey, colors.lightbg}
highlight = {colors.grey_fg2, colors.lightbg}
}
}
@ -148,7 +144,7 @@ gls.right[4] = {
provider = function()
return ""
end,
highlight = {colors.bg, colors.red},
highlight = {colors.statusline_bg, colors.red},
separator = "",
separator_highlight = {colors.red, colors.lightbg}
}

View File

@ -73,3 +73,10 @@ vim.api.nvim_set_keymap("n", "<Leader>fb", [[<Cmd>lua require('telescope.builtin
vim.api.nvim_set_keymap("n", "<Leader>fh", [[<Cmd>lua require('telescope.builtin').help_tags()<CR>]], opt)
vim.api.nvim_set_keymap("n", "<Leader>fo", [[<Cmd>lua require('telescope.builtin').oldfiles()<CR>]], opt)
vim.api.nvim_set_keymap("n", "<Leader>fm", [[<Cmd> Neoformat<CR>]], opt)
-- dashboard stuff
vim.api.nvim_set_keymap("n", "<Leader>fw", [[<Cmd> Telescope live_grep<CR>]], opt)
vim.api.nvim_set_keymap("n", "<Leader>fn", [[<Cmd> DashboardNewFile<CR>]], opt)
vim.api.nvim_set_keymap("n", "<Leader>fb", [[<Cmd> DashboardJumpMarks<CR>]], opt)
vim.api.nvim_set_keymap("n", "<Leader>fl", [[<Cmd> SessionLoad<CR>]], opt)
vim.api.nvim_set_keymap("n", "<Leader>fs", [[<Cmd> SessionSave<CR>]], opt)

33
lua/themes/onedark.lua Normal file
View File

@ -0,0 +1,33 @@
local colors = {
white = "#abb2bf",
darker_black = "#1b1f27",
black = "#1e222a", -- nvim bg
black2 = "#252931",
one_bg = "#282c34", -- real bg of onedark
one_bg2 = "#353b45",
one_bg3 = "#30343c",
grey = "#42464e",
grey_fg = "#565c64",
grey_fg2 = "#6f737b",
light_grey = "#6f737b",
red = "#d47d85",
baby_pink = "#DE8C92",
pink = "#ff75a0",
line = "#2a2e36", -- for lines like vertsplit
green = "#A3BE8C",
vibrant_green = "#7eca9c",
nord_blue = "#81A1C1",
blue = "#61afef",
yellow = "#e7c787",
sun = "#EBCB8B",
purple = "#b4bbc8",
dark_purple = "#c882e7",
teal = "#519ABA",
orange = "#fca2aa",
cyan = "#a3b8ef",
statusline_bg = "#22262e",
lightbg = "#2d3139",
lightbg2 = "#262a32"
}
return colors

View File

@ -1,6 +1,6 @@
require "bufferline".setup {
options = {
offsets = {{filetype = "NvimTree", text = ""}},
offsets = {{filetype = "NvimTree", text = "", padding = 1}},
buffer_close_icon = "",
modified_icon = "",
close_icon = "",