mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-13 18:54:30 +02:00
treewide: Reformat with nixfmt
This commit is contained in:
parent
c6281260dc
commit
62f32bfc71
459 changed files with 28139 additions and 26377 deletions
|
@ -4,38 +4,40 @@
|
|||
config,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
filetypeDefinition =
|
||||
helpers.mkNullOrOption
|
||||
(with types;
|
||||
attrsOf (
|
||||
oneOf [
|
||||
# Raw filetype
|
||||
str
|
||||
# Function to set the filetype
|
||||
helpers.nixvimTypes.rawLua
|
||||
# ["filetype" {priority = xx;}]
|
||||
(listOf (either str (submodule {
|
||||
options = {
|
||||
priority = mkOption {
|
||||
type = int;
|
||||
};
|
||||
};
|
||||
})))
|
||||
]
|
||||
));
|
||||
in {
|
||||
with lib;
|
||||
let
|
||||
filetypeDefinition = helpers.mkNullOrOption (
|
||||
with types;
|
||||
attrsOf (oneOf [
|
||||
# Raw filetype
|
||||
str
|
||||
# Function to set the filetype
|
||||
helpers.nixvimTypes.rawLua
|
||||
# ["filetype" {priority = xx;}]
|
||||
(listOf (
|
||||
either str (submodule {
|
||||
options = {
|
||||
priority = mkOption { type = int; };
|
||||
};
|
||||
})
|
||||
))
|
||||
])
|
||||
);
|
||||
in
|
||||
{
|
||||
options.filetype =
|
||||
helpers.mkCompositeOption ''
|
||||
Define additional filetypes. The values can either be a literal filetype or a function
|
||||
taking the filepath and the buffer number.
|
||||
helpers.mkCompositeOption
|
||||
''
|
||||
Define additional filetypes. The values can either be a literal filetype or a function
|
||||
taking the filepath and the buffer number.
|
||||
|
||||
For more information check `:h vim.filetype.add()`
|
||||
'' {
|
||||
extension = filetypeDefinition "set filetypes matching the file extension";
|
||||
filename = filetypeDefinition "set filetypes matching the file name (or path)";
|
||||
pattern = filetypeDefinition "set filetypes matching the specified pattern";
|
||||
};
|
||||
For more information check `:h vim.filetype.add()`
|
||||
''
|
||||
{
|
||||
extension = filetypeDefinition "set filetypes matching the file extension";
|
||||
filename = filetypeDefinition "set filetypes matching the file name (or path)";
|
||||
pattern = filetypeDefinition "set filetypes matching the specified pattern";
|
||||
};
|
||||
|
||||
config.extraConfigLua = helpers.mkIfNonNull' config.filetype ''
|
||||
vim.filetype.add(${helpers.toLuaObject config.filetype})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue