mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-20 16:15:43 +02:00
148 lines
3.2 KiB
Nix
148 lines
3.2 KiB
Nix
{
|
|
empty = {
|
|
plugins.lightline.enable = true;
|
|
};
|
|
|
|
defaults = {
|
|
plugins.lightline = {
|
|
enable = true;
|
|
|
|
settings = {
|
|
colorscheme = "default";
|
|
component_function = { };
|
|
component = {
|
|
mode = ''%{lightline#mode()}'';
|
|
absolutepath = "%F";
|
|
relativepath = "%f";
|
|
filename = "%t";
|
|
modified = "%M";
|
|
bufnum = "%n";
|
|
paste = ''%{&paste?"PASTE":""}'';
|
|
readonly = "%R";
|
|
charvalue = "%b";
|
|
charvaluehex = "%B";
|
|
fileencoding = ''%{&fenc!=#""?&fenc:&enc}'';
|
|
fileformat = ''%{&ff}'';
|
|
filetype = ''%{&ft!=#""?&ft:"no ft"}'';
|
|
percent = "%3p%%";
|
|
percentwin = "%P";
|
|
spell = ''%{&spell?&spelllang:""}'';
|
|
lineinfo = ''%3l=%-2c'';
|
|
line = "%l";
|
|
column = "%c";
|
|
close = "%999X X ";
|
|
winnr = ''%{winnr()}'';
|
|
};
|
|
active = {
|
|
left = [
|
|
[
|
|
"mode"
|
|
"paste"
|
|
]
|
|
[
|
|
"readonly"
|
|
"filename"
|
|
"modified"
|
|
]
|
|
];
|
|
right = [
|
|
[ "lineinfo" ]
|
|
[ "percent" ]
|
|
[
|
|
"fileformat"
|
|
"fileencoding"
|
|
"filetype"
|
|
]
|
|
];
|
|
};
|
|
inactive = {
|
|
left = [ [ "filename" ] ];
|
|
right = [
|
|
[ "lineinfo" ]
|
|
[ "percent" ]
|
|
];
|
|
};
|
|
tabline = {
|
|
left = [ [ "tabs" ] ];
|
|
right = [ [ "close" ] ];
|
|
};
|
|
tab = {
|
|
active = [
|
|
"tabnum"
|
|
"filename"
|
|
"modified"
|
|
];
|
|
inactive = [
|
|
"tabnum"
|
|
"filename"
|
|
"modified"
|
|
];
|
|
};
|
|
mode_map = {
|
|
"n" = "NORMAL";
|
|
"i" = "INSERT";
|
|
"R" = "REPLACE";
|
|
"v" = "VISUAL";
|
|
"V" = "V-LINE";
|
|
"\<C-v>" = "V-BLOCK";
|
|
"c" = "COMMAND";
|
|
"s" = "SELECT";
|
|
"S" = "S-LINE";
|
|
"\<C-s>" = "S-BLOCK";
|
|
"t" = "TERMINAL";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
example = {
|
|
extraConfigLua = ''
|
|
function LightlineReadonly()
|
|
local is_readonly = vim.bo.readonly == 1
|
|
local filetype = vim.bo.filetype
|
|
|
|
if is_readonly and filetype ~= "help" then
|
|
return "RO"
|
|
else
|
|
return ""
|
|
end
|
|
end
|
|
'';
|
|
|
|
plugins.lightline = {
|
|
enable = true;
|
|
|
|
settings = {
|
|
colorscheme = "gruvbox";
|
|
component_function = {
|
|
gitbranch = "FugitiveHead";
|
|
readonly = "LightlineReadOnly";
|
|
};
|
|
component = {
|
|
charvaluehex = "0x%B";
|
|
lineinfo = "%3l:%-2v%<";
|
|
};
|
|
active = {
|
|
right = [
|
|
[ "lineinfo" ]
|
|
[ "percent" ]
|
|
[
|
|
"fileformat"
|
|
"fileencoding"
|
|
"filetype"
|
|
"charvaluehex"
|
|
]
|
|
];
|
|
};
|
|
inactive = null;
|
|
mode_map = {
|
|
"n" = "N";
|
|
"i" = "I";
|
|
"v" = "V";
|
|
"<C-v>" = "VB";
|
|
"<C-s>" = "SB";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|