From flake to nixvim plugin

This commit is contained in:
Hadi 2024-10-15 03:47:58 +02:00
parent 9f98570ef4
commit 59202f132e
3 changed files with 43 additions and 60 deletions

View File

@ -961,22 +961,6 @@
"url": "https://devimages-cdn.apple.com/design/resources/download/NY.dmg" "url": "https://devimages-cdn.apple.com/design/resources/download/NY.dmg"
} }
}, },
"plugin-markdown": {
"flake": false,
"locked": {
"lastModified": 1728851430,
"narHash": "sha256-0OhVFwIJkpi4HucfyRZ4sJjxyR7vSHGy7+cuzsYW1LM=",
"owner": "MeanderingProgrammer",
"repo": "render-markdown.nvim",
"rev": "317df8708ce0238b142317a42ab55a66a2fa8650",
"type": "github"
},
"original": {
"owner": "MeanderingProgrammer",
"repo": "render-markdown.nvim",
"type": "github"
}
},
"pre-commit-hooks": { "pre-commit-hooks": {
"inputs": { "inputs": {
"flake-compat": "flake-compat", "flake-compat": "flake-compat",
@ -1012,7 +996,6 @@
"nixpkgs": "nixpkgs_6", "nixpkgs": "nixpkgs_6",
"nixvim": "nixvim", "nixvim": "nixvim",
"nixy-wallpapers": "nixy-wallpapers", "nixy-wallpapers": "nixy-wallpapers",
"plugin-markdown": "plugin-markdown",
"sops-nix": "sops-nix", "sops-nix": "sops-nix",
"spicetify-nix": "spicetify-nix", "spicetify-nix": "spicetify-nix",
"stylix": "stylix" "stylix": "stylix"

View File

@ -26,10 +26,6 @@
}; };
hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1"; hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1";
hyprpanel.url = "github:Jas-SinghFSU/HyprPanel"; hyprpanel.url = "github:Jas-SinghFSU/HyprPanel";
plugin-markdown = {
url = "github:MeanderingProgrammer/render-markdown.nvim";
flake = false;
};
nixy-wallpapers = { nixy-wallpapers = {
url = "github:anotherhadi/nixy-wallpapers"; url = "github:anotherhadi/nixy-wallpapers";
flake = false; flake = false;

View File

@ -1,5 +1,5 @@
# The render-markdown.nvim plugin is a plugin that renders markdown files in a neovim in a more readable way. # The render-markdown.nvim plugin is a plugin that renders markdown files in a neovim in a more readable way.
{ pkgs, config, inputs, ... }: { config, ... }:
let let
accent = "#${config.lib.stylix.colors.base0D}"; accent = "#${config.lib.stylix.colors.base0D}";
muted = "#${config.lib.stylix.colors.base03}"; muted = "#${config.lib.stylix.colors.base03}";
@ -85,13 +85,13 @@ in {
modes = "n"; modes = "n";
}; };
MkdnTableNextCell = { MkdnTableNextCell = {
key = "<Tab>"; key = "<S-Tab>";
modes = "i"; modes = "n";
}; };
MkdnTableNextRow = false; MkdnTableNextRow = false;
MkdnTablePrevCell = { MkdnTablePrevCell = {
key = "<S-Tab>"; key = "<S-Tab>";
modes = "i"; modes = "n";
}; };
MkdnTablePrevRow = false; MkdnTablePrevRow = false;
MkdnToggleToDo = { MkdnToggleToDo = {
@ -117,6 +117,7 @@ in {
"ftplugin/markdown.lua".text = '' "ftplugin/markdown.lua".text = ''
vim.opt.tabstop = 2 vim.opt.tabstop = 2
vim.opt.shiftwidth = 2 vim.opt.shiftwidth = 2
vim.opt.expandtab = true
''; '';
}; };
highlight = { highlight = {
@ -130,40 +131,43 @@ in {
RenderMarkdownTodo.fg = muted; RenderMarkdownTodo.fg = muted;
RenderMarkdownWarning.fg = accent; RenderMarkdownWarning.fg = accent;
}; };
extraPlugins = [ plugins.render-markdown = {
(pkgs.vimUtils.buildVimPlugin { enable = true;
name = "markdown.nvim"; settings = {
src = inputs.plugin-markdown;
})
];
extraConfigLua =
# lua
''
require('render-markdown').setup({
heading = { heading = {
icons = { '# ', '󰲣 ', '󰲥 ', '󰲧 ', '󰲩 ', '󰲫 ' }, icons = [ "# " "󰲣 " "󰲥 " "󰲧 " "󰲩 " "󰲫 " ];
backgrounds = { backgrounds = [ "RenderMarkdownBg" ];
'RenderMarkdownBg', foregrounds = [
}, "RenderMarkdownH1"
foregrounds = { "RenderMarkdownH2"
'RenderMarkdownH1', "RenderMarkdownH3"
'RenderMarkdownH2', "RenderMarkdownH4"
'RenderMarkdownH3', "RenderMarkdownH5"
'RenderMarkdownH4', "RenderMarkdownH6"
'RenderMarkdownH5', ];
'RenderMarkdownH6', };
},
},
checkbox = { checkbox = {
unchecked = { highlight = 'RenderMarkdownTodo' }, unchecked = { highlight = "RenderMarkdownTodo"; };
checked = { highlight = 'RenderMarkdownTodo' }, checked = { highlight = "RenderMarkdownTodo"; };
custom = { custom = {
pending = { raw = '[-]', rendered = '󰥔 ', highlight = 'RenderMarkdownTodo' }, pending = {
important = { raw = '[!]', rendered = ' ', highlight = 'RenderMarkdownWarning' }, raw = "[-]";
cancel = { raw = '[/]', rendered = '󱋬 ', highlight = 'RenderMarkdownTodo' }, rendered = "󰥔 ";
}, highlight = "RenderMarkdownTodo";
}, };
}) important = {
''; raw = "[!]";
rendered = " ";
highlight = "RenderMarkdownWarning";
};
cancel = {
raw = "[/]";
rendered = "󱋬 ";
highlight = "RenderMarkdownTodo";
};
};
};
};
};
}; };
} }