summary refs log tree commit diff
path: root/.vim/init.lua
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--.vim/init.lua27
1 files changed, 15 insertions, 12 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
 -- }}}