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 [] (aucmd :TermOpen {:callback (fn []
(vim.opt_local.number false) (vim.opt_local.number false)
(vim.opt_local.relativenumber false)) (vim.opt_local.relativenumber false))
:group augroup}) :group augroup})))
(aucmd :TextYankPost {:callback #(vim.highlight.on_yank {:higroup :IncSearch
:timeout 500})
:group augroup})))

View file

@ -1,6 +1,7 @@
(let [mod {} (let [mod {}
keymap vim.keymap keymap vim.keymap
legendary (require :legendary) legendary (require :legendary)
substitute (require :substitute)
telescope (require :telescope) telescope (require :telescope)
telescope-builtin (require :telescope.builtin) telescope-builtin (require :telescope.builtin)
telescope-themes (require :telescope.themes) telescope-themes (require :telescope.themes)
@ -95,14 +96,16 @@
(keymap.set :i :<A-Right> :<C-o>w {:noremap true}) (keymap.set :i :<A-Right> :<C-o>w {:noremap true})
(keymap.set :i :<S-Left> :<C-o>^ {:noremap true}) (keymap.set :i :<S-Left> :<C-o>^ {:noremap true})
(keymap.set :i :<S-Right> :<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>(YankyPutAfter)")
(keymap.set :n :P "<Plug>(YoinkPaste_P)") (keymap.set :n :P "<Plug>(YankyPutBefore)")
(keymap.set :x :p "<Plug>(SubversiveSubstitute)") (keymap.set :x :p substitute.visual)
(keymap.set :x :P "<Plug>(SubversiveSubstitute)") (keymap.set :x :P "<Plug>(YankyPutBefore)")
(keymap.set :n :gp "<Plug>(YoinkPaste_gp)") (keymap.set :n :gp "<Plug>(YankyGPutAfter)")
(keymap.set :n :gP "<Plug>(YoinkPaste_gP)") (keymap.set :n :gP "<Plug>(YankyGPutBefore)")
(keymap.set :n :y "<Plug>(YoinkYankPreserveCursorPosition)") (keymap.set :x :gp "<Plug>(YankyGPutAfter)")
(keymap.set :x :y "<Plug>(YoinkYankPreserveCursorPosition)") (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 :n :<C-t> fterm.toggle {:noremap true :silent true})
(keymap.set :t :<C-t> "<C-\\><C-n><cmd>lua require(\"FTerm\").toggle()<CR>" (keymap.set :t :<C-t> "<C-\\><C-n><cmd>lua require(\"FTerm\").toggle()<CR>"
{:noremap true :silent true})) {: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; plugin = yanky-nvim;
optional = true; config = builtins.readFile ../../config/nvim/plugins/yanky.fnl;
config = builtins.readFile ../../config/nvim/plugins/yoink.fnl;
type = "fennel"; 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; plugin = leap-nvim;

View file

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

View file

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