From 27ae4b7f96462cfb4b1e0e97805bf38da6c1fa26 Mon Sep 17 00:00:00 2001 From: Jaroslaw Konik Date: Wed, 9 Apr 2025 14:45:05 +0200 Subject: [PATCH] update --- init.lua | 1 + nvr_git | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 nvr_git diff --git a/init.lua b/init.lua index cd1a13f..1d1559f 100644 --- a/init.lua +++ b/init.lua @@ -475,6 +475,7 @@ map('n', '', 'BufferMovePrevious', opts) map('n', '', 'BufferMoveNext', opts) map('n', '', 'BufferClose', opts) map('n', '', 'BufferPick', opts) +map('t', '', '', opts) vim.keymap.set('n', 'fg', 'lua require("spectre").toggle()', { desc = "Toggle Spectre" diff --git a/nvr_git b/nvr_git new file mode 100644 index 0000000..122407a --- /dev/null +++ b/nvr_git @@ -0,0 +1,15 @@ +nvr_git () { + local main_module_repo_path=$(git rev-parse --show-superproject-working-tree 2>/dev/null) + local repo_path=$(git rev-parse --show-toplevel 2>/dev/null) + if [[ -z "$main_module_repo_path" ]]; then + main_module_repo_path=$repo_path + fi + + if [ -n "$main_module_repo_path" ]; then + local servername=/tmp/nvr$(echo $main_module_repo_path | tr "/" "_") + nvr -s --servername $servername "$@" + else + /usr/bin/nvim "$@" + fi +} +nvr_git()