commit 43aa8a11f1ffc328d7ce994359f9a85e8cc3ca67 (patch)
parent d4d0e3938342e1e876468cd0b53cb180d8a06b26
Author: Alex Karle <alex@karle.co>
Date: Tue, 30 Jul 2019 23:47:42 -0400
bash: prefer Vim over NeoVim in Virtual Console
If $DISPLAY isn't set (we aren't in X), I have come to prefer Vim over
NeoVim.
It pains me, because I *feel* like NeoVim should work fine, but for the
life of me I cannot get 256 colors (or even linux-16color) to render
properly in the VC.
The problem with NeoVim is that it took out the concept of t_XX
settings, which means that t_Co is perpetually at 256 colors which means
that colorschemes will try to use colors outside of the 8 base colors
which makes for some wonky colorschemes (try visual mode without any
indication of the selection... fun stuff).
Vim still handles t_Co=8 well, and correctly identifies it in both
TERM=linux and TERM=screen/tmux, so I've opted to prefer Vim in in the
VC.
Diffstat:
2 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/bash/aliases b/bash/aliases
@@ -41,14 +41,8 @@ if [ -n "$(type -t __git_complete)" ] && [ "$(type -t __git_complete)" == "funct
__git_complete gb _git_branch
fi
-# Alias vim / vi to nvim if there
-if [ -x "$(command -v nvim)" ]; then
- alias v="nvim"
-else
- alias v="vim"
-fi
-
-# Other Aliases
+# Quick Actions
+alias v=$EDITOR
alias cddv='cd ~/.vim'
alias grep='grep --color'
alias ...='cd ../../..'
diff --git a/bash/bashrc b/bash/bashrc
@@ -32,7 +32,7 @@ function aw { w3m "https://wiki.archlinux.org/index.php?search=$1"; }
function ddg { w3m "https://duckduckgo.com/lite?q=$1"; }
# $EDITOR, the most important export of course
-if [ -x "$(command -v nvim)" ]; then
+if [[ -x "$(command -v nvim)" && -n "$DISPLAY" ]]; then
export EDITOR="nvim"
export MANPAGER="nvim -u NORC -c 'set ft=man' -"
else