summaryrefslogtreecommitdiff
path: root/pkgs/custom-neovim/config/lua
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/custom-neovim/config/lua')
-rw-r--r--pkgs/custom-neovim/config/lua/options.lua6
-rw-r--r--pkgs/custom-neovim/config/lua/plugins/lualine.lua154
-rw-r--r--pkgs/custom-neovim/config/lua/plugins/tabby.lua56
-rw-r--r--pkgs/custom-neovim/config/lua/utilities.lua20
4 files changed, 150 insertions, 86 deletions
diff --git a/pkgs/custom-neovim/config/lua/options.lua b/pkgs/custom-neovim/config/lua/options.lua
index a51e319..14ee7d1 100644
--- a/pkgs/custom-neovim/config/lua/options.lua
+++ b/pkgs/custom-neovim/config/lua/options.lua
@@ -1,7 +1,9 @@
-- General Settings
vim.o.winborder = 'rounded'
-vim.o.showtabline = 1
-vim.o.showmode = false
+vim.o.showtabline = 2 -- whether to only show tabline if there is more than one tab.
+vim.o.laststatus = 3 -- only have one statusline at the bottom of the window.
+vim.o.showmode = false -- don't show the mode in the commandline.
+vim.o.ruler = false -- don't show #,# in the commandline.
vim.o.icm = 'split'
vim.o.cia = 'abbr,kind,menu'
vim.o.mouse = ""
diff --git a/pkgs/custom-neovim/config/lua/plugins/lualine.lua b/pkgs/custom-neovim/config/lua/plugins/lualine.lua
index 409c452..b38d3ed 100644
--- a/pkgs/custom-neovim/config/lua/plugins/lualine.lua
+++ b/pkgs/custom-neovim/config/lua/plugins/lualine.lua
@@ -1,98 +1,88 @@
-local auto_theme = require("lualine.themes.auto")
-
-local colors = {
- modes = {
- normal = auto_theme.normal.a.bg,
- insert = auto_theme.insert.a.bg,
- visual = auto_theme.visual.a.bg,
- replace = auto_theme.replace.a.bg,
- command = auto_theme.command.a.bg,
- inactive = auto_theme.inactive.a.bg,
- },
- text = {
- dark = auto_theme.normal.a.fg,
- light = auto_theme.normal.c.fg,
- },
- backdrop = auto_theme.normal.c.bg,
-}
-
-local custom_auto_theme = {
- normal = {
- a = {bg = colors.modes.normal, fg = colors.text.dark, gui = 'bold'},
- b = {bg = colors.backdrop, fg = colors.text.light},
- c = {bg = colors.backdrop, fg = colors.text.light},
- x = {bg = colors.backdrop, fg = colors.text.light},
- y = {bg = colors.backdrop, fg = colors.text.light},
- z = {bg = colors.modes.normal, fg = colors.text.dark, gui = 'bold'},
- },
- insert = {
- a = {bg = colors.modes.insert, fg = colors.text.dark, gui = 'bold'},
- b = {bg = colors.backdrop, fg = colors.text.light},
- c = {bg = colors.backdrop, fg = colors.text.light},
- x = {bg = colors.backdrop, fg = colors.text.light},
- y = {bg = colors.backdrop, fg = colors.text.light},
- z = {bg = colors.modes.insert, fg = colors.text.dark, gui = 'bold'},
- },
- visual = {
- a = {bg = colors.modes.visual, fg = colors.text.dark, gui = 'bold'},
- b = {bg = colors.backdrop, fg = colors.text.light},
- c = {bg = colors.backdrop, fg = colors.text.light},
- x = {bg = colors.backdrop, fg = colors.text.light},
- y = {bg = colors.backdrop, fg = colors.text.light},
- z = {bg = colors.modes.visual, fg = colors.text.dark, gui = 'bold'},
- },
- replace = {
- a = {bg = colors.modes.replace, fg = colors.text.dark, gui = 'bold'},
- b = {bg = colors.backdrop, fg = colors.text.light},
- c = {bg = colors.backdrop, fg = colors.text.light},
- x = {bg = colors.backdrop, fg = colors.text.light},
- y = {bg = colors.backdrop, fg = colors.text.light},
- z = {bg = colors.modes.replace, fg = colors.text.dark, gui = 'bold'},
- },
- command = {
- a = {bg = colors.modes.command, fg = colors.text.dark, gui = 'bold'},
- b = {bg = colors.backdrop, fg = colors.text.light},
- c = {bg = colors.backdrop, fg = colors.text.light},
- x = {bg = colors.backdrop, fg = colors.text.light},
- y = {bg = colors.backdrop, fg = colors.text.light},
- z = {bg = colors.modes.command, fg = colors.text.dark, gui = 'bold'},
- },
- inactive = {
- a = {bg = colors.modes.inactive, fg = colors.text.dark, gui = 'bold'},
- b = {bg = colors.backdrop, fg = colors.text.light},
- c = {bg = colors.backdrop, fg = colors.text.light},
- x = {bg = colors.backdrop, fg = colors.text.light},
- y = {bg = colors.backdrop, fg = colors.text.light},
- z = {bg = colors.modes.inactive, fg = colors.text.dark, gui = 'bold'},
- },
-};
+local generate_lualine_theme = function()
+ local colors = utils.generate_theme_from_lualine()
+ return {
+ normal = {
+ a = {bg = colors.modes.normal, fg = colors.text.dark, gui = 'bold'},
+ b = {bg = colors.background, fg = colors.text.light},
+ c = {bg = colors.background, fg = colors.text.light},
+ x = {bg = colors.background, fg = colors.text.light},
+ y = {bg = colors.background, fg = colors.text.light},
+ z = {bg = colors.modes.normal, fg = colors.text.dark, gui = 'bold'},
+ },
+ insert = {
+ a = {bg = colors.modes.insert, fg = colors.text.dark, gui = 'bold'},
+ b = {bg = colors.background, fg = colors.text.light},
+ c = {bg = colors.background, fg = colors.text.light},
+ x = {bg = colors.background, fg = colors.text.light},
+ y = {bg = colors.background, fg = colors.text.light},
+ z = {bg = colors.modes.insert, fg = colors.text.dark, gui = 'bold'},
+ },
+ visual = {
+ a = {bg = colors.modes.visual, fg = colors.text.dark, gui = 'bold'},
+ b = {bg = colors.background, fg = colors.text.light},
+ c = {bg = colors.background, fg = colors.text.light},
+ x = {bg = colors.background, fg = colors.text.light},
+ y = {bg = colors.background, fg = colors.text.light},
+ z = {bg = colors.modes.visual, fg = colors.text.dark, gui = 'bold'},
+ },
+ replace = {
+ a = {bg = colors.modes.replace, fg = colors.text.dark, gui = 'bold'},
+ b = {bg = colors.background, fg = colors.text.light},
+ c = {bg = colors.background, fg = colors.text.light},
+ x = {bg = colors.background, fg = colors.text.light},
+ y = {bg = colors.background, fg = colors.text.light},
+ z = {bg = colors.modes.replace, fg = colors.text.dark, gui = 'bold'},
+ },
+ command = {
+ a = {bg = colors.modes.command, fg = colors.text.dark, gui = 'bold'},
+ b = {bg = colors.background, fg = colors.text.light},
+ c = {bg = colors.background, fg = colors.text.light},
+ x = {bg = colors.background, fg = colors.text.light},
+ y = {bg = colors.background, fg = colors.text.light},
+ z = {bg = colors.modes.command, fg = colors.text.dark, gui = 'bold'},
+ },
+ inactive = {
+ a = {bg = colors.modes.inactive, fg = colors.text.dark, gui = 'bold'},
+ b = {bg = colors.background, fg = colors.text.light},
+ c = {bg = colors.background, fg = colors.text.light},
+ x = {bg = colors.background, fg = colors.text.light},
+ y = {bg = colors.background, fg = colors.text.light},
+ z = {bg = colors.modes.inactive, fg = colors.text.dark, gui = 'bold'},
+ },
+ };
+end
require('lualine').setup {
options = {
- theme = custom_auto_theme,
+ theme = generate_lualine_theme(),
component_separators = "",
- section_separators = { left = '', right = '' },
+ section_separators = { left = '', right = '' },
},
sections = {
- lualine_a = { { 'mode', separator = { left = '', rignt = '' }, right_padding = 2 } },
- lualine_b = { 'filename', 'branch' },
- lualine_c = {
- '%=', --[[ add your center components here in place of this comment ]]
- },
- lualine_x = {},
- lualine_y = { 'filetype', 'progress' },
+ lualine_a = { { 'mode', separator = { left = '', rignt = '' }, right_padding = 2 } }, -- { left = '', rignt = '' }
+ lualine_b = { 'filename', 'diff' },
+ lualine_c = { 'branch' },
+ lualine_x = { {'diagnostics', sources = { 'nvim_lsp' } } },
+ lualine_y = { 'lsp_status', 'progress' },
lualine_z = {
- { 'location', separator = { left = '', right = '' }, left_padding = 2 },
+ { 'location', separator = { left = '', right = '' }, left_padding = 2 },
},
},
inactive_sections = {
- lualine_a = { 'filename' },
- lualine_b = {},
+ lualine_a = {},
+ lualine_b = { 'filename' },
lualine_c = {},
lualine_x = {},
- lualine_y = {},
- lualine_z = { 'location' },
+ lualine_y = { 'location' },
+ lualine_z = {},
},
tabline = {},
extensions = {},
}
+
+-- vim.api.nvim_create_autocmd("ColorScheme", {
+-- callback = function()
+-- setup_lualine()
+-- print "colorscheme changed"
+-- end,
+-- })
diff --git a/pkgs/custom-neovim/config/lua/plugins/tabby.lua b/pkgs/custom-neovim/config/lua/plugins/tabby.lua
index 2ad03ed..ecba331 100644
--- a/pkgs/custom-neovim/config/lua/plugins/tabby.lua
+++ b/pkgs/custom-neovim/config/lua/plugins/tabby.lua
@@ -1,2 +1,54 @@
-vim.o.showtabline = 1
-require('tabby').setup()
+local general_theme = utils.generate_theme_from_lualine()
+local colors = {
+ current = { fg = general_theme.modes.insert, bg = general_theme.background, style = 'bold'},
+ not_current = { fg = general_theme.text.light, bg = general_theme.background };
+ fill = { bg = general_theme.background };
+};
+local theme = {
+ fill = colors.fill,
+ -- Also you can do this: fill = { fg='#f2e9de', bg='#907aa9', style='italic' }
+ head = colors.fill,
+ current_tab = colors.current,
+ tab = colors.not_current,
+ win = colors.fill,
+ tail = colors.fill,
+}
+require('tabby').setup({
+ line = function(line)
+ return {
+ {
+ -- { '  ', hl = theme.head },
+ -- line.sep('', theme.head, theme.fill),
+ },
+ line.tabs().foreach(function(tab)
+ local hl = tab.is_current() and theme.current_tab or theme.tab
+ return {
+ line.sep('', hl, theme.fill),
+ -- tab.is_current() and '' or '󰆣',
+ tab.number(),
+ tab.name(),
+ line.sep('', hl, theme.fill),
+ hl = hl,
+ margin = ' ',
+ }
+ end),
+ line.spacer(),
+ line.wins_in_tab(line.api.get_current_tab()).foreach(function(win)
+ return {
+ line.sep('', theme.win, theme.fill),
+ -- win.is_current() and '' or '',
+ win.buf_name(),
+ line.sep('', theme.win, theme.fill),
+ hl = theme.win,
+ margin = ' ',
+ }
+ end),
+ {
+ line.sep('', theme.tail, theme.fill),
+ { '  ', hl = theme.tail },
+ },
+ hl = theme.fill,
+ }
+ end,
+ -- option = {}, -- setup modules' option,
+})
diff --git a/pkgs/custom-neovim/config/lua/utilities.lua b/pkgs/custom-neovim/config/lua/utilities.lua
index fe86dd6..3de4a54 100644
--- a/pkgs/custom-neovim/config/lua/utilities.lua
+++ b/pkgs/custom-neovim/config/lua/utilities.lua
@@ -3,3 +3,23 @@ utils = {}
utils.mapkey = function(mode, key, desc, action)
vim.keymap.set(mode, key, action, {noremap = true, silent = true, desc = desc})
end
+
+utils.generate_theme_from_lualine = function()
+ local auto_theme = require("lualine.themes.auto")
+ return {
+ modes = {
+ normal = auto_theme.normal.a.bg,
+ insert = auto_theme.insert.a.bg,
+ visual = auto_theme.visual.a.bg,
+ replace = auto_theme.replace.a.bg,
+ command = auto_theme.command.a.bg,
+ inactive = auto_theme.inactive.a.bg,
+ },
+ text = {
+ dark = auto_theme.normal.a.fg,
+ light = auto_theme.normal.c.fg,
+ },
+ background = auto_theme.normal.c.bg,
+ }
+end
+