commit 857e2fafbc6e1b46fae12437de00bffb0f355405 (patch)
parent ea9a96ab61471cdcb58e20779e361d7e8ee2ef57
Author: Alexander Karle <akarle@umass.edu>
Date: Tue, 29 May 2018 00:40:49 -0400
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!
Diffstat:
3 files changed, 28 insertions(+), 2 deletions(-)
diff --git a/neovim/init.vim 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 <C-h> <C-\><C-n><C-w>hA
+tnoremap <C-j> <C-\><C-n><C-w>jA
+tnoremap <C-k> <C-\><C-n><C-w>kA
+tnoremap <C-l> <C-\><C-n><C-w>lA
diff --git a/vim/ftplugin/c.vim b/vim/ftplugin/c.vim
@@ -0,0 +1,4 @@
+" for neovim development!
+if exists( "g:loaded_youcompleteme" )
+ nnoremap <buffer> <c-]> :YcmCompleter GoTo<CR>
+endif
diff --git 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