mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 12:53:13 +00:00
Set $fish_bind_mode to default on fish startup; set $fish_key_bindings
when sourcing fish_vi_mode.fish
This commit is contained in:
parent
3728fc7dba
commit
cd64a777c3
5 changed files with 15 additions and 5 deletions
3
env.cpp
3
env.cpp
|
@ -652,6 +652,9 @@ void env_init(const struct config_paths_t *paths /* or NULL */)
|
||||||
/* Set g_use_posix_spawn. Default to true. */
|
/* Set g_use_posix_spawn. Default to true. */
|
||||||
env_var_t use_posix_spawn = env_get_string(L"fish_use_posix_spawn");
|
env_var_t use_posix_spawn = env_get_string(L"fish_use_posix_spawn");
|
||||||
g_use_posix_spawn = (use_posix_spawn.missing_or_empty() ? true : from_string<bool>(use_posix_spawn));
|
g_use_posix_spawn = (use_posix_spawn.missing_or_empty() ? true : from_string<bool>(use_posix_spawn));
|
||||||
|
|
||||||
|
/* Set fish_bind_mode to "default" */
|
||||||
|
env_set(FISH_BIND_MODE_VAR, DEFAULT_BIND_MODE, ENV_GLOBAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void env_destroy()
|
void env_destroy()
|
||||||
|
|
|
@ -61,9 +61,6 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#define DEFAULT_TERM L"ansi"
|
#define DEFAULT_TERM L"ansi"
|
||||||
|
|
||||||
#define FISH_BIND_MODE_VAR L"fish_bind_mode"
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Struct representing a keybinding. Returned by input_get_mappings.
|
Struct representing a keybinding. Returned by input_get_mappings.
|
||||||
*/
|
*/
|
||||||
|
|
1
input.h
1
input.h
|
@ -13,6 +13,7 @@ inputrc information for key bindings.
|
||||||
|
|
||||||
|
|
||||||
#define DEFAULT_BIND_MODE L"default"
|
#define DEFAULT_BIND_MODE L"default"
|
||||||
|
#define FISH_BIND_MODE_VAR L"fish_bind_mode"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Key codes for inputrc-style keyboard functions that are passed on
|
Key codes for inputrc-style keyboard functions that are passed on
|
||||||
|
|
|
@ -193,6 +193,15 @@ function fish_vi_key_bindings -d "vi-like key bindings for fish"
|
||||||
bind -M visual h backward-char
|
bind -M visual h backward-char
|
||||||
bind -M visual l forward-char
|
bind -M visual l forward-char
|
||||||
|
|
||||||
|
bind -M visual b backward-word
|
||||||
|
bind B backward-word
|
||||||
|
bind gE backward-word
|
||||||
|
bind gE backward-word
|
||||||
|
bind w forward-word
|
||||||
|
bind W forward-word
|
||||||
|
bind e forward-word
|
||||||
|
bind E forward-word
|
||||||
|
|
||||||
bind -M visual -m default d kill-selection end-selection force-repaint
|
bind -M visual -m default d kill-selection end-selection force-repaint
|
||||||
bind -M visual -m default y kill-selection yank end-selection force-repaint
|
bind -M visual -m default y kill-selection yank end-selection force-repaint
|
||||||
bind -M visual -m default '"*y' "commandline -s | xsel -p" end-selection force-repaint
|
bind -M visual -m default '"*y' "commandline -s | xsel -p" end-selection force-repaint
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
function fish_prompt
|
function fish_prompt
|
||||||
fish_vi_prompt
|
fish_vi_prompt
|
||||||
end
|
end
|
||||||
|
set fish_key_bindings fish_vi_key_bindings
|
||||||
fish_vi_key_bindings
|
#fish_vi_key_bindings
|
||||||
|
|
Loading…
Reference in a new issue