1
0
Fork 0

nvim: Switch yoink, cutlass and subversive to Lua versions

This commit is contained in:
Daniel Kempkens 2022-04-10 01:07:36 +02:00
parent 63ec52e572
commit 8a7278f701
9 changed files with 62 additions and 50 deletions

View file

@ -106,7 +106,4 @@
(aucmd :TermOpen {:callback (fn []
(vim.opt_local.number false)
(vim.opt_local.relativenumber false))
:group augroup})
(aucmd :TextYankPost {:callback #(vim.highlight.on_yank {:higroup :IncSearch
:timeout 500})
:group augroup})))
:group augroup})))

View file

@ -1,6 +1,7 @@
(let [mod {}
keymap vim.keymap
legendary (require :legendary)
substitute (require :substitute)
telescope (require :telescope)
telescope-builtin (require :telescope.builtin)
telescope-themes (require :telescope.themes)
@ -95,14 +96,16 @@
(keymap.set :i :<A-Right> :<C-o>w {:noremap true})
(keymap.set :i :<S-Left> :<C-o>^ {:noremap true})
(keymap.set :i :<S-Right> :<C-o>$ {:noremap true})
(keymap.set :n :p "<Plug>(YoinkPaste_p)")
(keymap.set :n :P "<Plug>(YoinkPaste_P)")
(keymap.set :x :p "<Plug>(SubversiveSubstitute)")
(keymap.set :x :P "<Plug>(SubversiveSubstitute)")
(keymap.set :n :gp "<Plug>(YoinkPaste_gp)")
(keymap.set :n :gP "<Plug>(YoinkPaste_gP)")
(keymap.set :n :y "<Plug>(YoinkYankPreserveCursorPosition)")
(keymap.set :x :y "<Plug>(YoinkYankPreserveCursorPosition)")
(keymap.set :n :p "<Plug>(YankyPutAfter)")
(keymap.set :n :P "<Plug>(YankyPutBefore)")
(keymap.set :x :p substitute.visual)
(keymap.set :x :P "<Plug>(YankyPutBefore)")
(keymap.set :n :gp "<Plug>(YankyGPutAfter)")
(keymap.set :n :gP "<Plug>(YankyGPutBefore)")
(keymap.set :x :gp "<Plug>(YankyGPutAfter)")
(keymap.set :x :gP "<Plug>(YankyGPutBefore)")
(keymap.set :n :y "<Plug>(YankyYank)")
(keymap.set :x :y "<Plug>(YankyYank)")
(keymap.set :n :<C-t> fterm.toggle {:noremap true :silent true})
(keymap.set :t :<C-t> "<C-\\><C-n><cmd>lua require(\"FTerm\").toggle()<CR>"
{:noremap true :silent true}))

View file

@ -0,0 +1,2 @@
(let [cutlass (require :cutlass)]
(cutlass.setup {:cut_key :x :exclude [:ns :nS]}))

View file

@ -0,0 +1,6 @@
(let [substitute (require :substitute)
yanky (require :yanky)]
(substitute.setup {:on_substitute (fn [event]
(yanky.init_ring :p event.register
event.count
(event.vmode:match "[vV]")))}))

View file

@ -0,0 +1,2 @@
(let [yanky (require :yanky)]
(yanky.setup {:ring {:storage :memory}}))

View file

@ -1,6 +0,0 @@
(let [g vim.g
cmd vim.cmd]
(set g.yoinkIncludeDeleteOperations 1)
(cmd "packadd! vim-cutlass")
(cmd "packadd! vim-yoink")
(cmd "packadd! vim-subversive"))

View file

@ -71,14 +71,22 @@ in
}
{
plugin = vim-yoink;
optional = true;
config = builtins.readFile ../../config/nvim/plugins/yoink.fnl;
plugin = yanky-nvim;
config = builtins.readFile ../../config/nvim/plugins/yanky.fnl;
type = "fennel";
}
{ plugin = vim-cutlass; optional = true; }
{ plugin = vim-subversive; optional = true; }
{
plugin = cutlass-nvim;
config = builtins.readFile ../../config/nvim/plugins/cutlass.fnl;
type = "fennel";
}
{
plugin = substitute-nvim;
config = builtins.readFile ../../config/nvim/plugins/substitute.fnl;
type = "fennel";
}
{
plugin = leap-nvim;

View file

@ -49,41 +49,41 @@
};
meta.homepage = "https://github.com/mrjones2014/legendary.nvim";
};
vim-yoink = pkgs.vimUtils.buildVimPluginFrom2Nix {
pname = "vim-yoink";
version = "1631699595";
yanky-nvim = pkgs.vimUtils.buildVimPluginFrom2Nix {
pname = "yanky.nvim";
version = "1649274039";
src = pkgs.fetchFromGitHub {
owner = "svermeulen";
repo = "vim-yoink";
rev = "89ed6934679fdbc3c20f552b50b1f869f624cd22";
sha256 = "ekGKOYzmdaMqAun/3fRGlhA7bLKuhzsXsEcFNukgFWU=";
owner = "gbprod";
repo = "yanky.nvim";
rev = "1c96ef6d44f6d2a8a034f4eb242ddaa015674d1c";
sha256 = "D4UuAdiQVW/kgIMdNkfso8UvSJGkN1tIkAbEilxreXM=";
fetchSubmodules = true;
};
meta.homepage = "https://github.com/svermeulen/vim-yoink";
meta.homepage = "https://github.com/gbprod/yanky.nvim";
};
vim-cutlass = pkgs.vimUtils.buildVimPluginFrom2Nix {
pname = "vim-cutlass";
version = "1583100466";
cutlass-nvim = pkgs.vimUtils.buildVimPluginFrom2Nix {
pname = "cutlass.nvim";
version = "1647531286";
src = pkgs.fetchFromGitHub {
owner = "svermeulen";
repo = "vim-cutlass";
rev = "7afd649415541634c8ce317fafbc31cd19d57589";
sha256 = "j5W9q905ApDf3fvCIS4UwyHYnEZu5Ictn+6JkV/xjig=";
owner = "gbprod";
repo = "cutlass.nvim";
rev = "b46773268e66ecd371d0b32f17f7a85242475649";
sha256 = "M9Q4wWHv4exOWvp05bierAkzUNlArNGmKendciiiJnA=";
fetchSubmodules = true;
};
meta.homepage = "https://github.com/svermeulen/vim-cutlass";
meta.homepage = "https://github.com/gbprod/cutlass.nvim";
};
vim-subversive = pkgs.vimUtils.buildVimPluginFrom2Nix {
pname = "vim-subversive";
version = "1643202309";
substitute-nvim = pkgs.vimUtils.buildVimPluginFrom2Nix {
pname = "substitute.nvim";
version = "1649272848";
src = pkgs.fetchFromGitHub {
owner = "svermeulen";
repo = "vim-subversive";
rev = "6286cda3f9222bfd490fe34a00a2d8cd4925adec";
sha256 = "V+WHNtR1L2SXtlPaojqcgW4giRY1QrMzvmB+3FvuTtM=";
owner = "gbprod";
repo = "substitute.nvim";
rev = "66379e99812ce5f46aa4810c05460c87b7b40aac";
sha256 = "B0CSMKwRMISfeLJHZuPsiu51BENyZC8I/HhisH+W3Nk=";
fetchSubmodules = true;
};
meta.homepage = "https://github.com/svermeulen/vim-subversive";
meta.homepage = "https://github.com/gbprod/substitute.nvim";
};
leap-nvim = pkgs.vimUtils.buildVimPluginFrom2Nix {
pname = "leap.nvim";

View file

@ -7,9 +7,9 @@
# Keybindings
- src: mrjones2014/legendary.nvim
- src: svermeulen/vim-yoink
- src: svermeulen/vim-cutlass
- src: svermeulen/vim-subversive
- src: gbprod/yanky.nvim
- src: gbprod/cutlass.nvim
- src: gbprod/substitute.nvim
- src: ggandor/leap.nvim
# Themes