mirror of
https://github.com/Stunkymonkey/dotfiles.git
synced 2026-01-29 01:13:01 +01:00
nvim: set EDITOR variable only if installed
Since git core.editor was set in the initial commit, I suspect I wasn't aware of $EDITOR in the environment. So it's safe to delete git/gitconfig's core.editor and take it from $EDITOR by default, which actually checks if nvim is installed. for git's diff.tool and merge.tool, I don't see a possibility to have a conditional switch and fallback to vim. I don't expect to work on another workstation without neovim.
This commit is contained in:
parent
e2a098ce82
commit
881d4a0340
2 changed files with 7 additions and 3 deletions
|
|
@ -11,7 +11,6 @@
|
||||||
tool = nvim -d
|
tool = nvim -d
|
||||||
conflictstyle = zdiff3
|
conflictstyle = zdiff3
|
||||||
[core]
|
[core]
|
||||||
editor = nvim
|
|
||||||
eol = native
|
eol = native
|
||||||
pager = delta || (diff-so-fancy | less --tabs=4 -RFX)
|
pager = delta || (diff-so-fancy | less --tabs=4 -RFX)
|
||||||
quotepath = false
|
quotepath = false
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,10 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
if [ -n "$(type nvim 2>/dev/null)" ]; then
|
||||||
export EDITOR=nvim
|
export EDITOR=nvim
|
||||||
export VISUAL=nvim
|
export VISUAL=nvim
|
||||||
|
else
|
||||||
|
export EDITOR=vim
|
||||||
|
export VISUAL=vim
|
||||||
|
fi
|
||||||
export BROWSER=firefox
|
export BROWSER=firefox
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue