Neovim: Add markdown local bindings + make latex bindings buffer-local
This commit is contained in:
@ -108,7 +108,8 @@ in {
|
||||
|
||||
extraFiles = {
|
||||
# For this its probably important to set the default filetype to tex (see extraConfigLua)
|
||||
"ftplugin/tex.lua".text = mylib.generators.toLuaKeymap (import ./mappings_latex.nix {});
|
||||
"ftplugin/tex/mappings.lua".text = mylib.generators.toLuaKeymap (import ./mappings_latex.nix {});
|
||||
"ftplugin/markdown/mappings.lua".text = mylib.generators.toLuaKeymap (import ./mappings_markdown.nix {});
|
||||
};
|
||||
|
||||
# extraLuaPackages = with pkgs.lua51Packages; [];
|
||||
@ -833,7 +834,7 @@ in {
|
||||
# };
|
||||
};
|
||||
|
||||
# NOTE: This entire thing is rough, maybe I should look for another way...
|
||||
# NOTE: This entire thing is rough, I should rewrite...
|
||||
lspconfig = {
|
||||
name = "lspconfig";
|
||||
pkg = pkgs.vimPlugins.nvim-lspconfig;
|
||||
@ -1008,6 +1009,15 @@ in {
|
||||
'';
|
||||
};
|
||||
|
||||
ltex-extra = rec {
|
||||
name = "ltex_extra";
|
||||
pkg = pkgs.vimPlugins.ltex_extra-nvim;
|
||||
lazy = true;
|
||||
ft = ["markdown" "tex"];
|
||||
dependencies = [lspconfig];
|
||||
config = mkDefaultConfig name;
|
||||
};
|
||||
|
||||
markview = {
|
||||
name = "markview";
|
||||
pkg = pkgs.vimPlugins.markview-nvim;
|
||||
@ -1718,6 +1728,7 @@ in {
|
||||
|
||||
luasnip # Snippets # TODO: How to add snippets, maybe use luasnip from nixvim directly?
|
||||
|
||||
ltex-extra # Additional ltex lsp support, e.g. for add-to-dictionary action
|
||||
markview # Markdown support
|
||||
# narrow-region # Open a buffer restricted to the selection
|
||||
navbuddy # Structural file view
|
||||
|
@ -4,47 +4,55 @@
|
||||
key = "<localleader>t";
|
||||
action = "<cmd>VimtexTocToggle<cr>";
|
||||
options.desc = "Vimtex ToC";
|
||||
options.buffer = true;
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<localleader>c";
|
||||
action = "<cmd>VimtexCompile<cr>";
|
||||
options.desc = "Vimtex Compile";
|
||||
options.buffer = true;
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<localleader>C";
|
||||
action = "<cmd>VimtexClean!<cr>";
|
||||
options.desc = "Vimtex Clean";
|
||||
options.buffer = true;
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<localleader>v";
|
||||
action = "<cmd>VimtexView<cr>";
|
||||
options.desc = "Vimtex View";
|
||||
options.buffer = true;
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<localleader>I";
|
||||
action = "<cmd>VimtexInfo<cr>";
|
||||
options.desc = "Vimtex Info";
|
||||
options.buffer = true;
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<localleader>,";
|
||||
action = "<cmd>VimtexContextMenu<cr>";
|
||||
options.desc = "Vimtex Context Menu";
|
||||
options.buffer = true;
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<localleader>e";
|
||||
action = "<cmd>VimtexErrors<cr>";
|
||||
options.desc = "Vimtex Errors";
|
||||
options.buffer = true;
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<localleader>p";
|
||||
action = "<cmd>VimtexDocPackage<cr>";
|
||||
options.desc = "Vimtex Package Docs";
|
||||
options.buffer = true;
|
||||
}
|
||||
]
|
||||
|
16
home/modules/neovim/mappings_markdown.nix
Normal file
16
home/modules/neovim/mappings_markdown.nix
Normal file
@ -0,0 +1,16 @@
|
||||
{...}: [
|
||||
{
|
||||
mode = "n";
|
||||
key = "<localleader>t";
|
||||
action = "<cmd>Markview toggle<cr>";
|
||||
options.desc = "Toggle Conceal";
|
||||
options.buffer = true;
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<localleader>s";
|
||||
action = "<cmd>Markview splitToggle<cr>";
|
||||
options.desc = "Toggle Split";
|
||||
options.buffer = true;
|
||||
}
|
||||
]
|
Reference in New Issue
Block a user