plugin/theme: setup optional tabline plugin
This commit is contained in:
parent
f0ebb7f846
commit
a686e4b253
5 changed files with 26 additions and 14 deletions
13
default.nix
13
default.nix
|
@ -3,18 +3,21 @@
|
|||
let
|
||||
lib = import ./lib.nix;
|
||||
|
||||
callPlugins = list: builtins.map (p: import p vimPlugins) list;
|
||||
pluginParams = vimPlugins // { inherit lib; };
|
||||
|
||||
callPlugin = op: if builtins.isFunction op then op pluginParams else import op pluginParams;
|
||||
callPlugins = list: builtins.map callPlugin list;
|
||||
|
||||
plugins = callPlugins [
|
||||
./plugins/syntax
|
||||
./plugins/explorer
|
||||
./plugins/theme
|
||||
(import ./plugins/theme { enableTabline = false; })
|
||||
./plugins/lsp
|
||||
./plugins/formatter
|
||||
];
|
||||
|
||||
basicConfigs = map builtins.readFile [ ./config/basic.lua ];
|
||||
pluginConfigs = lib.extractAttrs "luaConfig" plugins;
|
||||
basicConfigs = builtins.map builtins.readFile [ ./config/basic.lua ];
|
||||
pluginConfigs = builtins.catAttrs "luaConfig" plugins;
|
||||
allConfigs = basicConfigs ++ pluginConfigs;
|
||||
in
|
||||
wrapNeovim neovim-unwrapped {
|
||||
|
@ -25,6 +28,6 @@ wrapNeovim neovim-unwrapped {
|
|||
configure = {
|
||||
customRC = lib.mkLuaRc allConfigs;
|
||||
|
||||
packages.myVimPackages = { start = lib.extractAttrs "plugins" plugins; };
|
||||
packages.myVimPackages = { start = builtins.catAttrs "plugins" plugins; };
|
||||
};
|
||||
}
|
||||
|
|
14
lib.nix
14
lib.nix
|
@ -19,13 +19,17 @@ rec {
|
|||
in
|
||||
foldr concat "" list;
|
||||
|
||||
extractAttrs = attr: list:
|
||||
############################################################################
|
||||
# Configs
|
||||
|
||||
optional = cond: val:
|
||||
let
|
||||
getAttr' = builtins.getAttr attr;
|
||||
hasAttr' = builtins.hasAttr attr;
|
||||
filteredList = builtins.filter hasAttr' list;
|
||||
def =
|
||||
if builtins.isList val then [ ]
|
||||
else if builtins.isString val then ""
|
||||
else null;
|
||||
in
|
||||
builtins.map getAttr' filteredList;
|
||||
if cond then val else def;
|
||||
|
||||
#############################################################################
|
||||
# Lua
|
||||
|
|
|
@ -7,5 +7,5 @@ vim.g.loaded_netrwPlugin = 1
|
|||
-- empty setup using defaults
|
||||
require("nvim-tree").setup()
|
||||
|
||||
vim.keymap.set("n", "<leader>nt", ":NvimTreeFocus<CR>")
|
||||
vim.keymap.set("n", "<leader>nt", ":NvimTreeToggle<CR>")
|
||||
vim.keymap.set("n", "<leader>nf", ":NvimTreeFindFile<CR>")
|
||||
|
|
|
@ -1,13 +1,16 @@
|
|||
{ catppuccin-nvim, lualine-nvim, lualine-lsp-progress, ... }:
|
||||
{ enableTabline ? false }:
|
||||
|
||||
{ lib, catppuccin-nvim, lualine-nvim, lualine-lsp-progress, tabline-nvim, ... }:
|
||||
|
||||
{
|
||||
luaConfig = (builtins.readFile ./catppuccin-nvim.lua)
|
||||
+ (builtins.readFile ./lualine.lua);
|
||||
+ (builtins.readFile ./lualine.lua)
|
||||
+ (lib.optional enableTabline (builtins.readFile ./tabline.lua));
|
||||
|
||||
plugins = [
|
||||
catppuccin-nvim
|
||||
|
||||
lualine-nvim
|
||||
lualine-lsp-progress
|
||||
];
|
||||
] ++ (lib.optional enableTabline [ tabline-nvim ]);
|
||||
}
|
||||
|
|
2
plugins/theme/tabline.lua
Normal file
2
plugins/theme/tabline.lua
Normal file
|
@ -0,0 +1,2 @@
|
|||
-- See: https://github.com/kdheepak/tabline.nvim
|
||||
require("tabline").setup({})
|
Reference in a new issue