Added move lines kakoune plugin.
This commit is contained in:
parent
c6ce818c63
commit
3770e76f05
|
|
@ -77,10 +77,15 @@
|
|||
|
||||
# don't remove trailing indent
|
||||
set global disabled_hooks .*-trim-indent
|
||||
|
||||
source ${pkgs.writeText "kakoune-divider.kak" (builtins.readFile ./kakoune/divider.kak)}
|
||||
set-option global divider_face LineNumbers
|
||||
divider-on 80
|
||||
|
||||
source ${pkgs.writeText "move-lines.kak" (builtins.readFile ./kakoune/move-lines.kak)}
|
||||
map global normal <c-s-j> ': move-lines-down %val{count}<ret>'
|
||||
map global normal <c-s-k> ': move-lines-up %val{count}<ret>'
|
||||
|
||||
# byline enables extending selection with x
|
||||
require-module byline
|
||||
|
||||
|
|
|
|||
13
snippets/kakoune/move-lines.kak
Normal file
13
snippets/kakoune/move-lines.kak
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
define-command move-lines-down \
|
||||
-docstring 'move-lines-down [<count>] move selected lines down by <count> or one line' \
|
||||
-params ..1 \
|
||||
%{
|
||||
execute-keys -draft "x<a-_><a-:>Z;ez;%arg{1}J<a-;>LxdzP"
|
||||
}
|
||||
|
||||
define-command move-lines-up \
|
||||
-docstring 'move-lines-up [<count>] move selected lines up by <count> or one line' \
|
||||
-params ..1 \
|
||||
%{
|
||||
execute-keys -draft "x<a-_><a-:><a-;>Z;bz;%arg{1}K<a-;>Hxdzp"
|
||||
}
|
||||
Loading…
Reference in a new issue