From 5ec73d44d6eddb9491311f633f4be6ef609768b6 Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Fri, 20 Jan 2023 00:42:58 +0100 Subject: qol improvements --- utils/bashrc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'utils') 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 # 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 + +} + + + -- cgit v1.2.3