diff --git a/pkgs/nixvim/ui.nix b/pkgs/nixvim/ui.nix deleted file mode 100644 index d933f88..0000000 --- a/pkgs/nixvim/ui.nix +++ /dev/null @@ -1,9 +0,0 @@ -{...}: { - colorschemes.gruvbox-material = { - enable = true; - autoLoad = true; - }; - plugins = { - bufferline.enable = true; - }; -} diff --git a/pkgs/nixvim/ui/bufferline.nix b/pkgs/nixvim/ui/bufferline.nix new file mode 100644 index 0000000..109272a --- /dev/null +++ b/pkgs/nixvim/ui/bufferline.nix @@ -0,0 +1,69 @@ +{...}: { + youthlic.plugins.bufferline = { + enable = true; + settings = { + options = { + close_command = { + __raw = + #lua + '' + function(n) + Snacks.bufdelete(n) + end + ''; + }; + right_mouse_command = { + __raw = + #lua + '' + function(n) + Snacks.bufdelete(n) + end + ''; + }; + diagnostics = "nvim_lsp"; + always_show_bufferline = false; + diagnostics_indicator = { + __raw = + #lua + '' + function(_, _, diag) + local icons = { + Error = " ", + Warn = " ", + Hint = " ", + Info = " ", + } + local ret = (diag.error and icons.Error .. diag.error .. " " or "") + .. (diag.warning and icons.Warn .. diag.warning or "") + return vim.trim(ret) + end + ''; + }; + offsets = [ + { + filetype = "neo-tree"; + text = "Neo-tree"; + highlight = "Directory"; + text_align = "left"; + } + { + filetype = "snacks_layout_box"; + } + ]; + get_element_icon = { + __raw = + #lua + '' + function(opts) + local icons = { + octo = "", + } + return icons[opts.filetype] + end + ''; + }; + }; + }; + }; +} diff --git a/pkgs/nixvim/ui/colorschemes.nix b/pkgs/nixvim/ui/colorschemes.nix new file mode 100644 index 0000000..81523cf --- /dev/null +++ b/pkgs/nixvim/ui/colorschemes.nix @@ -0,0 +1,7 @@ +{...}: { + colorschemes.gruvbox = { + enable = true; + settings = { + }; + }; +} diff --git a/pkgs/nixvim/ui/lualine.nix b/pkgs/nixvim/ui/lualine.nix new file mode 100644 index 0000000..4925ee2 --- /dev/null +++ b/pkgs/nixvim/ui/lualine.nix @@ -0,0 +1,21 @@ +{...}: { + youthlic.plugins.lualine = { + enable = true; + luaConfig.pre = + #lua + '' + do + vim.g.lualine_laststatus = vim.o.laststatus + if vim.fn.argc(-1) > 0 then + vim.o.statusline = " " + else + vim.o.laststatus = 0 + end + end + do + vim.o.laststatus = vim.g.lualine_laststatus + end + ''; + settings = {}; + }; +}