From 25d4f1df54f829a7491bc52c652606e22c23e376 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Tue, 26 Feb 2019 10:31:40 +0100 Subject: [PATCH] Automatically call nvim with vim command if installed --- .config/zsh/6-base | 4 +++- .config/zsh/6-nvim-to-vim-if-installed | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .config/zsh/6-nvim-to-vim-if-installed diff --git a/.config/zsh/6-base b/.config/zsh/6-base index 4711f6d..e702ab1 100644 --- a/.config/zsh/6-base +++ b/.config/zsh/6-base @@ -8,7 +8,7 @@ if [[ "$(uname -s)" == "Linux" ]]; then fi # Show the top 5 commands used in recent history -alias historysummary="history | awk '{a[\$2]++} END{for(i in a){printf \"%5d\t%s\n\",a[i],i}}' | sort -rn | head" +alias zhtop="history | awk '{a[\$2]++} END{for(i in a){printf \"%5d\t%s\n\",a[i],i}}' | sort -rn | head" # Display timestamped recent command history alias zh="fc -l -d -D" @@ -20,3 +20,5 @@ alias ..="cd .." # overwritten by enhancd config in .zshrc.d/ alias ...="cd ../.." alias ~="cd ~" +# make v call vim +alias v="vim" diff --git a/.config/zsh/6-nvim-to-vim-if-installed b/.config/zsh/6-nvim-to-vim-if-installed new file mode 100644 index 0000000..1956d14 --- /dev/null +++ b/.config/zsh/6-nvim-to-vim-if-installed @@ -0,0 +1,4 @@ +#!/bin/sh + +# Check for existence of nvim command. If found, substitute vim with it. +type nvim >/dev/null 2>&1 && alias vim=nvim