From: Andre Ramnitz Date: Thu, 28 Dec 2023 14:56:30 +0000 (+0100) Subject: kak/bash/fish: back to kks shell integration X-Git-Tag: v0.2~266 X-Git-Url: https://git.ramnitz.eu/?a=commitdiff_plain;h=b443b34ef4e2bcb7314a449aa3aee9d0c36d0a61;p=dotfiles.git kak/bash/fish: back to kks shell integration --- diff --git a/config/fish/fish_variables b/config/fish/fish_variables index d5b57ecc..10efd7b3 100644 --- a/config/fish/fish_variables +++ b/config/fish/fish_variables @@ -1,6 +1,6 @@ # This file contains fish universal variable definitions. # VERSION: 3.0 -SETUVAR --export EDITOR:kcr\x20edit +SETUVAR --export EDITOR:kks\x20edit SETUVAR --export FZF_DEFAULT_OPTS:--multi\x20--layout=reverse\x20--preview-window=down:60% SETUVAR --export KCR_DEFAULT_SESSION:default SETUVAR --export VDPAU_DRIVER:radeonsi @@ -37,4 +37,4 @@ SETUVAR fish_pager_color_description:B3A06D\x1eyellow SETUVAR fish_pager_color_prefix:normal\x1e\x2d\x2dbold\x1e\x2d\x2dunderline SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan SETUVAR fish_pager_color_selected_background:\x2d\x2dbackground\x3dbrblack -SETUVAR fish_user_paths:/home/andy/Applications\x1e/opt/android\x2dsdk/platform\x2dtools\x1e/home/andy/\x2ecargo/bin\x1e/home/andy/\x2elocal/bin +SETUVAR fish_user_paths:/home/andy/go/bin\x1e/home/andy/Applications\x1e/opt/android\x2dsdk/platform\x2dtools\x1e/home/andy/\x2ecargo/bin\x1e/home/andy/\x2elocal/bin diff --git a/config/fish/functions/:cat.fish b/config/fish/functions/:cat.fish deleted file mode 100644 index c82ad689..00000000 --- a/config/fish/functions/:cat.fish +++ /dev/null @@ -1,3 +0,0 @@ -function :cat --wraps='kcr cat --raw' --description 'alias :cat=kcr cat --raw' - kcr cat --raw $argv; -end diff --git a/config/fish/functions/K.fish b/config/fish/functions/K.fish deleted file mode 100644 index bf4cb136..00000000 --- a/config/fish/functions/K.fish +++ /dev/null @@ -1,3 +0,0 @@ -function K --wraps=kcr-fzf-shell --description 'alias K=kcr-fzf-shell' - kcr-fzf-shell $argv; -end diff --git a/config/fish/functions/a.fish b/config/fish/functions/a.fish deleted file mode 100644 index 1e2c651b..00000000 --- a/config/fish/functions/a.fish +++ /dev/null @@ -1,3 +0,0 @@ -function a --wraps='kcr attach' --description 'alias a=kcr attach' - kcr attach $argv; -end diff --git a/config/fish/functions/k.fish b/config/fish/functions/k.fish index ad41f0dd..fd78e07f 100644 --- a/config/fish/functions/k.fish +++ b/config/fish/functions/k.fish @@ -1,3 +1,3 @@ -function k --wraps='kks edit' --wraps='kcr attach' --wraps='kcr edit' --description 'alias k=kcr edit' - kcr edit $argv; +function k --wraps='kks edit' --description 'alias k=kks edit' + kks edit $argv; end diff --git a/config/fish/functions/ka.fish b/config/fish/functions/ka.fish new file mode 100644 index 00000000..acb3ce44 --- /dev/null +++ b/config/fish/functions/ka.fish @@ -0,0 +1,3 @@ +function ka --wraps='kks attach' --description 'alias ka=kks attach' + kks attach $argv; +end diff --git a/config/fish/functions/kcd.fish b/config/fish/functions/kcd.fish new file mode 100644 index 00000000..eaf3ee68 --- /dev/null +++ b/config/fish/functions/kcd.fish @@ -0,0 +1,3 @@ +function kcd --wraps='cd $(kks get %sh{pwd})' --description 'alias kcd=cd $(kks get %sh{pwd})' + cd $(kks get %sh{pwd}) $argv; +end diff --git a/config/fish/functions/kkd.fish b/config/fish/functions/kkd.fish new file mode 100644 index 00000000..58e7dbce --- /dev/null +++ b/config/fish/functions/kkd.fish @@ -0,0 +1,3 @@ +function kkd --wraps='kks kill; unset KKS_SESSION KKS_CLIENT' --description 'alias kkd=kks kill; unset KKS_SESSION KKS_CLIENT' + kks kill; unset KKS_SESSION KKS_CLIENT $argv; +end diff --git a/config/fish/functions/kl.fish b/config/fish/functions/kl.fish deleted file mode 100644 index a9dda47f..00000000 --- a/config/fish/functions/kl.fish +++ /dev/null @@ -1,3 +0,0 @@ -function kl --wraps='kcr list' --description 'alias kl=kcr list' - kcr list $argv; -end diff --git a/config/fish/functions/ks.fish b/config/fish/functions/ks.fish index 63d3f45d..a6205821 100644 --- a/config/fish/functions/ks.fish +++ b/config/fish/functions/ks.fish @@ -1,3 +1,3 @@ -function ks --wraps='kcr shell --session' --description 'alias ks=kcr shell --session' - kcr shell --session $argv; +function ks --wraps='eval $(kks-select)' --description 'alias ks=eval $(kks-select)' + eval $(kks-select) $argv; end diff --git a/config/kak/kakrc b/config/kak/kakrc index f73aa449..8a0e1943 100644 --- a/config/kak/kakrc +++ b/config/kak/kakrc @@ -23,7 +23,7 @@ plug "andreyorst/plug.kak" noload plug "occivink/kakoune-sudo-write" plug "occivink/kakoune-find" plug "foot.kak" - plug "https://git.sr.ht/~nasmevka/dabruin.kak" + plug "https://git.sr.ht/~nasmevka/dabruin.kak" noload plug "andreyorst/powerline.kak" defer powerline_freerunner %{ powerline-format global 'mode_info git bufname session client line_column position ' powerline-theme freerunner @@ -126,12 +126,22 @@ map global goto m 'm;' -docstring 'matching char' map global normal ': inc %val{count} +' map global normal ': inc %val{count} -' +# kks mappings +# ────────────────────────────────────────────────────────────────────────────── +map global normal -docstring 'terminal' ': kks-connect terminal' +map global normal -docstring 'files' ': kks-connect terminal-popup kks-files' +map global normal -docstring 'buffers' ': kks-connect terminal-popup kks-buffers' +map global normal -docstring 'buffers' ': kks-connect terminal-popup kks-buffers' +map global normal -docstring 'live grep' ': kks-connect terminal-popup kks-grep' +map global normal -docstring 'lines in buffer' ': kks-connect terminal-popup kks-lines' +map global normal -docstring 'recent files' ': kks-connect terminal-popup kks-mru' +map global normal -docstring 'vcs client' ': kks-connect terminal-popup lazygit' +map global normal -docstring 'file browser' ': kks-connect terminal-panel kks-lf' + # default user mode # ────────────────────────────────────────────────────────────────────────────── map global user -docstring 'Buffer mode' b ':enter-user-mode buffermode' map global user -docstring 'Selection mode' s ':enter-user-mode selectionmode' -#map global user -docstring 'bookMarks mode' m ':enter-user-mode bookmarks' - map global user -docstring 'edit kakrc' e ': e ~/.config/kak/kakrc' # buffer user mode @@ -147,6 +157,7 @@ map global buffermode -docstring 'clean tabs and trailing whitespace in the buff map global buffermode -docstring 'wrap enable' w ': add-highlighter buffer/bw wrap' map global buffermode -docstring 'wrap disable' W ': remove-highlighter buffer/bw' + # selection user mode # ────────────────────────────────────────────────────────────────────────────── declare-user-mode selectionmode @@ -176,22 +187,9 @@ hook global BufOpenFile .* %{ # session manager # ────────────────────────────────────────────────────────────────────────────── evaluate-commands %sh{ - kcr init kakoune + kks init } -# kakoune.cr Mappings -map -docstring 'new client' global normal ': new' -map -docstring 'terminal (popup)' global normal ': connect terminal-popup' -map -docstring 'git (popup)' global normal ': connect terminal-popup gitui' -#map -docstring 'file explorer' global normal ': connect terminal-panel sidetree --select %val{buffile}' -map -docstring 'file picker' global normal ': connect terminal-popup kcr fzf files' -map -docstring 'buffer picker' global normal ': connect terminal-popup kcr fzf buffers' -map global normal -unmap global normal -map -docstring 'buffer picker' global normal ': connect terminal-popup kcr fzf buffers' -map -docstring 'grep picker' global normal ': connect terminal-popup kcr fzf grep' -#map -docstring 'grep picker (buffer)' global normal ': connect terminal-popup kcr fzf grep %val{buflist}' - # Reload kakrc and .kak when saving. # ────────────────────────────────────────────────────────────────────────────── diff --git a/home/.bashrc b/home/.bashrc index 6603ba09..eda3817e 100644 --- a/home/.bashrc +++ b/home/.bashrc @@ -7,11 +7,13 @@ # anything or bad things will happen ! export PATH="$PATH:/opt/android-sdk/platform-tools/" -export PATH="$PATH:~/.cargo/bin:~/.local/bin:~/Applications/" +export PATH="$PATH:~/go/bin:~/.cargo/bin:~/.local/bin:~/Applications/" export BROWSER='qutebrowser "--untrusted-args %u"' export EDITOR="kks edit" -export PAGER="less" +export KKS_DEFAULT_SESSION='default' +export KKS_USE_GITDIR_SESSIONS=1 +export PAGER="bat" export VDPAU_DRIVER="radeonsi" export XZ_OPT="--threads=16"