Skip to content

Commit

Permalink
add nicer windowing commands
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianHicks committed Jan 17, 2020
1 parent 2d8e457 commit b67ab54
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions dotfiles/kakoune.nix
Expand Up @@ -8,6 +8,8 @@ let
};

similar-sort = pkgs.callPackage ../pkgs/similar-sort { };
similar-sort-files-cmd = arg:
"git ls-files --others --cached --exclude-standard | ${similar-sort}/bin/similar-sort ${arg} | fzf --tiebreak index";

# plugins
pluginSources = lib.filterAttrs
Expand Down Expand Up @@ -158,8 +160,9 @@ in {
{
mode = "normal";
key = "<minus>";
effect =
": connect-terminal sh -c %{ edit $(git ls-files --others --cached --exclude-standard | ${similar-sort}/bin/similar-sort $1 | fzf --tiebreak index) } -- %val{bufname}<ret>";
effect = ": connect-terminal sh -c %{ edit $(${
similar-sort-files-cmd "$1"
}) } -- %val{bufname}<ret>";
}
{
mode = "normal";
Expand Down Expand Up @@ -198,6 +201,15 @@ in {
map global surround t ': select-surrounding-tag<ret>' -docstring 'Select tag'
map global user s ':enter-user-mode surround<ret>' -docstring 'Surround'
declare-user-mode window
map global window v ': tmux-terminal-horizontal sh -c %{ kak -c $1 $(${
similar-sort-files-cmd "$2"
}) } -- %val{client_pid} $val{bufname}<ret>' -docstring "vertical split with selection"
map global window s ': tmux-terminal-vertical sh -c %{ kak -c $1 $(${
similar-sort-files-cmd "$2"
}) } -- %val{client_pid} $val{bufname}<ret>' -docstring "horizontal split with selection"
map global user w ': enter-user-mode window<ret>' -docstring 'Windowing'
# escape with fd
hook global InsertChar d %{ try %{
exec -draft hH <a-k>fd<ret> d
Expand Down

0 comments on commit b67ab54

Please sign in to comment.