added vim pager

This commit is contained in:
Paweł Płazieński 2016-07-22 12:27:43 +02:00
parent faac707bbf
commit 7d383d0bb0

20
.zshrc
View File

@ -448,6 +448,26 @@ alias su="sudo -u root -i"
# disable sudo correction for commands # disable sudo correction for commands
alias sudo="nocorrect sudo" alias sudo="nocorrect sudo"
#---------------------------------- VIM pager --------------------------------
vim_pager() {
local source_file;
if [ ! -t 1 ]; then
echo "Cannot use vim pager with non-terminal output" 1>&2
return 1
fi
if [ $# -gt 0 ]; then
source_file="$@";
elif [ ! -t 0 ]; then
source_file="-";
else
echo "Input stream or file name missing" 1>&2
return 2
fi
vim --cmd 'let no_plugin_maps = 1' -c 'runtime! macros/less.vim' $source_file
}
alias vless='vim_pager'
#---------------------------------- Maven ------------------------------------ #---------------------------------- Maven ------------------------------------
# Read project information from current directory - needed for prompt # Read project information from current directory - needed for prompt