diff options
author | Guangxiong Lin <[email protected]> | 2023-01-21 09:16:41 +0800 |
---|---|---|
committer | Guangxiong Lin <[email protected]> | 2023-01-21 09:16:41 +0800 |
commit | 662b5f11b76f5eb1ea825bf2efb74beeca20e916 (patch) | |
tree | f70cde833e84d1016ad664e06c349fbe7671e055 | |
parent | c0ed6641a1180147cdd922316706673e77c7a962 (diff) | |
download | dotfiles-662b5f11b76f5eb1ea825bf2efb74beeca20e916.tar.gz dotfiles-662b5f11b76f5eb1ea825bf2efb74beeca20e916.tar.bz2 dotfiles-662b5f11b76f5eb1ea825bf2efb74beeca20e916.zip |
Make open command as binary
-rw-r--r-- | .functions | 12 | ||||
-rwxr-xr-x | bin/open | 9 |
2 files changed, 10 insertions, 11 deletions
@@ -1,15 +1,5 @@ #!/usr/bin/env bash -open () { - if [ -f /usr/bin/xdg-open ]; then - nohup xdg-open "$*" > /dev/null 2>&1 & - elif [ -f /usr/bin/open ]; then - /usr/bin/open "$*" - else - echo "No usable program is found" - fi -} - greview () { usage='usage: greview <base_branch>' if [ $# -lt 1 ]; then @@ -24,6 +14,6 @@ greview () { # "+nmap <C-k> :tabpreivous<CR>" vim $(git diff --merge-base --name-only $base_branch) \ - "+nmap <leader>gd :Gvdiffsplit $base_branch<CR>" + "+nmap <leader>gd :Gvdiffsplit $base_branch<CR>" } diff --git a/bin/open b/bin/open new file mode 100755 index 0000000..f5dd273 --- /dev/null +++ b/bin/open @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +if [ -f /usr/bin/xdg-open ]; then + nohup xdg-open "$*" > /dev/null 2>&1 & +elif [ -f /usr/bin/open ]; then + /usr/bin/open "$*" +else + echo "No usable program is found" +fi |