fish: beam on insert mode and other neat stuff

This commit is contained in:
lelgenio 2020-04-24 20:21:12 -03:00
parent 9650b5de02
commit b680e84274

View file

@ -25,35 +25,56 @@ command -qs exa &&
abbr gs git status abbr gs git status
abbr gp 'git pull; git push' abbr gp 'git pull; git push'
function edit-config
function fish_edit_commandline #{{{
set file (mktemp)
commandline -b > $file
nvim +'set ft=fish' $file
commandline -r (cat $file)
end
bind -M insert \cx fish_edit_commandline
#}}}
function edit-config #{{{
cd ~/.config cd ~/.config
set file ~/.config/( fzf ) set file ~/.config/( fzf )
cd - cd -
if test -f "$file" if test -f "$file"
nvim $file commandline -r nvim\ $file
end end
end end
abbr ec edit-config abbr ec edit-config
#}}}
# alias mutt #{{{
function mutt --wraps=neomutt --description 'alias mutt=neomutt' function mutt --wraps=neomutt --description 'alias mutt=neomutt'
neomutt $argv; neomutt $argv;
pkill -RTMIN+4 waybar pkill -RTMIN+4 waybar
end end
abbr neomutt mutt abbr neomutt mutt
#}}}
function rcd #{{{
function rcd
set file (mktemp) set file (mktemp)
ranger $argv --choosedir=$file ranger $argv --choosedir=$file
cd (cat $file) cd (cat $file)
rm $file rm $file
clear
ls
fish_prompt
end end
abbr r rcd # force-repaint to redraw prompt
bind -M insert \co rcd
#}}}
function etc #{{{
cd /etc/
set file /etc/(fzf)
cd -
test -f "$file"
and sudo nvim $file
end
#}}}
# }}} # }}}
# start window manager if using tty1 {{{ # start window manager if using tty1 {{{
# #
@ -123,14 +144,19 @@ abbr r rcd
set SPACEFISH_CHAR_SYMBOL '$' set SPACEFISH_CHAR_SYMBOL '$'
set SPACEFISH_CHAR_SYMBOL_ROOT '#' set SPACEFISH_CHAR_SYMBOL_ROOT '#'
set SPACEFISH_VI_MODE_PREFIX "" set SPACEFISH_VI_MODE_PREFIX "\e[1 q"
set SPACEFISH_VI_MODE_SUFIX "" set SPACEFISH_VI_MODE_SUFIX ""
set SPACEFISH_VI_MODE_INSERT "I" set SPACEFISH_VI_MODE_INSERT "I\e[5 q"
set SPACEFISH_VI_MODE_NORMAL "N" set SPACEFISH_VI_MODE_NORMAL "N"
set SPACEFISH_VI_MODE_VISUAL "V" set SPACEFISH_VI_MODE_VISUAL "V"
set SPACEFISH_VI_MODE_REPLACE "R" set SPACEFISH_VI_MODE_REPLACE "R"
set SPACEFISH_VI_MODE_REPLACE_ONE "S" set SPACEFISH_VI_MODE_REPLACE_ONE "S"
set fish_cursor_default block blink
set fish_cursor_insert line blink
set fish_cursor_replace_one underscore blink
set fish_cursor_visual block
set -l cnf /usr/share/doc/pkgfile/command-not-found.fish set -l cnf /usr/share/doc/pkgfile/command-not-found.fish
test -f "$cnf" && test -f "$cnf" &&
source "$cnf" source "$cnf"