edwinpaixao

.zhrc

Mar 26th, 2016
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.24 KB | None | 0 0
  1. # _________ _ _ ____ ____
  2. # |__ / ___|| | | | _ \ / ___|
  3. # / /\___ \| |_| | |_) | |
  4. # _ / /_ ___) | _ | _ <| |___
  5. #(_)____|____/|_| |_|_| \_\\____|
  6. #
  7. #############################################################################################################
  8. #.zshrc - Initialization file for Z shell #
  9. #Created by: Thiago Silva #
  10. #Based on configuration used for Sandro Marcel (https://www.vivaolinux.com.br/etc/.zshrc-SMarcell) #
  11. #Linux is power #
  12. #Before using, look all the confs with attention, and solve all dependencies to work properly #
  13. #The aliases used in this configuration are exclusive from Arch Linux and derivates. #
  14. #############################################################################################################
  15.  
  16.  
  17. # Variables:
  18. export BROWSER="firefox"
  19. export EDITOR="vim"
  20.  
  21. # Zsh-syntax-highlighting
  22. source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
  23. #Syntax-highlighting similar to shell Fish. Its necessary install the package zsh-syntax-highlighting
  24.  
  25. # pkgfile includes a "command not found" hook for Bash and Zsh that will automatically search the official repositories, when entering an unrecognized command:
  26. source /usr/share/doc/pkgfile/command-not-found.zsh
  27.  
  28. # Historic
  29. export HISTFILE=${HOME}/.zsh_history
  30. export HISTSIZE=5000
  31. export SAVEHIST=$HISTSIZE
  32.  
  33. # Prevent duplicates on historic
  34. setopt HIST_IGNORE_ALL_DUPS
  35.  
  36. # Historic options:
  37. setopt EXTENDED_HISTORY HIST_VERIFY HIST_REDUCE_BLANKS HIST_IGNORE_ALL_DUPS
  38. # Obs.: Caso queira procurar um comando específico no histórico,
  39. # você pode utilizar como alternativa a combinação de teclas
  40. # 'CTRL+R' e digitar o comando procurado.
  41.  
  42. #View the last accessed directories.The command is "dirs -v"
  43.  
  44. DIRSTACKFILE="$HOME/.cache/zsh/dirs"
  45. if [[ -f $DIRSTACKFILE ]] && [[ $#dirstack -eq 0 ]]; then
  46. dirstack=( ${(f)"$(< $DIRSTACKFILE)"} )
  47. [[ -d $dirstack[1] ]] && cd $dirstack[1]
  48. fi
  49. chpwd() {
  50. print -l $PWD ${(u)dirstack} >$DIRSTACKFILE
  51. }
  52.  
  53. DIRSTACKSIZE=20
  54.  
  55. setopt autopushd pushdsilent pushdtohome
  56.  
  57. ## Remove duplicate entries
  58. setopt pushdignoredups
  59.  
  60. ##Prevenir linhas duplicadas no histórico
  61. setopt HIST_IGNORE_DUPS
  62.  
  63. ##Autocomplete for aliases
  64. setopt completealiases
  65.  
  66. ##Search history
  67. [[ -n "${key[PageUp]}" ]] && bindkey "${key[PageUp]}" history-beginning-search-backward
  68. [[ -n "${key[PageDown]}" ]] && bindkey "${key[PageDown]}" history-beginning-search-forward
  69.  
  70. ## This reverts the +/- operators.
  71. setopt pushdminus
  72.  
  73. # Loading some useful modules:
  74. zmodload -i zsh/complete
  75. zmodload -i zsh/mapfile
  76. zmodload -i zsh/mathfunc
  77. zmodload -i zsh/complist
  78. zmodload -i zsh/curses
  79. zmodload -i zsh/datetime
  80. zmodload -i zsh/terminfo
  81.  
  82. # Loading module zmv
  83. autoload -U zmv
  84.  
  85. # Enabling self-correction:
  86. setopt correct
  87. setopt correct_all
  88. export sprompt="$(print '%{\e[37m%}zsh: Corrigir para %S%r%s ? (n|y|e): %{\e[0m%}')"
  89.  
  90. # Allows the use of wildcards: *?_-.[]~=/&;!#$%^(){}<>
  91. setopt extended_glob
  92.  
  93. # Allowing self cd (There is no need to use the command cd):
  94. setopt auto_cd
  95. setopt cdable_vars
  96. setopt auto_pushd
  97. setopt pushd_ignore_dups
  98. setopt pushd_silent
  99.  
  100. # Auto-complete with <TAB>
  101. setopt auto_list
  102. setopt auto_menu
  103. setopt case_glob
  104. setopt list_types
  105. setopt glob_complete
  106. setopt menu_complete
  107. setopt complete_in_word
  108. setopt complete_aliases
  109. autoload -Uz compinit promptinit
  110. compinit
  111. promptinit
  112. autoload colors
  113. colors
  114. # prompt fade #prompt -l com esse comando vc terá mais opções do prompt troquem Adam2 por qualquer uma das disponíveis
  115. # RPROMPT="%{$reset_color%}< %{$fg[blue]%}%M%{$reset_color%}:%{$fg[cyan]%}%y%{$reset_color%}:%{$fg[yellow]%}%~%{$reset_color%}"
  116. # PROMPT="%{$reset_color%}%{$fg[yellow]%} %T%{$reset_color%} %{$fg[green]%}%n%{$reset_color%} > "
  117.  
  118. # Bindkeys
  119. bindkey -v
  120. bindkey '^R' history-incremental-search-backward
  121.  
  122. typeset -A key
  123.  
  124. key[Home]=${terminfo[khome]}
  125. key[End]=${terminfo[kend]}
  126. key[Insert]=${terminfo[kich1]}
  127. key[Delete]=${terminfo[kdch1]}
  128. key[Up]=${terminfo[kcuu1]}
  129. key[Down]=${terminfo[kcud1]}
  130. key[Left]=${terminfo[kcub1]}
  131. key[Right]=${terminfo[kcuf1]}
  132. key[PageUp]=${terminfo[kpp]}
  133. key[PageDown]=${terminfo[knp]}
  134.  
  135. # setup key accordingly
  136. [[ -n "${key[Home]}" ]] && bindkey "${key[Home]}" beginning-of-line
  137. [[ -n "${key[End]}" ]] && bindkey "${key[End]}" end-of-line
  138. [[ -n "${key[Insert]}" ]] && bindkey "${key[Insert]}" overwrite-mode
  139. [[ -n "${key[Delete]}" ]] && bindkey "${key[Delete]}" delete-char
  140. [[ -n "${key[Up]}" ]] && bindkey "${key[Up]}" up-line-or-history
  141. [[ -n "${key[Down]}" ]] && bindkey "${key[Down]}" down-line-or-history
  142. [[ -n "${key[Left]}" ]] && bindkey "${key[Left]}" backward-char
  143. [[ -n "${key[Right]}" ]] && bindkey "${key[Right]}" forward-char
  144.  
  145. # Finally, make sure the terminal is in application mode, when zle is
  146. # active. Only then are the values from $terminfo valid.
  147. function zle-line-init () {
  148. echoti smkx
  149. }
  150. function zle-line-finish () {
  151. echoti rmkx
  152. }
  153.  
  154. if [ -n "${DISPLAY:-}" ]; then
  155. zle -N zle-line-init
  156. zle -N zle-line-finish
  157. fi
  158.  
  159.  
  160. # Cleaning terminal screen with key <ESC>:
  161. bindkey '^[' clear-screen
  162.  
  163. # Enabling verbose mode:
  164. zstyle ':completion:*' verbose 'yes'
  165. zstyle ':completion:*' show-completer
  166.  
  167. # Persistent repetition:
  168. zstyle ':completion:*' rehash true
  169.  
  170. # Colored stripe complementation:
  171. zstyle ':completion:*:default' list-colors ${(s.:.)ZLS_COLORS}
  172.  
  173. # Visual selection menu:
  174. zstyle ':completion:*' menu select=3 _complete _i-patterns ignored_approximate
  175. zstyle ':completion:*' select-prompt '%S zsh: Seleção atual = %p %s'
  176.  
  177. # Auto description of possible additions:
  178. zstyle ':completion:*:options' description 'yes'
  179. zstyle ':completion:*:options' auto-description '%d'
  180.  
  181. # Format of self-completion messages:
  182. zstyle ':completion:*:corrections' format '%Bzsh: %d (erros: %e)%b'
  183. zstyle ':completion:*:descriptions' format '%U%B%d%b%u'
  184. zstyle ':completion:*:warnings' format '%Bzsh: Inválido como: %d%b'
  185.  
  186. # Listing self-complementation groups:
  187. zstyle ':completion:*:matches' groups 'yes'
  188. zstyle ':completion:*' list-grouped
  189. zstyle ':completion:*' group-name ''
  190. zstyle ':completion:*:*:-command-:*' group-order commands builtins
  191.  
  192. # Expand as much as possible:
  193. zstyle ':completion:incremental:*' completer _complete _correct
  194. zstyle ':completion:*' completer _complete _correct _match _approximate
  195. zstyle ':completion:*:expand:*' tag-order all-expansions
  196.  
  197. # Number of errors to accept for autocompletion:
  198. zstyle ':completion:*:approximate:*' max-errors 2 numeric
  199.  
  200. # Use '/d/s <TAB>' to expand to '/dir/subdir':
  201. zstyle ':completion:*' expand 'yes'
  202. zstyle ':completion:*' squeeze-slashes 'yes'
  203.  
  204. # Preserve prefix/suffix for autocompletion:
  205. zstyle ':completion:*' expand prefix suffix
  206. zstyle ':completion:*' completer _complete _prefix _match _approximate
  207. zstyle ':completion:*' preserve-prefix '//[^ /]##/'
  208. zstyle ':completion:*:match:*' original only
  209. zstyle ':completion:*approximate :*' max-errors 1 numeric
  210.  
  211. # Option auto-cd should ignore the current directory:
  212. zstyle ':completion:*:cd:*' ignore-parents parent pwd
  213.  
  214. # Avoid duplicate entries for the commands below:
  215. zstyle ':completion:*:rm:*' ignore-line 'yes'
  216. zstyle ':completion:*:cp:*' ignore-line 'yes'
  217. zstyle ':completion:*:mv:*' ignore-line 'yes'
  218.  
  219. # Case-sensitive self-complementation:
  220. zstyle ':completion:*:complete:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}'
  221.  
  222. # Self-complementary from Wildcards:
  223. zstyle ':completion:*:complete-extended:*' matcher 'r:|[.,_-]=* r:|=*'
  224.  
  225. # Ignore auto-completion of internal functions of zsh:
  226. zstyle ':completion:*:functions' ignored-patterns '_*'
  227.  
  228. # Autocomplete for the command 'kill':
  229. zstyle ':completion:*:processes' command 'ps x -o pid,command'
  230. zstyle ':completion:*:kill:*' menu yes select
  231. zstyle ':completion:*:kill:*' force-list always
  232. zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31'
  233.  
  234. # Command help in the Zsh
  235. autoload -U run-help
  236. autoload run-help-git
  237. autoload run-help-svn
  238. autoload run-help-svk
  239. unalias run-help
  240.  
  241. # Syntax coloring# wget https://raw.githubusercontent.com/trapd00r/LS_COLORS/master/LS_COLORS -O ~/.dircolors
  242. eval $(dircolors -b $HOME/.dircolors)
  243. alias ls="ls -F -h --color=auto"
  244.  
  245. #####################################################################################################################
  246. ## functions
  247. #####################################################################################################################
  248. #
  249. # myip - Find the external IP when connected to internet
  250. function meuip ()
  251. {
  252.  
  253. lynx -dump -hiddenlinks=ignore -nolist http://checkip.dyndns.org:8245/ | awk '{
  254. print $4}' | sed '/^$/d; s/^[ ]*//g; s/[ ]*$//g'
  255. }
  256.  
  257. # Mass rename images
  258. function renomear ()
  259. {ctd=1 ; for i in * ; do zeros=$(printf "%03d\n" ${ctd}) ; mv $i wallpaper_${zeros}.jpg ; ((ctd++)) ; done
  260. }
  261.  
  262. # Color man pages: #pacman -S most
  263. if [ -e $(which most) ]
  264. then
  265. export PAGER='most -s'
  266. export LESSHISTFILE='-'
  267. else
  268. export PAGER=less
  269. fi
  270.  
  271. # Coloring the output of various programs.#pacman -S grc
  272. GRC=`which grc`
  273. if [ "$TERM" != dumb ] && [ -n "$GRC" ]
  274. then
  275. alias colourify="$GRC -es --colour=auto"
  276. alias cfg='colourify ./configure'
  277. alias configure='colourify ./configure'
  278. alias diff='colourify diff'
  279. alias make='colourify make'
  280. alias gcc='colourify gcc'
  281. alias g++='colourify g++'
  282. alias as='colourify as'
  283. alias gas='colourify gas'
  284. alias ld='colourify ld'
  285. alias netstat='colourify netstat'
  286. alias ping='colourify ping'
  287. alias traceroute='colourify /usr/sbin/traceroute'
  288. alias head='colourify head'
  289. alias tail='colourify tail'
  290. alias dig='colourify dig'
  291. alias mount='colourify mount'
  292. alias ps='colourify ps'
  293. alias mtr='colourify mtr'
  294. alias df='colourify df'
  295. fi
  296.  
  297. # Calculate real memory used (desconsider the cache)
  298. function mem(){
  299. echo "`free|grep Mem|awk '{printf(\"%.0f\",($3-($6+$7))/1000)}'` MiB";
  300. }
  301.  
  302. # List erros in logs from the last system boot
  303. function logerr(){ journalctl -b -p err}
  304.  
  305. #Show only user processes.
  306. function psuser() {
  307. ps $@ -u $USER -o pid,%cpu,%mem,bsdtime,command ;
  308. }
  309.  
  310. function imgur-upl() { # Image upload to imgur site
  311. curl -s -F image=@"$1" -F "key=1913b4ac473c692372d108209958fd15" \
  312. http://api.imgur.com/2/upload.xml | grep -Eo "<original>(.)*</original>" \
  313. | grep -Eo "http://i.imgur.com/[^<]*"
  314. }
  315.  
  316. #hastebin
  317. function haste() { # File upload to hastebin, with syntax highlight support.
  318. a=$(cat); curl -X POST -s -d "$a" http://hastebin.com/documents | awk -F '"' '{print "http://hastebin.com/"$4}';
  319. }
  320.  
  321. function start() { sudo systemctl start $@ ; }
  322. function stop() { sudo systemctl stop $@ ; }
  323. function restart() { sudo systemctl restart $@ ; }
  324. function status() { sudo systemctl status $@ ; }
  325. #function ativar() { sudo systemctl enable $@ ; }
  326. function disable() { sudo systemctl disable $@ ; }
  327.  
  328. ac() { # compress a file or folder
  329. case "$1" in
  330. tar.bz2|.tar.bz2) tar cvjf "${2%%/}.tar.bz2" "${2%%/}/" ;;
  331. tbz2|.tbz2) tar cvjf "${2%%/}.tbz2" "${2%%/}/" ;;
  332. tbz|.tbz) tar cvjf "${2%%/}.tbz" "${2%%/}/" ;;
  333. tar.xz) tar cvJf "${2%%/}.tar.xz" "${2%%/}/" ;;
  334. tar.gz|.tar.gz) tar cvzf "${2%%/}.tar.gz" "${2%%/}/" ;;
  335. tgz|.tgz) tar cvjf "${2%%/}.tgz" "${2%%/}/" ;;
  336. tar|.tar) tar cvf "${2%%/}.tar" "${2%%/}/" ;;
  337. rar|.rar) rar a "${2}.rar" "$2" ;;
  338. zip|.zip) zip -9 "${2}.zip" "$2" ;;
  339. 7z|.7z) 7z a "${2}.7z" "$2" ;;
  340. lzo|.lzo) lzop -v "$2" ;;
  341. gz|.gz) gzip -v "$2" ;;
  342. bz2|.bz2) bzip2 -v "$2" ;;
  343. xz|.xz) xz -v "$2" ;;
  344. lzma|.lzma) lzma -v "$2" ;;
  345. *) echo "ac(): compress a file or directory."
  346. echo "Usage: ac <archive type> <filename>"
  347. echo "Example: ac tar.bz2 PKGBUILD"
  348. echo "Please specify archive type and source."
  349. echo "Valid archive types are:"
  350. echo "tar.bz2, tar.gz, tar.gz, tar, bz2, gz, tbz2, tbz,"
  351. echo "tgz, lzo, rar, zip, 7z, xz and lzma." ;;
  352. esac
  353. }
  354.  
  355. ad() { # decompress archive (to directory $2 if wished for and possible)
  356. if [ -f "$1" ] ; then
  357. case "$1" in
  358. *.tar.bz2|*.tgz|*.tbz2|*.tbz) mkdir -v "$2" 2>/dev/null ; tar xvjf "$1" -C "$2" ;;
  359. *.tar.gz) mkdir -v "$2" 2>/dev/null ; tar xvzf "$1" -C "$2" ;;
  360. *.tar.xz) mkdir -v "$2" 2>/dev/null ; tar xvJf "$1" ;;
  361. *.tar) mkdir -v "$2" 2>/dev/null ; tar xvf "$1" -C "$2" ;;
  362. *.rar) mkdir -v "$2" 2>/dev/null ; 7z x "$1" "$2" ;;
  363. *.zip) mkdir -v "$2" 2>/dev/null ; unzip "$1" -d "$2" ;;
  364. *.7z) mkdir -v "$2" 2>/dev/null ; 7z x "$1" -o"$2" ;;
  365. *.lzo) mkdir -v "$2" 2>/dev/null ; lzop -d "$1" -p"$2" ;;
  366. *.gz) gunzip "$1" ;;
  367. *.bz2) bunzip2 "$1" ;;
  368. *.Z) uncompress "$1" ;;
  369. *.xz|*.txz|*.lzma|*.tlz) xz -d "$1" ;;
  370. *)
  371. esac
  372. else
  373. echo "Sorry, '$2' could not be decompressed."
  374. echo "Usage: ad <archive> <destination>"
  375. echo "Example: ad PKGBUILD.tar.bz2 ."
  376. echo "Valid archive types are:"
  377. echo "tar.bz2, tar.gz, tar.xz, tar, bz2,"
  378. echo "gz, tbz2, tbz, tgz, lzo,"
  379. echo "rar, zip, 7z, xz and lzma"
  380. fi
  381. }
  382.  
  383. al() { # list content of archive but don't unpack
  384. if [ -f "$1" ]; then
  385. case "$1" in
  386. *.tar.bz2|*.tbz2|*.tbz) tar -jtf "$1" ;;
  387. *.tar.gz) tar -ztf "$1" ;;
  388. *.tar|*.tgz|*.tar.xz) tar -tf "$1" ;;
  389. *.gz) gzip -l "$1" ;;
  390. *.rar) rar vb "$1" ;;
  391. *.zip) unzip -l "$1" ;;
  392. *.7z) 7z l "$1" ;;
  393. *.lzo) lzop -l "$1" ;;
  394. *.xz|*.txz|*.lzma|*.tlz) xz -l "$1" ;;
  395. esac
  396. else
  397. echo "Sorry, '$1' is not a valid archive."
  398. echo "Valid archive types are:"
  399. echo "tar.bz2, tar.gz, tar.xz, tar, gz,"
  400. echo "tbz2, tbz, tgz, lzo, rar"
  401. echo "zip, 7z, xz and lzma"
  402. fi
  403. }
  404.  
  405. # Find file in current directory
  406. function ff() { find . -type f -iname '*'$*'*' -ls ; }
  407.  
  408. function zumbis() {
  409. ps f -eo state,pid,ppid,comm | awk '
  410. { cmds[$2] = $NF }
  411. /^Z/ { print $(NF-1) "/" $2 " zombie child of " cmds[$3] "/" $3 }'
  412. }
  413.  
  414. # Powerfonts
  415. if [[ -r/usr/lib/python3.5/site-packages/powerline/bindings/zsh/powerline.zsh ]]; then
  416. source /usr/lib/python3.5/site-packages/powerline/bindings/zsh/powerline.zsh
  417. fi
  418.  
  419. #Aliases systemctl
  420. alias service='systemctl list-unit-files | grep enable'
  421. alias offservice='systemctl list-unit-files | grep disable'
  422.  
  423. #Aliase mpdviz
  424.  
  425. alias mpdviz='mpdviz --file="/tmp/mpd.fifo" --icolor=true --scale=2 --step=8 -v spectrum -d true'
  426.  
  427. #Aliases Git
  428. alias ga='git add'
  429. alias gcm='git commit -m'
  430. alias gpom='git push origin master'
  431.  
  432. #Aliases - Shortcuts to commands
  433. alias ls='ls -CFb'
  434. alias la='ls -LaFb'
  435. alias ll='ls -lFb'
  436. alias dc='dcfldd'
  437.  
  438. #Several aliases
  439. alias saidar='saidar -c' # pacman -S libstatgrab pystatgrab;
  440. #alias df='dfc -dTls' #pacman -S dfc
  441. alias cp='vcp -gR' #cp advanced to support the progress bar, percentage calculation and data control.
  442. #alias ping='gping'
  443.  
  444. #Aliases pacman
  445. alias pacsearch="pacman -Sl | cut -d' ' -f2 | grep " # It allows you to search all available packages simply using 'pacsearch packagename':
  446. alias pkglist="comm -13 <(pacman -Qmq | sort) <(pacman -Qqe | sort) > pkglist" # Create list of all installed packages
  447. alias pacup='sudo pacman -Syu' # Synchronises repositories and updates if you have any update
  448. alias pacre='sudo pacman -Rns' # Remove a specific package and all its dependencies and configurations
  449. alias pacorf='sudo pacman -Rns $(pacman -Qtdq)' # Create list of orphaned packages for removal
  450. alias pacin='sudo pacman -S' # Install a specific package
  451.  
  452. #Aliases yaourt
  453. alias yaupg='yaourt -Syua' # Synchronises repositories and updates if you have any update by aur
  454. alias yain='yaourt -S' # Install a specific package
  455. alias yarem='yaourt -Rns' # Remove a specific package and all its dependencies and configurations
  456. alias yare='yaourt -R' # Remove a specific package, but does not remove its dependencies and configurations
  457.  
  458. #Common errors
  459. alias cd..='cd ..'
  460. alias ...='cd ..'
  461. alias ....='cd ../..'
  462.  
  463. #May the force be with you
  464. alias starwars="telnet towel.blinkenlights.nl"
  465.  
  466. #Agenda
  467. alias agenda='calcurse'
  468.  
  469. #Lists the last 10 commands executed in the shell
  470. alias top10='print -l ${(o)history%% *} | uniq -c | sort -nr | head -n 10'
  471.  
  472. #Processos usados pela Web
  473. alias ports='lsof -i -n -P'
  474.  
  475. #Coloring the cat command # pacman -S lolcat
  476. alias cat='lolcat'
  477.  
  478. #Command help in the Zsh
  479. alias help='run-help'
  480.  
  481. # Screenfetch colorful
  482. alias sf='screenfetch | lolcat'
  483.  
  484. typeset -A key
  485.  
  486. key[Home]=${terminfo[khome]}
  487. key[End]=${terminfo[kend]}
  488. key[Insert]=${terminfo[kich1]}
  489. key[Delete]=${terminfo[kdch1]}
  490. key[Up]=${terminfo[kcuu1]}
  491. key[Down]=${terminfo[kcud1]}
  492. key[Left]=${terminfo[kcub1]}
  493. key[Right]=${terminfo[kcuf1]}
  494. key[PageUp]=${terminfo[kpp]}
  495. key[PageDown]=${terminfo[knp]}
  496.  
  497. # setup key accordingly
  498. [[ -n "${key[Home]}" ]] && bindkey "${key[Home]}" beginning-of-line
  499. [[ -n "${key[End]}" ]] && bindkey "${key[End]}" end-of-line
  500. [[ -n "${key[Insert]}" ]] && bindkey "${key[Insert]}" overwrite-mode
  501. [[ -n "${key[Delete]}" ]] && bindkey "${key[Delete]}" delete-char
  502. [[ -n "${key[Up]}" ]] && bindkey "${key[Up]}" up-line-or-history
  503. [[ -n "${key[Down]}" ]] && bindkey "${key[Down]}" down-line-or-history
  504. [[ -n "${key[Left]}" ]] && bindkey "${key[Left]}" backward-char
  505. [[ -n "${key[Right]}" ]] && bindkey "${key[Right]}" forward-char
  506.  
  507. # Finally, make sure the terminal is in application mode, when zle is
  508. # active. Only then are the values from $terminfo valid.
  509. function zle-line-init () {
  510. echoti smkx
  511. }
  512. function zle-line-finish () {
  513. echoti rmkx
  514. }
  515.  
  516. if [ -n "${DISPLAY:-}" ]; then
  517. zle -N zle-line-init
  518. zle -N zle-line-finish
  519. fi
Advertisement
Add Comment
Please, Sign In to add comment