From 9b4e8b9f7b20247ebfeae7d7b9d077549b5915ea Mon Sep 17 00:00:00 2001 From: Thomas Forgione Date: Fri, 28 Sep 2018 12:20:07 +0200 Subject: [PATCH 1/2] Dont call mars if not installedDont call mars if not installedDont call mars if not installedDont call mars if not installedDont call mars if not installedDont call mars if not installedDont call mars if not installed --- init.vim | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/init.vim b/init.vim index 97babaf..24db8e5 100644 --- a/init.vim +++ b/init.vim @@ -57,10 +57,18 @@ set list set listchars=tab:  ,trail:·,extends:>,precedes:<,nbsp:¬ " Remove trailing spaces autocmd BufWritePre * :%s/\s\+$//e + " Compile on F12 -nnoremap :wa \| !make-client.py -inoremap :wa \|!make-client.py -vnoremap :wa \|!make-client.py +if executable('mars') + nnoremap :wa \| !mars + inoremap :wa \|!mars + vnoremap :wa \|!mars +elseif executable('make') + nnoremap :wa \| !make + inoremap :wa \|!make + vnoremap :wa \|!make +endif + " Escape on F1 map imap From b031ea3ae1a21653ae0cfb945a2c22fab57c27d5 Mon Sep 17 00:00:00 2001 From: Thomas Forgione Date: Fri, 28 Sep 2018 12:58:09 +0200 Subject: [PATCH 2/2] Vim or Neovim --- zsh/exports.zsh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/zsh/exports.zsh b/zsh/exports.zsh index d9c2767..674b86f 100644 --- a/zsh/exports.zsh +++ b/zsh/exports.zsh @@ -1,5 +1,10 @@ # My editor -export EDITOR="vim" +command -v nvim > /dev/null 2>&1 +if [ $? -eq 0 ]; then + export EDITOR="nvim" +else + export EDITOR="vim" +fi # Parallel conpilation with make export MAKEFLAGS="+j`nproc`"