Fix Ctrl-W/Y in xonsh
This commit is contained in:
16
xonsh/bindings.xsh
Normal file
16
xonsh/bindings.xsh
Normal file
@@ -0,0 +1,16 @@
|
||||
from prompt_toolkit.key_binding.bindings.named_commands import get_by_name
|
||||
from prompt_toolkit.keys import Keys
|
||||
|
||||
@events.on_ptk_create
|
||||
def custom_keybindings(bindings, **kw):
|
||||
@bindings.add(Keys.ControlW)
|
||||
def delete_word(event):
|
||||
get_by_name("backward-kill-word").call(event)
|
||||
|
||||
@bindings.add(Keys.ControlX, Keys.ControlA)
|
||||
def select_all(event):
|
||||
buffer = event.current_buffer
|
||||
buffer.cursor_position = 0
|
||||
buffer.start_selection()
|
||||
buffer.selection_state.enter_shift_mode()
|
||||
buffer.cursor_position = len(buffer.text)
|
||||
@@ -16,6 +16,7 @@ $XONSH_HISTORY_BACKEND = "sqlite"
|
||||
$HISTCONTROL = "ignoredups"
|
||||
$MULTILINE_PROMPT = " "
|
||||
$UPDATE_PROMPT_ON_KEYPRESS = False
|
||||
$XONSH_COPY_ON_DELETE = True
|
||||
|
||||
$AUTO_CD = True
|
||||
|
||||
@@ -27,7 +28,7 @@ $ALTERNATE_EDITOR = "vim"
|
||||
$TERMINAL = "kitty"
|
||||
|
||||
config_dir = p"~/.dotfiles/xonsh"
|
||||
xsh_modules = ["prompt", "path", "alias", "java", "linux", "python", "local", "docker", "kitty", "nix"]
|
||||
xsh_modules = ["prompt", "bindings", "path", "alias", "java", "linux", "python", "local", "docker", "kitty", "nix"]
|
||||
|
||||
for module in xsh_modules:
|
||||
_p = config_dir / f"{module}.xsh"
|
||||
|
||||
Reference in New Issue
Block a user