Created initial assets
This commit is contained in:
@@ -0,0 +1,7 @@
|
|||||||
|
_loki_bash() {
|
||||||
|
if [[ -n "$READLINE_LINE" ]]; then
|
||||||
|
READLINE_LINE=$(loki -e "$READLINE_LINE")
|
||||||
|
READLINE_POINT=${#READLINE_LINE}
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
bind -x '"\ee": _loki_bash'
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
function _loki_fish
|
||||||
|
set -l _old (commandline)
|
||||||
|
if test -n $_old
|
||||||
|
echo -n "⌛"
|
||||||
|
commandline -f repaint
|
||||||
|
commandline (loki -e $_old)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
bind \ee _loki_fish
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
def _loki_nushell [] {
|
||||||
|
let _prev = (commandline)
|
||||||
|
if ($_prev != "") {
|
||||||
|
print '⌛'
|
||||||
|
commandline edit -r (loki -e $_prev)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$env.config.keybindings = ($env.config.keybindings | append {
|
||||||
|
name: loki_integration
|
||||||
|
modifier: alt
|
||||||
|
keycode: char_e
|
||||||
|
mode: [emacs, vi_insert]
|
||||||
|
event:[
|
||||||
|
{
|
||||||
|
send: executehostcommand,
|
||||||
|
cmd: "_loki_nushell"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
)
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
Set-PSReadLineKeyHandler -Chord "alt+e" -ScriptBlock {
|
||||||
|
$_old = $null
|
||||||
|
[Microsoft.PowerShell.PSConsoleReadline]::GetBufferState([ref]$_old, [ref]$null)
|
||||||
|
if ($_old) {
|
||||||
|
[Microsoft.PowerShell.PSConsoleReadLine]::Insert('⌛')
|
||||||
|
$_new = (loki -e $_old)
|
||||||
|
[Microsoft.PowerShell.PSConsoleReadLine]::DeleteLine()
|
||||||
|
[Microsoft.PowerShell.PSConsoleReadline]::Insert($_new)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
_loki_zsh() {
|
||||||
|
if [[ -n "$BUFFER" ]]; then
|
||||||
|
local _old=$BUFFER
|
||||||
|
BUFFER+="⌛"
|
||||||
|
zle -I && zle redisplay
|
||||||
|
BUFFER=$(loki -e "$_old")
|
||||||
|
zle end-of-line
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
zle -N _loki_zsh
|
||||||
|
bindkey '\ee' _loki_zsh
|
||||||
Reference in New Issue
Block a user