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 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`"