diff options
Diffstat (limited to 'utils/bashrc')
-rw-r--r-- | utils/bashrc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/utils/bashrc b/utils/bashrc index 24c51a0..f0ee98b 100644 --- a/utils/bashrc +++ b/utils/bashrc | |||
@@ -28,3 +28,19 @@ git config --global --replace-all core.pager 'vim -c":set noswapfile filetype=gi | |||
28 | # export PAGER="tee /tmp/output.txt /dev/stdout | /bin/vim -" | 28 | # export PAGER="tee /tmp/output.txt /dev/stdout | /bin/vim -" |
29 | 29 | ||
30 | # --remote-expr ":%!col -b" -c":set buftype=nowrite filetype=man readonly" -'A | 30 | # --remote-expr ":%!col -b" -c":set buftype=nowrite filetype=man readonly" -'A |
31 | |||
32 | function vim() { | ||
33 | SERVER=$(ls -tr "$XDG_RUNTIME_DIR"/nvim.* | tail -n1) | ||
34 | if [ $# -gt 0 ] && [ -n "$SERVER" ]; then | ||
35 | for i in "$@"; do | ||
36 | NEXT=$(realpath "$i") | ||
37 | nvim --server "$SERVER" --remote-silent "$NEXT" | ||
38 | done | ||
39 | else | ||
40 | nvim $@ | ||
41 | fi | ||
42 | |||
43 | } | ||
44 | |||
45 | |||
46 | |||