From 857e2fafbc6e1b46fae12437de00bffb0f355405 Mon Sep 17 00:00:00 2001 From: Alexander Karle Date: Tue, 29 May 2018 00:40:49 -0400 Subject: [PATCH] Switching to neovim for main editor! - Including basic neovim init.vim (sources the vimrc), - Alias vim to nvim if executable in zsh - C files check if YCM is available for nvim development! --- neovim/init.vim | 14 ++++++++++++++ vim/ftplugin/c.vim | 4 ++++ zsh/zshrc | 12 ++++++++++-- 3 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 neovim/init.vim create mode 100644 vim/ftplugin/c.vim diff --git a/neovim/init.vim b/neovim/init.vim new file mode 100644 index 0000000..545704c --- /dev/null +++ b/neovim/init.vim @@ -0,0 +1,14 @@ +" init.vim -- the config for neovim +" +" Used for specific neovim customization! + +" First, just source the regular Vim stuff +set runtimepath+=~/.vim,~/.vim/after +set packpath+=~/.vim +source ~/.vimrc + +" Custom mappings +tnoremap hA +tnoremap jA +tnoremap kA +tnoremap lA diff --git a/vim/ftplugin/c.vim b/vim/ftplugin/c.vim new file mode 100644 index 0000000..652c632 --- /dev/null +++ b/vim/ftplugin/c.vim @@ -0,0 +1,4 @@ +" for neovim development! +if exists( "g:loaded_youcompleteme" ) + nnoremap :YcmCompleter GoTo +endif diff --git a/zsh/zshrc b/zsh/zshrc index ecb7b9c..84d100f 100644 --- a/zsh/zshrc +++ b/zsh/zshrc @@ -15,8 +15,14 @@ export DEFAULT_USER="$(whoami)" # prevent zsh from renaming tmux windows DISABLE_AUTO_TITLE="true" -# export editor for tmuxinator -export EDITOR="vim" +# use nvim as man pager / editor if available +if (( $+commands[nvim] )); then + export EDITOR="nvim" + export MANPAGER="nvim -c 'set ft=man' -" + alias vim='nvim' +else + export EDITOR="vim" +fi # 10ms for key sequences KEYTIMEOUT=1 @@ -56,3 +62,5 @@ alias vup="vagrant up" # cd to a parent directory function pcd { cd ${PWD%/$1/*}/$1; } + +[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh -- libgit2 0.28.4