mirror of
https://github.com/XNM1/linux-nixos-hyprland-config-dotfiles.git
synced 2025-09-15 09:45:58 +03:00
fix(fish-helix): 🐛 Fix argparse syntax and add select_line command
- Remove single quotes around `h/help` flag in argparse call - Add new `select_line` command case to handle line selection - Clean up string quoting consistency throughout the function - Improve indentation and formatting for better readability The argparse syntax fix resolves potential parsing issues while the new select_line command provides consistent line selection behavior across different modes.
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
# because of unsynchronized `commandline -f` and `commandline -C`
|
# because of unsynchronized `commandline -f` and `commandline -C`
|
||||||
|
|
||||||
function fish_helix_command
|
function fish_helix_command
|
||||||
argparse 'h/help' -- $argv
|
argparse h/help -- $argv
|
||||||
or return 1
|
or return 1
|
||||||
if test -n "$_flag_help"
|
if test -n "$_flag_help"
|
||||||
echo "Helper function to handle modal key bindings mostly outside of insert mode"
|
echo "Helper function to handle modal key bindings mostly outside of insert mode"
|
||||||
@@ -16,152 +16,153 @@ function fish_helix_command
|
|||||||
set -f count_defined $status
|
set -f count_defined $status
|
||||||
|
|
||||||
switch $command
|
switch $command
|
||||||
case {move,extend}_char_left
|
case {move,extend}_char_left
|
||||||
commandline -C (math max\(0, (commandline -C) - $count\))
|
commandline -C (math max\(0, (commandline -C) - $count\))
|
||||||
__fish_helix_extend_by_command $command
|
__fish_helix_extend_by_command $command
|
||||||
case {move,extend}_char_right
|
case {move,extend}_char_right
|
||||||
commandline -C (math (commandline -C) + $count)
|
commandline -C (math (commandline -C) + $count)
|
||||||
__fish_helix_extend_by_command $command
|
__fish_helix_extend_by_command $command
|
||||||
|
|
||||||
case char_up
|
case char_up
|
||||||
__fish_helix_char_up $fish_bind_mode $count
|
__fish_helix_char_up $fish_bind_mode $count
|
||||||
case char_down
|
case char_down
|
||||||
__fish_helix_char_down $fish_bind_mode $count
|
__fish_helix_char_down $fish_bind_mode $count
|
||||||
|
|
||||||
case next_word_start
|
case next_word_start
|
||||||
# https://regex101.com/r/KXrl1x/1
|
# https://regex101.com/r/KXrl1x/1
|
||||||
set -l regex (string join '' \
|
set -l regex (string join '' \
|
||||||
'(?:.?\\n+|' \
|
'(?:.?\\n+|' \
|
||||||
'[[:alnum:]_](?=[^[:alnum:]_\\s])|' \
|
'[[:alnum:]_](?=[^[:alnum:]_\\s])|' \
|
||||||
'[^[:alnum:]_\\s](?=[[:alnum:]_])|' \
|
'[^[:alnum:]_\\s](?=[[:alnum:]_])|' \
|
||||||
'[^\\S\\n](?=[\\S\\n])|)' \
|
'[^\\S\\n](?=[\\S\\n])|)' \
|
||||||
'((?:[[:alnum:]_]+|[^[:alnum:]_\\s]+|)[^\\S\\n]*)' \
|
'((?:[[:alnum:]_]+|[^[:alnum:]_\\s]+|)[^\\S\\n]*)' \
|
||||||
)
|
)
|
||||||
__fish_helix_next_word $fish_bind_mode $count $regex
|
__fish_helix_next_word $fish_bind_mode $count $regex
|
||||||
|
|
||||||
case next_long_word_start
|
case next_long_word_start
|
||||||
set -l regex (string join '' \
|
set -l regex (string join '' \
|
||||||
'(?:.?\\n+|' \
|
'(?:.?\\n+|' \
|
||||||
'[^\\S\\n](?=[\\S\\n])|)' \
|
'[^\\S\\n](?=[\\S\\n])|)' \
|
||||||
'(\\S*[^\\S\\n]*)' \
|
'(\\S*[^\\S\\n]*)' \
|
||||||
)
|
)
|
||||||
__fish_helix_next_word $fish_bind_mode $count $regex
|
__fish_helix_next_word $fish_bind_mode $count $regex
|
||||||
|
|
||||||
case next_word_end
|
case next_word_end
|
||||||
# https://regex101.com/r/Gl0KP2/1
|
# https://regex101.com/r/Gl0KP2/1
|
||||||
set -l regex ' (?:
|
set -l regex ' (?:
|
||||||
.?\\n+ |
|
.?\\n+ |
|
||||||
[[:alnum:]_](?=[^[:alnum:]_]) |
|
[[:alnum:]_](?=[^[:alnum:]_]) |
|
||||||
[^[:alnum:]_\\s](?=[[:alnum:]_\\s]) | )
|
[^[:alnum:]_\\s](?=[[:alnum:]_\\s]) | )
|
||||||
( [^\\S\\n]*
|
( [^\\S\\n]*
|
||||||
(?: [[:alnum:]_]+ | [^[:alnum:]_\\s]+ | ) ) '
|
(?: [[:alnum:]_]+ | [^[:alnum:]_\\s]+ | ) ) '
|
||||||
__fish_helix_next_word $fish_bind_mode $count $regex
|
__fish_helix_next_word $fish_bind_mode $count $regex
|
||||||
|
|
||||||
case next_long_word_end
|
case next_long_word_end
|
||||||
set -l regex ' (?: .?\\n+ | \\S(?=\\s) | )
|
set -l regex ' (?: .?\\n+ | \\S(?=\\s) | )
|
||||||
( [^\\S\\n]* \\S* ) '
|
( [^\\S\\n]* \\S* ) '
|
||||||
__fish_helix_next_word $fish_bind_mode $count $regex
|
__fish_helix_next_word $fish_bind_mode $count $regex
|
||||||
|
|
||||||
case prev_word_start
|
case prev_word_start
|
||||||
set -l regex ' ( (?:
|
set -l regex ' ( (?:
|
||||||
[[:alnum:]_]+ |
|
[[:alnum:]_]+ |
|
||||||
[^[:alnum:]_\\s]+ | )
|
[^[:alnum:]_\\s]+ | )
|
||||||
[^\\S\\n]* )
|
[^\\S\\n]* )
|
||||||
(?: \\n+.? |
|
(?: \\n+.? |
|
||||||
(?<=[^[:alnum:]_])[[:alnum:]_] |
|
(?<=[^[:alnum:]_])[[:alnum:]_] |
|
||||||
(?<=[[:alnum:]_\\s])[^[:alnum:]_\\s] | ) '
|
(?<=[[:alnum:]_\\s])[^[:alnum:]_\\s] | ) '
|
||||||
__fish_helix_prev_word $fish_bind_mode $count $regex
|
__fish_helix_prev_word $fish_bind_mode $count $regex
|
||||||
|
|
||||||
case prev_long_word_start
|
case prev_long_word_start
|
||||||
set -l regex '
|
set -l regex '
|
||||||
( \\S* [^\\S\\n]* )
|
( \\S* [^\\S\\n]* )
|
||||||
(?: \\n+.? | (?<=\\s)\\S | ) '
|
(?: \\n+.? | (?<=\\s)\\S | ) '
|
||||||
__fish_helix_prev_word $fish_bind_mode $count $regex
|
__fish_helix_prev_word $fish_bind_mode $count $regex
|
||||||
|
|
||||||
|
case till_next_char
|
||||||
|
__fish_helix_find_char $fish_bind_mode $count forward-jump-till forward-char
|
||||||
|
case find_next_char
|
||||||
|
__fish_helix_find_char $fish_bind_mode $count forward-jump
|
||||||
|
case till_prev_char
|
||||||
|
__fish_helix_find_char $fish_bind_mode $count backward-jump-till backward-char
|
||||||
|
case find_prev_char
|
||||||
|
__fish_helix_find_char $fish_bind_mode $count backward-jump
|
||||||
|
|
||||||
case till_next_char
|
case till_next_cr
|
||||||
__fish_helix_find_char $fish_bind_mode $count forward-jump-till forward-char
|
__fish_helix_find_next_cr $fish_bind_mode $count 2
|
||||||
case find_next_char
|
case find_next_cr
|
||||||
__fish_helix_find_char $fish_bind_mode $count forward-jump
|
__fish_helix_find_next_cr $fish_bind_mode $count 1
|
||||||
case till_prev_char
|
case till_prev_cr
|
||||||
__fish_helix_find_char $fish_bind_mode $count backward-jump-till backward-char
|
__fish_helix_find_prev_cr $fish_bind_mode $count 1
|
||||||
case find_prev_char
|
case find_prev_cr
|
||||||
__fish_helix_find_char $fish_bind_mode $count backward-jump
|
__fish_helix_find_prev_cr $fish_bind_mode $count 0
|
||||||
|
|
||||||
case till_next_cr
|
case goto_line_start
|
||||||
__fish_helix_find_next_cr $fish_bind_mode $count 2
|
commandline -f beginning-of-line
|
||||||
case find_next_cr
|
__fish_helix_extend_by_mode
|
||||||
__fish_helix_find_next_cr $fish_bind_mode $count 1
|
case goto_line_end
|
||||||
case till_prev_cr
|
__fish_helix_goto_line_end
|
||||||
__fish_helix_find_prev_cr $fish_bind_mode $count 1
|
__fish_helix_extend_by_mode
|
||||||
case find_prev_cr
|
case goto_first_nonwhitespace
|
||||||
__fish_helix_find_prev_cr $fish_bind_mode $count 0
|
__fish_helix_goto_first_nonwhitespace
|
||||||
|
__fish_helix_extend_by_mode
|
||||||
|
|
||||||
case goto_line_start
|
case goto_file_start
|
||||||
commandline -f beginning-of-line
|
|
||||||
__fish_helix_extend_by_mode
|
|
||||||
case goto_line_end
|
|
||||||
__fish_helix_goto_line_end
|
|
||||||
__fish_helix_extend_by_mode
|
|
||||||
case goto_first_nonwhitespace
|
|
||||||
__fish_helix_goto_first_nonwhitespace
|
|
||||||
__fish_helix_extend_by_mode
|
|
||||||
|
|
||||||
case goto_file_start
|
|
||||||
__fish_helix_goto_line $count
|
|
||||||
case goto_line
|
|
||||||
if test "$count_defined" = 0 # if true
|
|
||||||
__fish_helix_goto_line $count
|
__fish_helix_goto_line $count
|
||||||
end
|
case goto_line
|
||||||
case goto_last_line
|
if test "$count_defined" = 0 # if true
|
||||||
commandline -f end-of-buffer beginning-of-line
|
__fish_helix_goto_line $count
|
||||||
__fish_helix_extend_by_mode
|
end
|
||||||
|
case goto_last_line
|
||||||
|
commandline -f end-of-buffer beginning-of-line
|
||||||
|
__fish_helix_extend_by_mode
|
||||||
|
|
||||||
case insert_mode
|
case insert_mode
|
||||||
set fish_bind_mode insert
|
set fish_bind_mode insert
|
||||||
commandline -f end-selection repaint-mode
|
commandline -f end-selection repaint-mode
|
||||||
|
|
||||||
case append_mode
|
case append_mode
|
||||||
commandline -C (commandline -E)
|
commandline -C (commandline -E)
|
||||||
set fish_bind_mode insert
|
set fish_bind_mode insert
|
||||||
commandline -f end-selection repaint-mode
|
commandline -f end-selection repaint-mode
|
||||||
|
|
||||||
case prepend_to_line
|
case prepend_to_line
|
||||||
__fish_helix_goto_first_nonwhitespace
|
__fish_helix_goto_first_nonwhitespace
|
||||||
set fish_bind_mode insert
|
set fish_bind_mode insert
|
||||||
commandline -f end-selection repaint-mode
|
commandline -f end-selection repaint-mode
|
||||||
|
|
||||||
case append_to_line
|
case append_to_line
|
||||||
set fish_bind_mode insert
|
set fish_bind_mode insert
|
||||||
commandline -f end-selection end-of-line repaint-mode
|
commandline -f end-selection end-of-line repaint-mode
|
||||||
|
|
||||||
case delete_selection
|
case delete_selection
|
||||||
commandline -f kill-selection begin-selection
|
commandline -f kill-selection begin-selection
|
||||||
case delete_selection_noyank
|
case delete_selection_noyank
|
||||||
__fish_helix_delete_selection
|
__fish_helix_delete_selection
|
||||||
|
|
||||||
case yank
|
case yank
|
||||||
__fish_helix_yank
|
__fish_helix_yank
|
||||||
case paste_before
|
case paste_before
|
||||||
__fish_helix_paste_before "commandline -f yank"
|
__fish_helix_paste_before "commandline -f yank"
|
||||||
case paste_after
|
case paste_after
|
||||||
__fish_helix_paste_after "commandline -f yank"
|
__fish_helix_paste_after "commandline -f yank"
|
||||||
case replace_selection
|
case replace_selection
|
||||||
__fish_helix_replace_selection "$fish_killring[1]" "true"
|
__fish_helix_replace_selection "$fish_killring[1]" true
|
||||||
|
|
||||||
case paste_before_clip
|
case paste_before_clip
|
||||||
__fish_helix_paste_before "fish_clipboard_paste"
|
__fish_helix_paste_before fish_clipboard_paste
|
||||||
case paste_after_clip
|
case paste_after_clip
|
||||||
__fish_helix_paste_after "fish_clipboard_paste" --clip
|
__fish_helix_paste_after fish_clipboard_paste --clip
|
||||||
case replace_selection_clip
|
case replace_selection_clip
|
||||||
__fish_helix_replace_selection "" "fish_clipboard_paste" --clip
|
__fish_helix_replace_selection "" fish_clipboard_paste --clip
|
||||||
|
|
||||||
case select_all
|
case select_all
|
||||||
commandline -f beginning-of-buffer begin-selection end-of-buffer end-of-line backward-char
|
commandline -f beginning-of-buffer begin-selection end-of-buffer end-of-line backward-char
|
||||||
|
|
||||||
|
case select_line
|
||||||
|
commandline -f beginning-of-line begin-selection end-of-line
|
||||||
|
|
||||||
case '*'
|
case '*'
|
||||||
echo "[fish-helix]" Unknown command $command >&2
|
echo "[fish-helix]" Unknown command $command >&2
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -192,11 +193,11 @@ end
|
|||||||
function __fish_helix_find_next_cr -a mode count skip
|
function __fish_helix_find_next_cr -a mode count skip
|
||||||
set -l cursor (commandline -C)
|
set -l cursor (commandline -C)
|
||||||
commandline | # Include endling newline intentionally
|
commandline | # Include endling newline intentionally
|
||||||
# Skip until cursor:
|
# Skip until cursor:
|
||||||
sed -z 's/^.\{'(math $cursor + $skip)'\}\(.*\)$/\\1/' |
|
sed -z 's/^.\{'(math $cursor + $skip)'\}\(.*\)$/\\1/' |
|
||||||
# Count characters up to the target newline:
|
# Count characters up to the target newline:
|
||||||
sed -z 's/^\(\([^\\n]*\\n\)\{0,'$count'\}\).*/\\1/' |
|
sed -z 's/^\(\([^\\n]*\\n\)\{0,'$count'\}\).*/\\1/' |
|
||||||
read -zl chars
|
read -zl chars
|
||||||
|
|
||||||
if test $mode = default -a -n "$chars"
|
if test $mode = default -a -n "$chars"
|
||||||
commandline -f begin-selection
|
commandline -f begin-selection
|
||||||
@@ -209,13 +210,13 @@ end
|
|||||||
function __fish_helix_find_prev_cr -a mode count skip
|
function __fish_helix_find_prev_cr -a mode count skip
|
||||||
set -l cursor (commandline -C)
|
set -l cursor (commandline -C)
|
||||||
commandline --cut-at-cursor |
|
commandline --cut-at-cursor |
|
||||||
sed -z 's/.\{'$skip'\}\n$//' |
|
sed -z 's/.\{'$skip'\}\n$//' |
|
||||||
read -zl buffer
|
read -zl buffer
|
||||||
|
|
||||||
echo -n $buffer |
|
echo -n $buffer |
|
||||||
# Drop characters up to the target newline:
|
# Drop characters up to the target newline:
|
||||||
sed -z 's/\(\(\\n[^\\n]*\)\{0,'$count'\}\)$//' |
|
sed -z 's/\(\(\\n[^\\n]*\)\{0,'$count'\}\)$//' |
|
||||||
read -zl chars
|
read -zl chars
|
||||||
set -l n_chars (math (string length -- "$buffer") - (string length -- "$chars"))
|
set -l n_chars (math (string length -- "$buffer") - (string length -- "$chars"))
|
||||||
|
|
||||||
if test $mode = default -a $n_chars != 0
|
if test $mode = default -a $n_chars != 0
|
||||||
@@ -293,11 +294,11 @@ end
|
|||||||
function __fish_helix_next_word -a mode count regex
|
function __fish_helix_next_word -a mode count regex
|
||||||
set -f cursor (commandline -C)
|
set -f cursor (commandline -C)
|
||||||
commandline |
|
commandline |
|
||||||
perl -e '
|
perl -e '
|
||||||
use open qw(:std :utf8);
|
use open qw(:std :utf8);
|
||||||
do { local $/; substr <>, '$cursor' } =~ m/(?:'$regex'){0,'$count'}/ux;
|
do { local $/; substr <>, '$cursor' } =~ m/(?:'$regex'){0,'$count'}/ux;
|
||||||
print $-[1], " ", $+[1];' |
|
print $-[1], " ", $+[1];' |
|
||||||
read -f left right
|
read -f left right
|
||||||
test "$left" = "$right" && return
|
test "$left" = "$right" && return
|
||||||
if test $mode = default
|
if test $mode = default
|
||||||
commandline -C (math $cursor + $left)
|
commandline -C (math $cursor + $left)
|
||||||
@@ -315,11 +316,11 @@ function __fish_helix_prev_word -a mode count regex
|
|||||||
set -f updated 0
|
set -f updated 0
|
||||||
for i in (seq 1 $count)
|
for i in (seq 1 $count)
|
||||||
commandline |
|
commandline |
|
||||||
perl -e '
|
perl -e '
|
||||||
use open qw(:std :utf8);
|
use open qw(:std :utf8);
|
||||||
do { local $/; substr <>, 0, '$left' } =~ /(?:'$regex')$/ux;
|
do { local $/; substr <>, 0, '$left' } =~ /(?:'$regex')$/ux;
|
||||||
print $-[1], " ", $+[1];' |
|
print $-[1], " ", $+[1];' |
|
||||||
read -l l r
|
read -l l r
|
||||||
test "$l" = "$r" -o "$l" = 0 -a "$r" = 1 && break
|
test "$l" = "$r" -o "$l" = 0 -a "$r" = 1 && break
|
||||||
set -f left $l
|
set -f left $l
|
||||||
set -f right $r
|
set -f right $r
|
||||||
@@ -341,8 +342,8 @@ function __fish_helix_delete_selection
|
|||||||
set start (commandline -B)
|
set start (commandline -B)
|
||||||
set end (commandline -E)
|
set end (commandline -E)
|
||||||
commandline |
|
commandline |
|
||||||
sed -zE 's/^(.{'$start'})(.{0,'(math $end - $start)'})(.*)\\n$/\\1\\3/' |
|
sed -zE 's/^(.{'$start'})(.{0,'(math $end - $start)'})(.*)\\n$/\\1\\3/' |
|
||||||
read -l result
|
read -l result
|
||||||
|
|
||||||
commandline "$result"
|
commandline "$result"
|
||||||
commandline -C $start
|
commandline -C $start
|
||||||
@@ -383,7 +384,7 @@ function __fish_helix_paste_after -a cmd_paste
|
|||||||
commandline -C $end
|
commandline -C $end
|
||||||
$cmd_paste
|
$cmd_paste
|
||||||
|
|
||||||
if test "$argv[2]" = "--clip"
|
if test "$argv[2]" = --clip
|
||||||
commandline -C (math $end - 1)
|
commandline -C (math $end - 1)
|
||||||
else
|
else
|
||||||
for i in (seq 0 (string length "$fish_killring[1]"))
|
for i in (seq 0 (string length "$fish_killring[1]"))
|
||||||
@@ -405,8 +406,8 @@ function __fish_helix_replace_selection -a replacement cmd_paste
|
|||||||
set start (commandline -B)
|
set start (commandline -B)
|
||||||
set end (commandline -E)
|
set end (commandline -E)
|
||||||
commandline |
|
commandline |
|
||||||
sed -zE 's/^(.{'$start'})(.{0,'(math $end - $start)'})(.*)\\n$/\\1'"$(string escape --style=regex "$replacement")"'\\3/' |
|
sed -zE 's/^(.{'$start'})(.{0,'(math $end - $start)'})(.*)\\n$/\\1'"$(string escape --style=regex "$replacement")"'\\3/' |
|
||||||
read -l result
|
read -l result
|
||||||
|
|
||||||
commandline "$result"
|
commandline "$result"
|
||||||
commandline -C $start
|
commandline -C $start
|
||||||
|
@@ -101,16 +101,15 @@ function fish_helix_key_bindings --description 'helix-like key bindings for fish
|
|||||||
bind -s --preset -M visual -m default $key repaint-mode
|
bind -s --preset -M visual -m default $key repaint-mode
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
# Motion and actions in normal/select mode
|
# Motion and actions in normal/select mode
|
||||||
for mode in default visual
|
for mode in default visual
|
||||||
if test $mode = default
|
if test $mode = default
|
||||||
set -f n_begin_selection "begin-selection" # only begin-selection if current mode is Normal
|
set -f n_begin_selection begin-selection # only begin-selection if current mode is Normal
|
||||||
set -f ns_move_extend "move"
|
set -f ns_move_extend move
|
||||||
set -f commandline_v_repaint ""
|
set -f commandline_v_repaint ""
|
||||||
else
|
else
|
||||||
set -f n_begin_selection
|
set -f n_begin_selection
|
||||||
set -f ns_move_extend "extend"
|
set -f ns_move_extend extend
|
||||||
set -f commandline_v_repaint "commandline -f repaint-mode"
|
set -f commandline_v_repaint "commandline -f repaint-mode"
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -220,6 +219,8 @@ function fish_helix_key_bindings --description 'helix-like key bindings for fish
|
|||||||
|
|
||||||
bind -s --preset -M $mode % "fish_helix_command select_all"
|
bind -s --preset -M $mode % "fish_helix_command select_all"
|
||||||
|
|
||||||
|
bind -s --preset -M $mode x "fish_helix_command select_line"
|
||||||
|
|
||||||
# FIXME x X \ex
|
# FIXME x X \ex
|
||||||
# FIXME J
|
# FIXME J
|
||||||
# FIXME \cc
|
# FIXME \cc
|
||||||
@@ -238,7 +239,6 @@ function fish_helix_key_bindings --description 'helix-like key bindings for fish
|
|||||||
bind -s --preset -M replace_one -m default \r 'commandline -f delete-char; commandline -i \n; commandline -f backward-char; commandline -f repaint-mode'
|
bind -s --preset -M replace_one -m default \r 'commandline -f delete-char; commandline -i \n; commandline -f backward-char; commandline -f repaint-mode'
|
||||||
bind -s --preset -M replace_one -m default \e cancel repaint-mode
|
bind -s --preset -M replace_one -m default \e cancel repaint-mode
|
||||||
|
|
||||||
|
|
||||||
## FIXME Insert mode keys
|
## FIXME Insert mode keys
|
||||||
|
|
||||||
## Old config from vi:
|
## Old config from vi:
|
||||||
@@ -259,36 +259,27 @@ function fish_helix_key_bindings --description 'helix-like key bindings for fish
|
|||||||
bind -s --preset -M insert -k sdc backward-delete-char # shifted delete
|
bind -s --preset -M insert -k sdc backward-delete-char # shifted delete
|
||||||
bind -s --preset -M default -k sdc backward-delete-char # shifted delete
|
bind -s --preset -M default -k sdc backward-delete-char # shifted delete
|
||||||
|
|
||||||
|
# bind -s --preset '~' togglecase-char forward-single-char
|
||||||
# bind -s --preset '~' togglecase-char forward-single-char
|
# bind -s --preset gu downcase-word
|
||||||
# bind -s --preset gu downcase-word
|
# bind -s --preset gU upcase-word
|
||||||
# bind -s --preset gU upcase-word
|
#
|
||||||
#
|
# bind -s --preset J end-of-line delete-char
|
||||||
# bind -s --preset J end-of-line delete-char
|
# bind -s --preset K 'man (commandline -t) 2>/dev/null; or echo -n \a'
|
||||||
# bind -s --preset K 'man (commandline -t) 2>/dev/null; or echo -n \a'
|
#
|
||||||
#
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# same vim 'pasting' note as upper
|
# same vim 'pasting' note as upper
|
||||||
bind -s --preset '"*p' forward-char "commandline -i ( xsel -p; echo )[1]"
|
bind -s --preset '"*p' forward-char "commandline -i ( xsel -p; echo )[1]"
|
||||||
bind -s --preset '"*P' "commandline -i ( xsel -p; echo )[1]"
|
bind -s --preset '"*P' "commandline -i ( xsel -p; echo )[1]"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# visual mode
|
# visual mode
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# bind -s --preset -M visual -m insert c kill-selection end-selection repaint-mode
|
# bind -s --preset -M visual -m insert c kill-selection end-selection repaint-mode
|
||||||
# bind -s --preset -M visual -m insert s kill-selection end-selection repaint-mode
|
# bind -s --preset -M visual -m insert s kill-selection end-selection repaint-mode
|
||||||
bind -s --preset -M visual -m default '"*y' "fish_clipboard_copy; commandline -f end-selection repaint-mode"
|
bind -s --preset -M visual -m default '"*y' "fish_clipboard_copy; commandline -f end-selection repaint-mode"
|
||||||
bind -s --preset -M visual -m default '~' togglecase-selection end-selection repaint-mode
|
bind -s --preset -M visual -m default '~' togglecase-selection end-selection repaint-mode
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Set the cursor shape
|
# Set the cursor shape
|
||||||
# After executing once, this will have defined functions listening for the variable.
|
# After executing once, this will have defined functions listening for the variable.
|
||||||
# Therefore it needs to be before setting fish_bind_mode.
|
# Therefore it needs to be before setting fish_bind_mode.
|
||||||
|
Reference in New Issue
Block a user