Set $fish_bind_mode to default on fish startup; set $fish_key_bindings

when sourcing fish_vi_mode.fish
This commit is contained in:
Julian Aron Prenner 2014-01-19 10:27:39 +01:00
parent 3728fc7dba
commit cd64a777c3
5 changed files with 15 additions and 5 deletions

View file

@ -652,6 +652,9 @@ void env_init(const struct config_paths_t *paths /* or NULL */)
/* Set g_use_posix_spawn. Default to true. */
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));
/* Set fish_bind_mode to "default" */
env_set(FISH_BIND_MODE_VAR, DEFAULT_BIND_MODE, ENV_GLOBAL);
}
void env_destroy()

View file

@ -61,9 +61,6 @@
#include <vector>
#define DEFAULT_TERM L"ansi"
#define FISH_BIND_MODE_VAR L"fish_bind_mode"
/**
Struct representing a keybinding. Returned by input_get_mappings.
*/

View file

@ -13,6 +13,7 @@ inputrc information for key bindings.
#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

View file

@ -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 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 y kill-selection yank end-selection force-repaint
bind -M visual -m default '"*y' "commandline -s | xsel -p" end-selection force-repaint

View file

@ -1,5 +1,5 @@
function fish_prompt
fish_vi_prompt
end
fish_vi_key_bindings
set fish_key_bindings fish_vi_key_bindings
#fish_vi_key_bindings