summary refs log tree commit diff
path: root/.vim
diff options
context:
space:
mode:
authorRobert Günzler <r@gnzler.io>2021-05-31 16:52:18 +0200
committerRobert Günzler <r@gnzler.io>2021-05-31 16:56:02 +0200
commita7906b1e3a38253a36cb483f1bac846860b915f5 (patch)
treeb7b126283b8d34f857f202e83b50e37838302102 /.vim
parent432ee98837b67007a950355cca2e4a23541b59a1 (diff)
vim: statusline tweaks
Diffstat (limited to '.vim')
-rw-r--r--.vim/init.lua27
-rw-r--r--.vim/lua/colors.lua21
-rw-r--r--.vim/lua/plugins/_lsp.lua4
3 files changed, 35 insertions, 17 deletions
diff --git a/.vim/init.lua b/.vim/init.lua
index 7d2e176..fc80ed3 100644
--- a/.vim/init.lua
+++ b/.vim/init.lua
@@ -51,10 +51,11 @@ u.opt('o', 'lazyredraw', true)
 u.opt('o', 'backspace', 'indent,eol,start')
 u.opt('o', 'undolevels', 1000)
 u.opt('o', 'updatetime', 300)
-u.opt('o', 'signcolumn', 'yes')
+u.opt('o', 'signcolumn', 'auto:2')
 
+u.opt('w', 'cursorline', true)
 u.opt('w', 'conceallevel', 2)
-u.opt('w', 'concealcursor', 'cv')
+u.opt('w', 'concealcursor', '')
 
 u.opt('o', 'expandtab', true)
 -- }}}
@@ -88,7 +89,12 @@ vnoremap { 'T', function() cmd [[ retab! | call feedkeys("\<esc>") ]] end }
 
 -- AUTO GROUPS -- {{{
 u.augroup2 {
-  yank_highlight = {{ 'TextYankPost', '*', 'silent! lua require("vim.highlight").on_yank()' }}
+  yank_highlight = {{ 'TextYankPost', '*', 'silent! lua require("vim.highlight").on_yank()' }},
+  obvious_active_win = {
+    { 'WinEnter', '*', 'set cul' },
+    { 'WinLeave', '*', 'set nocul' }
+  },
+  c_makeprg = {{'BufRead', '*.c', 'set makeprg=ninja\\ -C\\ build' }},
 }
 -- }}}
 
@@ -98,8 +104,6 @@ u.def('SortLine', 'call setline(".", join(sort(split(getline("."), " ")), " "))'
 -- }}}
 
 -- STATUS LINE -- {{{
-vim.api.nvim_command('hi StatusLineInsert guifg=#00ffff guibg=None')
-vim.api.nvim_command('hi StatusLineCommand guifg=#ff3300 guibg=None')
 statusline = function()
   local sl = ''
   -- left
@@ -110,18 +114,17 @@ statusline = function()
   return sl
 end
 statusline_color = function(mode)
+  local hi = '%*'
   if mode == 'i' then
-    return '%#StatusLineInsert#'
+    hi = '%#StatusLineInsert#'
   elseif mode == 'c' then
-    return '%#StatusLineCommand#'
+    hi = '%#StatusLineCommand#'
   elseif mode == 'v' or mode == 'V' or mode == '' then
-    return '%#Visual#'
+    hi = '%#StatusLineVisual#'
   elseif mode == 'R' or mode == 'Rv' then
-    return '%1*'
-    -- return '%#Include#'
-  else
-    return '%1*'
+    hi = '%#StatusLineReplace#'
   end
+  return hi
 end
 -- }}}
 
diff --git a/.vim/lua/colors.lua b/.vim/lua/colors.lua
index a78fe61..de4a997 100644
--- a/.vim/lua/colors.lua
+++ b/.vim/lua/colors.lua
@@ -57,6 +57,7 @@ local p = {
 
 return lush(function()
 	return {
+    None       { fg = 'none', bg = 'none', gui = 'none' },
     Underlined { gui = 'underline' }, -- (preferred) text that stands out, HTML links
     Bold       { gui = 'bold' },
     Italic     { gui = 'italic' },
@@ -104,8 +105,8 @@ return lush(function()
     -- QuickFixLine { }, -- Current |quickfix| item in the quickfix window. Combined with |hl-CursorLine| when the cursor is there.
     SpecialKey   { fg = hsl(p.dim.white) }, -- Unprintable characters: text displayed differently from what it really is.  But not 'listchars' whitespace. |hl-Whitespace| SpellBad  Word that is not recognized by the spellchecker. |spell| Combined with the highlighting used otherwise.  SpellCap  Word that should start with a capital. |spell| Combined with the highlighting used otherwise.  SpellLocal  Word that is recognized by the spellchecker as one that is used in another region. |spell| Combined with the highlighting used otherwise.
     -- SpellRare    { }, -- Word that is recognized by the spellchecker as one that is hardly ever used.  |spell| Combined with the highlighting used otherwise.
-    StatusLine   { fg = hsl(p.normal.white), bg = hsl(p.normal.black) }, -- status line of current window
-    StatusLineNC { fg = hsl(p.dim.white) }, -- status lines of not-current windows Note: if this is equal to "StatusLine" Vim will use "^^^" in the status line of the current window.
+    StatusLine   { fg = hsl(p.bright.white), bg = 'none', gui = 'bold' }, -- status line of current window
+    StatusLineNC { StatusLine, gui = 'none' }, -- status lines of not-current windows Note: if this is equal to "StatusLine" Vim will use "^^^" in the status line of the current window.
     TabLine      { fg = hsl(p.dim.white) }, -- tab pages line, not active tab page label
     TabLineFill  { StatusLineNC }, -- tab pages line, where there are no labels
     TabLineSel   { fg = hsl(p.bright.white), gui = 'bold' }, -- tab pages line, active tab page label
@@ -304,7 +305,21 @@ return lush(function()
     -- diffLine {},
     -- diffBDiffer {},
     -- diffNewFile {},
-    -- }}}
+
+    -- git-messenger
+    gitmessengerPopupNormal { CursorLine },
+    gitmessengerHeader { Statement },
+    gitmessengerHash { Special },
+    gitmessengerHistory { Title },
+    gitmessengerEmail { Comment },
+
+    -- Plugin configs END }}}
+
+    -- Config specific
+    StatusLineInsert { StatusLine },
+    StatusLineCommand { StatusLine },
+    StatusLineVisual { Visual },
+    StatusLineReplace { StatusLine },
 	}
 end)
 
diff --git a/.vim/lua/plugins/_lsp.lua b/.vim/lua/plugins/_lsp.lua
index 9a1a0bb..e8ca981 100644
--- a/.vim/lua/plugins/_lsp.lua
+++ b/.vim/lua/plugins/_lsp.lua
@@ -91,8 +91,8 @@ end
 -- }}}
 
 -- configure signs {{{
-vim.fn.sign_define("LspDiagnosticsSignError", {text="⚡"})
-vim.fn.sign_define("LspDiagnosticsSignWarning", {text="⯈"})
+vim.fn.sign_define("LspDiagnosticsSignError", {text="⚡", numhl="Error"})
+vim.fn.sign_define("LspDiagnosticsSignWarning", {text="⯈", numhl="Warning"})
 vim.fn.sign_define("LspDiagnosticsSignInformation", {text="≈"})
 vim.fn.sign_define("LspDiagnosticsSignHint", {text="🞶"})
 -- }}}