Browse Source

Fix home/end keys issues with zsh/vim and TERM=screen-256color

Emmanuel Bouthenot 7 years ago
parent
commit
1659efcd00
2 changed files with 11 additions and 0 deletions
  1. 7 0
      .vimrc
  2. 4 0
      .zsh/config/20_zle.zsh

+ 7 - 0
.vimrc

@@ -116,6 +116,13 @@ set modelines=3 "number of lines to check for modelines
 " }}}
 
 " {{{ Keyboard Settings
+" fix home and end keys with some terminals
+if $TERM =~ '^screen-256color'
+    map <Esc>OH <Home>
+    map! <Esc>OH <Home>
+    map <Esc>OF <End>
+    map! <Esc>OF <End>
+endif
 " keep ctrl-a/ctrl-e for begining/end of line
 nmap <c-a> <c-o>I
 imap <c-a> <c-o>I

+ 4 - 0
.zsh/config/20_zle.zsh

@@ -2,6 +2,10 @@
 # Zle config
 #
 
+# fix Home and End keys
+bindkey '\eOH'  beginning-of-line
+bindkey '\eOF'  end-of-line
+
 # autoescape specials chars with urls
 autoload -U url-quote-magic
 zle -N self-insert url-quote-magic