Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dotfiles
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jens Nolte
dotfiles
Commits
00310076
Commit
00310076
authored
5 years ago
by
Jens Nolte
Browse files
Options
Downloads
Patches
Plain Diff
Add zsh key bindings
parent
7f4598a1
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
nixos/layers/zsh.nix
+16
-6
16 additions, 6 deletions
nixos/layers/zsh.nix
with
16 additions
and
6 deletions
nixos/layers/zsh.nix
+
16
−
6
View file @
00310076
...
@@ -124,6 +124,17 @@ in
...
@@ -124,6 +124,17 @@ in
setopt autocd
setopt autocd
setopt extendedglob
setopt extendedglob
unsetopt flowcontrol
# Set up fzf for ctrl-t (paste selected paths) and alt-c (cd into selected directory)
# This also binds ctrl-r, but that binding is reverted later
source
${
pkgs
.
fzf
}
/share/fzf/key-bindings.zsh
# bind ctrl-r and ctrl-s to perform emacs-style history search
bindkey '^R' history-incremental-search-backward
bindkey '^S' history-incremental-search-forward
# Shift-Tab reverse tab through completions
# Shift-Tab reverse tab through completions
bindkey '^[[Z' reverse-menu-complete
bindkey '^[[Z' reverse-menu-complete
...
@@ -172,9 +183,6 @@ in
...
@@ -172,9 +183,6 @@ in
bindkey '^P' up-history
bindkey '^P' up-history
bindkey '^N' down-history
bindkey '^N' down-history
# bind ctrl-r to perform backward search in history
bindkey '^r' history-incremental-search-backward
# bind ctrl-a and ctrl-e to move to beginning/end of line
# bind ctrl-a and ctrl-e to move to beginning/end of line
bindkey '^a' beginning-of-line
bindkey '^a' beginning-of-line
bindkey '^e' end-of-line
bindkey '^e' end-of-line
...
@@ -187,17 +195,19 @@ in
...
@@ -187,17 +195,19 @@ in
zle -N backward-kill-dir
zle -N backward-kill-dir
bindkey '^[^?' backward-kill-dir
bindkey '^[^?' backward-kill-dir
set-cursor-bar (){
if [[ "$TERM" = xterm* ]]; then
set-cursor-bar () {
if [[ "$TERM" = xterm* || "$TERM" = tmux* || "$TERM" = screen* ]]; then
echo -ne "\e[6 q"
echo -ne "\e[6 q"
fi
fi
}
}
set-cursor-block() {
set-cursor-block() {
if [[ "$TERM" = xterm* ]]; then
if [[ "$TERM" = xterm*
|| "$TERM" = tmux* || "$TERM" = screen*
]]; then
echo -ne "\e[2 q"
echo -ne "\e[2 q"
fi
fi
}
}
# change cursor on vi mode switch
# change cursor on vi mode switch
zle-keymap-select() {
zle-keymap-select() {
# FIXME: Activating vi-command-mode (typing ":" in vicmd-keymap) results in incorrect bar cursor
# FIXME: Activating vi-command-mode (typing ":" in vicmd-keymap) results in incorrect bar cursor
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment