From 43aa8a11f1ffc328d7ce994359f9a85e8cc3ca67 Mon Sep 17 00:00:00 2001 From: Alex Karle Date: Tue, 30 Jul 2019 23:47:42 -0400 Subject: [PATCH] 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. --- bash/aliases | 10 ++-------- bash/bashrc | 2 +- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/bash/aliases b/bash/aliases index 41f8477..0934e56 100644 --- 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 index 8253f08..79a4034 100644 --- 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 -- libgit2 0.28.4