about summary refs log blame commit diff
path: root/emacs/index.sh
blob: e794c24ae942bd0442e45278f61612d740de26d7 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11










                                        
                                         
    
                                


  



                                                        
                 



      






                                      
#!/usr/bin/env zsh


if [ -n "$INSIDE_EMACS" ]; then
    export PAGER="create-shell-pager.sh"
else
    export PAGER="less"
fi


if [ -n "$INSIDE_EMACS" ]; then
    export EDITOR="edit-file-in-emacs.sh"
else
    export EDITOR="command nvim"
fi


vim () {
    if [ -n "$INSIDE_EMACS" ]; then
        emacsclient -e "(find-file-other-window \"$1\")"
    else
        nvim "$1"
    fi
}


man () {
    if [ -n "$INSIDE_EMACS" ]; then
        emacsclient -e  "(man \"$1\")"
    else
        command man "$1"
    fi
}