update
This commit is contained in:
parent
43046edb90
commit
883549eba6
2 changed files with 15 additions and 6 deletions
11
.zshrc
11
.zshrc
|
|
@ -22,9 +22,14 @@ compinit
|
||||||
#
|
#
|
||||||
|
|
||||||
nvr_git () {
|
nvr_git () {
|
||||||
local repo_path=$(git rev-parse --show-superproject-working-tree 2>/dev/null)
|
local main_module_repo_path=$(git rev-parse --show-superproject-working-tree 2>/dev/null)
|
||||||
if [ -n "$repo_path" ]; then
|
local repo_path=$(git rev-parse --show-toplevel 2>/dev/null)
|
||||||
local servername=/tmp/nvr$(echo $repo_path | tr "/" "_")
|
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 "$@"
|
nvr -s --servername $servername "$@"
|
||||||
else
|
else
|
||||||
/usr/bin/nvim "$@"
|
/usr/bin/nvim "$@"
|
||||||
|
|
|
||||||
10
nvim_remote
10
nvim_remote
|
|
@ -4,15 +4,19 @@ line=$(cut -d " " -f 1 <<< $@)
|
||||||
path=$(cut -d " " -f 2 <<< $@)
|
path=$(cut -d " " -f 2 <<< $@)
|
||||||
|
|
||||||
main_module_repo_path=$(git rev-parse --show-superproject-working-tree 2>/dev/null)
|
main_module_repo_path=$(git rev-parse --show-superproject-working-tree 2>/dev/null)
|
||||||
|
repo_path=$(git rev-parse --show-toplevel 2>/dev/null)
|
||||||
|
if [[ -z "$main_module_repo_path" ]]; then
|
||||||
|
main_module_repo_path=$repo_path
|
||||||
|
fi
|
||||||
|
|
||||||
main_module_relative_file_path=$main_module_repo_path/$path
|
main_module_relative_file_path=$main_module_repo_path/$path
|
||||||
repo_relative_file_path=$(git rev-parse --show-toplevel 2>/dev/null)/$path
|
repo_relative_file_path=/$path
|
||||||
relative_file_path=$path
|
relative_file_path=$path
|
||||||
|
|
||||||
servername=/tmp/nvr$(echo $main_module_repo_path | tr "/" "_")
|
servername=/tmp/nvr$(echo $main_module_repo_path | tr "/" "_")
|
||||||
|
|
||||||
if [ -n "$relative_path" ]; then
|
if [ -n "$relative_file_path" ]; then
|
||||||
nvr -s --servername $servername $line "$relative_path"
|
nvr -s --servername $servername $line "$relative_file_path"
|
||||||
elif [ -n "$repo_relative_file_path" ]; then
|
elif [ -n "$repo_relative_file_path" ]; then
|
||||||
nvr -s --servername $servername $line "$repo_relative_file_path"
|
nvr -s --servername $servername $line "$repo_relative_file_path"
|
||||||
elif [ -n "$main_module_relative_file_path" ]; then
|
elif [ -n "$main_module_relative_file_path" ]; then
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue