diff options
Diffstat (limited to 'pkgs')
| -rw-r--r-- | pkgs/custom-neovim/config/colors/oxocarbon-base16.lua | 20 | ||||
| -rw-r--r-- | pkgs/custom-neovim/config/lua/plugins/colorschemes.lua | 4 | ||||
| -rw-r--r-- | pkgs/custom-neovim/config/lua/plugins/fidget.lua | 7 | ||||
| -rw-r--r-- | pkgs/custom-neovim/config/lua/plugins/heirline.lua | 327 | ||||
| -rw-r--r-- | pkgs/custom-neovim/config/lua/plugins/mini-statusline.lua | 154 | ||||
| -rw-r--r-- | pkgs/custom-neovim/todo.md | 4 |
6 files changed, 4 insertions, 512 deletions
diff --git a/pkgs/custom-neovim/config/colors/oxocarbon-base16.lua b/pkgs/custom-neovim/config/colors/oxocarbon-base16.lua deleted file mode 100644 index 6bdf4fa..0000000 --- a/pkgs/custom-neovim/config/colors/oxocarbon-base16.lua +++ /dev/null @@ -1,20 +0,0 @@ -require("mini.base16").setup { - palette = { - base00 = "#161616", - base01 = "#262626", - base02 = "#393939", - base03 = "#525252", - base04 = "#dde1e6", - base05 = "#f2f4f8", - base06 = "#ffffff", - base07 = "#08bdba", - base08 = "#3ddbd9", - base09 = "#78a9ff", - base0A = "#ee5396", - base0B = "#be95ff", - base0C = "#ff7eb6", - base0D = "#42be65", - base0E = "#33b1ff", - base0F = "#82cfff", - }, -} diff --git a/pkgs/custom-neovim/config/lua/plugins/colorschemes.lua b/pkgs/custom-neovim/config/lua/plugins/colorschemes.lua index 6248a9a..f71c83f 100644 --- a/pkgs/custom-neovim/config/lua/plugins/colorschemes.lua +++ b/pkgs/custom-neovim/config/lua/plugins/colorschemes.lua @@ -1,9 +1,5 @@ return { { - "mini.base16", - lazy = false, - }, - { "nightfox.nvim", enabled = true, lazy = false, diff --git a/pkgs/custom-neovim/config/lua/plugins/fidget.lua b/pkgs/custom-neovim/config/lua/plugins/fidget.lua deleted file mode 100644 index d8b8baf..0000000 --- a/pkgs/custom-neovim/config/lua/plugins/fidget.lua +++ /dev/null @@ -1,7 +0,0 @@ -return { - "fidget.nvim", - lazy = false, - after = function () - require("fidget").setup() - end -} diff --git a/pkgs/custom-neovim/config/lua/plugins/heirline.lua b/pkgs/custom-neovim/config/lua/plugins/heirline.lua deleted file mode 100644 index 6160c94..0000000 --- a/pkgs/custom-neovim/config/lua/plugins/heirline.lua +++ /dev/null @@ -1,327 +0,0 @@ -return { - "heirline.nvim", - enabled = false, - lazy = false, - after = function () - -- Extra stuff from heirline. - local conditions = require("heirline.conditions") - local utils = require("heirline.utils") - - local using_icons = true - - -- Define Colors - local colors = { - bright_bg = utils.get_highlight("Folded").bg, - bright_fg = utils.get_highlight("Folded").fg, - red = utils.get_highlight("DiagnosticError").fg, - dark_red = utils.get_highlight("DiffDelete").bg, - green = utils.get_highlight("String").fg, - blue = utils.get_highlight("Function").fg, - gray = utils.get_highlight("NonText").fg, - light_gray = utils.get_highlight("Visual").bg, - orange = utils.get_highlight("Constant").fg, - purple = utils.get_highlight("Statement").fg, - cyan = utils.get_highlight("Special").fg, - diag_warn = utils.get_highlight("DiagnosticWarn").fg, - diag_error = utils.get_highlight("DiagnosticError").fg, - diag_hint = utils.get_highlight("DiagnosticHint").fg, - diag_info = utils.get_highlight("DiagnosticInfo").fg, - git_del = utils.get_highlight("diffDeleted").fg, - git_add = utils.get_highlight("diffAdded").fg, - git_change = utils.get_highlight("diffChanged").fg, - } - - -- Define components table. - local components = {} - - -- Mode Component - components.mode = { - init = function (self) - self.mode = vim.fn.mode(1) - end, - static = { - mode_names = { -- change the strings if you like it vvvvverbose! - n = "N", - no = "N?", - nov = "N?", - noV = "N?", - ["no\22"] = "N?", - niI = "Ni", - niR = "Nr", - niV = "Nv", - nt = "Nt", - v = "V", - vs = "Vs", - V = "V_", - Vs = "Vs", - ["\22"] = "^V", - ["\22s"] = "^V", - s = "S", - S = "S_", - ["\19"] = "^S", - i = "I", - ic = "Ic", - ix = "Ix", - R = "R", - Rc = "Rc", - Rx = "Rx", - Rv = "Rv", - Rvc = "Rv", - Rvx = "Rv", - c = "C", - cv = "Ex", - r = "...", - rm = "M", - ["r?"] = "?", - ["!"] = "!", - t = "T", - }, - mode_colors = { - n = "red" , - i = "green", - v = "cyan", - V = "cyan", - ["\22"] = "cyan", - c = "orange", - s = "purple", - S = "purple", - ["\19"] = "purple", - R = "orange", - r = "orange", - ["!"] = "red", - t = "red", - }, - }, - provider = function (self) - return "%2("..self.mode_names[self.mode].."%)" - end, - hl = function(self) - local mode = self.mode:sub(1, 1) -- get only the first mode character - return { fg = self.mode_colors[mode], bold = true, } - end, - update = { - "ModeChanged", - pattern = "*:*", - callback = vim.schedule_wrap(function () - vim.cmd.redrawstatus() - end) - }, - } - - -- Location Component - components.location = { - -- %l = current line number - -- %L = number of lines in the buffer - -- %c = column number - -- %P = percentage through file of displayed window - provider = "%7(%l/%L%): %c", - } - - -- Progress component. - components.progress ={ - static = { - sbar = { '▁', '▂', '▃', '▄', '▅', '▆', '▇', '█' } - -- Another variant, because the more choice the better. - -- sbar = { '🭶', '🭷', '🭸', '🭹', '🭺', '🭻' } - }, - provider = function(self) - local curr_line = vim.api.nvim_win_get_cursor(0)[1] - local lines = vim.api.nvim_buf_line_count(0) - local i = math.floor((curr_line - 1) / lines * #self.sbar) + 1 - return string.rep(self.sbar[i], 2) - end, - hl = { fg = "blue", bg = "light_gray" }, - } - - -- Diagnostics component - vim.diagnostic.config({ - signs = { - text = { - [vim.diagnostic.severity.ERROR] = using_icons and ' ' or "E", - [vim.diagnostic.severity.WARN] = using_icons and ' ' or "W", - [vim.diagnostic.severity.INFO] = using_icons and ' ' or "I", - [vim.diagnostic.severity.HINT] = using_icons and ' ' or "H", - }, - }, - }) - - components.diagnostics = { - condition = conditions.has_diagnostics, - -- Example of defining custom LSP diagnostic icons, you can copypaste in your config: - - init = function(self) - self.errors = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.ERROR }) - self.warnings = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.WARN }) - self.hints = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.HINT }) - self.info = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.INFO }) - end, - - update = { "DiagnosticChanged", "BufEnter" }, - - { - provider = function(self) - -- 0 is just another output, we can decide to print it or not! - -- local error_icon = using_icons and ' ' or "E" - local error_icon = (vim.diagnostic.config()['signs']['text'][vim.diagnostic.severity.ERROR]) or "" - return self.errors > 0 and (error_icon .. self.errors .. " ") - end, - hl = { fg = "diag_error" }, - }, - { - provider = function(self) - -- local warn_icon = using_icons and ' ' or "W" - local warn_icon = (vim.diagnostic.config()['signs']['text'][vim.diagnostic.severity.WARN]) or "" - return self.warnings > 0 and (warn_icon .. self.warnings .. " ") - end, - hl = { fg = "diag_warn" }, - }, - { - provider = function(self) - -- local info_icon = using_icons and ' ' or "I" - local info_icon = (vim.diagnostic.config()['signs']['text'][vim.diagnostic.severity.INFO]) or "" - return self.info > 0 and (info_icon .. self.info .. " ") - end, - hl = { fg = "diag_info" }, - }, - { - provider = function(self) - -- local hint_icon = using_icons and ' ' or "H" - local hint_icon = (vim.diagnostic.config()['signs']['text'][vim.diagnostic.severity.HINT]) or "" - return self.hints > 0 and (hint_icon .. self.hints) - end, - hl = { fg = "diag_hint" }, - }, - } - - -- Working directory component - components.cwd = { - provider = function() - local cwd = vim.fn.getcwd(0) - cwd = vim.fn.fnamemodify(cwd, ":~") - if not conditions.width_percent_below(#cwd, 0.25) then - cwd = vim.fn.pathshorten(cwd) - end - local trail = cwd:sub(-1) == '/' and '' or "/" - return cwd .. trail - end, - hl = { fg = "blue", bold = true }, - } - - -- Git branch component. - components.git_branch = { - -- condition = conditions.is_git_repo, - -- - -- init = function (self) - -- self.branch = vim.b.minigit_summary.head_name or nil - -- end, - - provider = function (self) - local branch = vim.b.minigit_summary.head_name or nil - if branch then - local icon = using_icons and " " or "branch: " - return icon .. branch - else - return "none" - end - end - } - - -- Git status component. - components.git_status = { - condition = conditions.is_git_repo, - - init = function (self) - self.summary = vim.b.minigit_summary and vim.b.minigit_summary.head_name or nil - end, - - { - provider = function (self) - -- Get git summary. - if self.summary == nil then return '' end - - - end, - }, - } - - components.git = { - condition = conditions.is_git_repo, - - init = function(self) - self.status_dict = vim.b.minidiff_summary - print (self.status_dict) - self.head = vim.b.minigit_summary and vim.b.minigit_summary.head_name or "" - self.has_changes = self.status_dict.add ~= 0 or self.status_dict.delete ~= 0 or self.status_dict.change ~= 0 - end, - - hl = { fg = "orange" }, - - { -- git branch name - provider = function(self) - return " " .. self.head - end, - hl = { bold = true } - }, - -- You could handle delimiters, icons and counts similar to Diagnostics - { - condition = function(self) - return self.has_changes - end, - provider = "(" - }, - { - provider = function(self) - local count = self.status_dict.add or 0 - print (count) - return count > 0 and ("+" .. count) - end, - hl = { fg = "git_add" }, - }, - { - provider = function(self) - local count = self.status_dict.delete or 0 - return count > 0 and ("-" .. count) - end, - hl = { fg = "git_del" }, - }, - { - provider = function(self) - local count = self.status_dict.change or 0 - return count > 0 and ("~" .. count) - end, - hl = { fg = "git_change" }, - }, - { - condition = function(self) - return self.has_changes - end, - provider = ")", - }, - } - - -- Spacers - local space = {provider = " "} - local dynamic_space = {provider = "%="} - - -- Assemble statusline. - local statusline = { - components.mode, space, - components.git_branch, space, - components.cwd, space, - components.diagnostics, - - dynamic_space, - - components.location, space, - components.progress, - } - - -- Setup heirline. - require("heirline").setup { - opts = { - colors = colors, - }, - statusline = statusline, - } - end -} diff --git a/pkgs/custom-neovim/config/lua/plugins/mini-statusline.lua b/pkgs/custom-neovim/config/lua/plugins/mini-statusline.lua deleted file mode 100644 index 1edd711..0000000 --- a/pkgs/custom-neovim/config/lua/plugins/mini-statusline.lua +++ /dev/null @@ -1,154 +0,0 @@ -return { - "mini.statusline", - enabled = false, - lazy = false, - after = function() - MiniStatusline = require("mini.statusline") - - local hi_pattern = '%%#%s#%s%%*' - - local custom_sections = { - - git = function(args) - if MiniStatusline.is_truncated(args.trunc_width) then return '' end - - local summary = vim.b.minigit_summary and vim.b.minigit_summary.head_name or nil - if summary == nil then return '' end - - local use_icons = MiniStatusline.config.use_icons - local icon = args.icon or (use_icons and ' ' or 'Git: ') - return " " .. icon .. (summary == '' and '-' or summary) - end, - - diff = function(args) - if MiniStatusline.is_truncated(args.trunc_width) then return '' end - - if not vim.b.minidiff_summary then - return '' - end - - if not vim.b.minidiff_summary.add then - return '' - end - - if not vim.b.minidiff_summary.change then - return '' - end - - if not vim.b.minidiff_summary.delete then - return '' - end - - local use_icons = MiniStatusline.config.use_icons - - local status = {} - - local add_icon = use_icons and " " or "+" - local change_icon = use_icons and " " or "~" - local delete_icon = use_icons and " " or "-" - - local summary = vim.b.minidiff_summary - - if summary.add > 0 then - table.insert(status, hi_pattern:format("Added", ("%s%s"):format(add_icon, summary.add))) - end - - if summary.change > 0 then - table.insert(status, hi_pattern:format("Changed", ("%s%s"):format(change_icon, summary.change))) - end - - if summary.delete > 0 then - table.insert(status, hi_pattern:format("Removed", ("%s%s"):format(delete_icon, summary.delete))) - end - - summary = table.concat(status, " ") - - if summary == "" then return "" end - - local icon = args.icon or (use_icons and '' or 'Diff: ') - return " " .. icon .. (summary == '' and '-' or summary) - end, - - diagnostics = function(args) - if MiniStatusline.is_truncated(args.trunc_width) then return '' end - - local use_icons = MiniStatusline.config.use_icons - - local diagnostics = {} - - local error_icon = use_icons and " " or "E" - local warning_icon = use_icons and " " or "W" - local info_icon = use_icons and " " or "I" - local hint_icon = use_icons and " " or "H" - - local errors = #vim.diagnostic.get(0, { severity = 1 }) - - if errors > 0 then - table.insert(diagnostics, hi_pattern:format("DiagnosticSignError", ("%s%s"):format(error_icon, errors))) - end - - local warnings = #vim.diagnostic.get(0, { severity = 2 }) - - if warnings > 0 then - table.insert(diagnostics, hi_pattern:format("DiagnosticSignWarn", ("%s%s"):format(warning_icon, warnings))) - end - - local infos = #vim.diagnostic.get(0, { severity = 3 }) - - if infos > 0 then - table.insert(diagnostics, hi_pattern:format("DiagnosticSignInfo", ("%s%s"):format(info_icon, infos))) - end - - local hints = #vim.diagnostic.get(0, { severity = 4 }) - - if hints > 0 then - table.insert(diagnostics, hi_pattern:format("DiagnosticSignHint", ("%s%s"):format(hint_icon, hints))) - end - - -- vim.defer_fn(vim.cmd.redrawstatus, 500) - - -- Don't show diagnostics in insert mode. - if MiniStatusline.section_mode({}):find "Insert" then - return "" - end - - local icon = args.icon or (use_icons and '' or 'Diag: ') - - local status = hi_pattern:format("MiniStatuslineFilename", table.concat(diagnostics, " ")) - - if status == "" then return "" end - - return " " .. icon .. status - end, - - location = function() - return '%2l:%-2c' - end - - } - - MiniStatusline.setup { - content = { - active = function() - local mode, mode_hl = MiniStatusline.section_mode({ trunc_width = 120 }) - local git = custom_sections.git({ trunc_width = 40 }) - local diff = custom_sections.diff({ trunc_width = 75 }) - local diagnostics = custom_sections.diagnostics({ trunc_width = 75 }) - local filename = MiniStatusline.section_filename({ trunc_width = 140 }) - local fileinfo = MiniStatusline.section_fileinfo({ trunc_width = 120 }) - local location = custom_sections.location() - - return MiniStatusline.combine_groups({ - { hl = mode_hl, strings = { mode } }, - { hl = 'MiniStatuslineFilename', strings = { git, diff, diagnostics } }, - '%<', -- Mark general truncate point - { hl = 'MiniStatuslineFilename', strings = { filename } }, - '%=', -- End left alignment - { hl = 'MiniStatuslineFilename', strings = { fileinfo } }, - { hl = mode_hl, strings = { location } }, - }) - end - }, - } - end -} diff --git a/pkgs/custom-neovim/todo.md b/pkgs/custom-neovim/todo.md index ea8ae63..3cf7e94 100644 --- a/pkgs/custom-neovim/todo.md +++ b/pkgs/custom-neovim/todo.md @@ -3,3 +3,7 @@ - make comments not continue onto new line - make blink not complete in comments - add split creation to mini.files +- add git commands (add all and status) +- add winbar +- add tab bar +- add noice |
