aboutsummaryrefslogtreecommitdiff
path: root/utils/bashrc
blob: f0ee98b40e70afacb86949a8ea5558bfe21122f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46

# gvim () { /bin/gvim $(if [[ "$#" > 0 && `/bin/gvim --serverlist | wc -l` ]]; then echo --remote; fi) $@;  }
# vim ()  { /bin/vim  $(if [[ "$#" > 0 && `/bin/vim --serverlist | wc -l` ]];  then echo --remote; fi) $@;  }

# man()
# {
#     /bin/gvim \
#         $(if [[ `/bin/gvim --serverlist | wc -l` > 0 ]]; then echo --remote-send; fi) \
#         ":enew<CR>:0read !groffer --pager='cat' --tty $1 <bar> col -bx<CR> :set filetype=man buftype=nowrite readonly<CR>gg";
# }

# export MANPAGER='vim -c":set noswapfile|%!col -b" -c":file man|:setlocal filetype=man buftype=nowrite readonly nonumber nolist signcolumn=no" -'
export MANPAGER="vim -M +MANPAGER -" 

# man() { /bin/vim ":enew<CR>:0read !groffer --pager='cat' --tty $1 <bar> col -bx<CR> :set filetype=man buftype=nowrite readonly<CR>gg" -; }
# alias git='git -c color.ui=false'
# export GIT_DIFF_OPTS="--no-color"



git config --global --replace-all color.pager 0
git config --global --replace-all core.pager 'vim -c":set noswapfile filetype=git buftype=nowrite readonly nolist nonumber signcolumn=no|:file git" -'
# export GIT_PAGER=''

# alias git="TERM=dumb git"

# export EDITOR="gvim()"
# export PAGER="tee /tmp/output.txt /dev/stdout | /bin/vim -"

# --remote-expr ":%!col -b" -c":set buftype=nowrite filetype=man readonly" -'A

function vim() {
    SERVER=$(ls -tr "$XDG_RUNTIME_DIR"/nvim.* | tail -n1)
    if [ $# -gt 0 ] && [ -n "$SERVER" ]; then
        for i in "$@"; do
            NEXT=$(realpath "$i")
            nvim --server "$SERVER" --remote-silent "$NEXT"
        done
    else
        nvim $@
    fi

}



..