Explorar el Código

add space as a fold toggle in vim, and fix bug in git prompt status

IFS= is needed after all, to have the lines read properly.
Weiyi Lou hace 13 años
padre
commit
4d921fa175
Se han modificado 2 ficheros con 4 adiciones y 1 borrados
  1. 3 0
      vim/vimrc
  2. 1 1
      zsh/omz-custom/cinaeco.zsh-theme

+ 3 - 0
vim/vimrc

@@ -165,6 +165,9 @@ imap II <Esc>
 " Yank to end of line, like D deletes to end of line
 nmap Y y$
 
+" Space as a folding toggle in normal mode.
+nnoremap <silent> <Space> @=(foldlevel('.')?'za':"\<Space>")<CR>
+
 " Clear trailing white space
 nmap <silent> <leader>$    :%s/\s\+$//g<CR>
 

+ 1 - 1
zsh/omz-custom/cinaeco.zsh-theme

@@ -55,7 +55,7 @@ git_prompt_status() {
   X_SET=""
   Y_SET=""
   UN_SET=""
-  echo $INDEX | while read LINE; do
+  echo $INDEX | while IFS= read LINE; do
     X=$LINE[1]
     Y=$LINE[2]
     [[ $X$Y == '??' ]] && UN_SET="$UN_SET$ZSH_THEME_GIT_PROMPT_UNTRACKED" && continue