mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-05 18:01:32 +00:00
feat: drop venn-nvim
This commit is contained in:
parent
7bf6594755
commit
c749a7fe59
8 changed files with 0 additions and 84 deletions
|
@ -7,7 +7,6 @@ _: {
|
|||
./colorizer
|
||||
./icon-picker
|
||||
./telescope
|
||||
./venn
|
||||
./diffview
|
||||
];
|
||||
}
|
||||
|
|
|
@ -1,42 +0,0 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
with builtins; let
|
||||
cfg = config.vim.utility.venn-nvim;
|
||||
in {
|
||||
config = mkIf (cfg.enable) {
|
||||
vim.startPlugins = [
|
||||
"venn-nvim"
|
||||
];
|
||||
|
||||
# TODO: https://github.com/jbyuki/venn.nvim#using-toggle-command
|
||||
# add keybindings for drawing diagrams
|
||||
vim.luaConfigRC.venn-nvim = nvim.dag.entryAnywhere ''
|
||||
local venn = require('venn')
|
||||
-- venn.nvim: enable or disable keymappings
|
||||
function _G.Toggle_venn()
|
||||
local venn_enabled = vim.inspect(vim.b.venn_enabled)
|
||||
if venn_enabled == "nil" then
|
||||
vim.b.venn_enabled = true
|
||||
vim.cmd[[setlocal ve=all]]
|
||||
-- draw a line on HJKL keystokes
|
||||
vim.api.nvim_buf_set_keymap(0, "n", "J", "<C-v>j:VBox<CR>", {noremap = true})
|
||||
vim.api.nvim_buf_set_keymap(0, "n", "K", "<C-v>k:VBox<CR>", {noremap = true})
|
||||
vim.api.nvim_buf_set_keymap(0, "n", "L", "<C-v>l:VBox<CR>", {noremap = true})
|
||||
vim.api.nvim_buf_set_keymap(0, "n", "H", "<C-v>h:VBox<CR>", {noremap = true})
|
||||
-- draw a box by pressing "f" with visual selection
|
||||
vim.api.nvim_buf_set_keymap(0, "v", "f", ":VBox<CR>", {noremap = true})
|
||||
else
|
||||
vim.cmd[[setlocal ve=]]
|
||||
vim.cmd[[mapclear <buffer>]]
|
||||
vim.b.venn_enabled = nil
|
||||
end
|
||||
end
|
||||
-- toggle keymappings for venn using <leader>v
|
||||
vim.api.nvim_set_keymap('n', '<leader>v', ":lua Toggle_venn()<CR>", { noremap = true})
|
||||
'';
|
||||
};
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
_: {
|
||||
imports = [
|
||||
./config.nix
|
||||
./venn.nix
|
||||
];
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
with builtins; {
|
||||
options.vim.utility.venn-nvim = {
|
||||
enable = mkEnableOption "Enable venn.nvim: draw ASCII diagrams in Neovim";
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue