Swap to nvim, but make sure vim still works

This commit is contained in:
Andrew Tomaka 2017-08-31 00:19:46 -04:00
parent fbc528da5f
commit f113e0428c
No known key found for this signature in database
GPG key ID: C78D1A81582BAC86
7 changed files with 34 additions and 14 deletions

View file

@ -1,14 +1,18 @@
excludes = -I Makefile -I README.md excludes = -I Makefile -I README.md
symlinks = $(shell find . \( ! -iname "Makefile" ! -iname "README.md" ! -iname ".*" ! -path "./.git/*" ! -path "./zsh/*" \) | sed 's|./||') symlinks = $(shell find . \( ! -iname "Makefile" ! -iname "README.md" ! -iname ".*" ! -path "./.git/*" ! -path "./zsh/*" ! -path "./nvim/*" ! -iname "nvim" \) | sed 's|./||')
.PHONY: $(symlinks) .PHONY: $(symlinks) nvim
all: install all: install
install: plug-vim $(symlinks) install: plug-vim $(symlinks)
nvim:
mkdir -p ~/.config/nvim
cp nvim/init.vim ~/.config/nvim/
plug-vim: plug-vim:
if test ! -d ~/.vim/autoload/plug.vim ; then \ if test ! -f ~/.vim/autoload/plug.vim ; then \
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \ curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim ; \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim ; \
fi fi

View file

@ -80,7 +80,7 @@ alias pf="port-forward"
alias t="tmux new-session -A -s" alias t="tmux new-session -A -s"
alias tf="tail -f" alias tf="tail -f"
alias tls="tmux list-sessions" alias tls="tmux list-sessions"
alias v="vim" alias v="$EDITOR"
alias w="python -m SimpleHTTPServer" alias w="python -m SimpleHTTPServer"
alias wo="curl http://wttr.in/48912?m" alias wo="curl http://wttr.in/48912?m"
alias y="yarn" alias y="yarn"

View file

@ -33,7 +33,6 @@
gpgsign = true gpgsign = true
[core] [core]
autocrlf = input autocrlf = input
editor = vim
excludesfile = ~/.gitignore_global excludesfile = ~/.gitignore_global
filemode = false filemode = false
[gpg] [gpg]

3
nvim/init.vim Normal file
View file

@ -0,0 +1,3 @@
set runtimepath+=~/.vim,~/.vim/after
set packpath+=~/.vim
source ~/.vimrc

View file

@ -1,10 +1,13 @@
# for setting up # for setting up
bind-key r source-file ~/.tmux.conf \; display-message " ✱ ~/.tmux.conf is reloaded" bind-key r source-file ~/.tmux.conf \; display-message " ✱ ~/.tmux.conf is reloaded"
# 256 colors # colors
set -g default-terminal "screen-256color" set -g default-terminal "screen-256color"
set-option -ga terminal-overrides ",xterm-256color:Tc" set-option -ga terminal-overrides ",xterm-256color:Tc"
# faster escaping? From neovim CheckHealth
set-option -sg escape-time 10
# double tap for back and forth # double tap for back and forth
bind-key C-b last-window bind-key C-b last-window

17
vimrc
View file

@ -2,8 +2,8 @@
call plug#begin('~/.vim/plugged') call plug#begin('~/.vim/plugged')
" colors " colors
Plug 'alessandroyorba/alduin'
Plug 'nanotech/jellybeans.vim' Plug 'nanotech/jellybeans.vim'
Plug 'joshdick/onedark.vim'
" keepers " keepers
Plug 'airblade/vim-gitgutter' Plug 'airblade/vim-gitgutter'
@ -46,8 +46,6 @@ set cpoptions+=$ " delimit end of change text
set laststatus=2 " Always show status line set laststatus=2 " Always show status line
set showmode " Show current mode set showmode " Show current mode
set history=100 " History length set history=100 " History length
set cursorline " Highlight current line
set cursorcolumn " Highlight current column
set nowrap " Disable wrapping by default set nowrap " Disable wrapping by default
set backspace=2 " Backspace over indent, eol, start of insert set backspace=2 " Backspace over indent, eol, start of insert
set hlsearch " Search highlights set hlsearch " Search highlights
@ -147,13 +145,18 @@ map <Leader>sz :so ~/.vimrc<cr>
" PLUGIN CONFIGURATION " PLUGIN CONFIGURATION
" style " style
set t_8f=[38;2;%lu;%lu;%lum
set t_8b=[48;2;%lu;%lu;%lum
if has('nvim')
set termguicolors
set cursorline " Highlight current line
set cursorcolumn " Highlight current column
colorscheme onedark
else
colorscheme jellybeans colorscheme jellybeans
endif
syntax enable syntax enable
highlight ColorColumn ctermbg=236
highlight CursorColumn ctermbg=236
highlight CursorLine ctermbg=236
" go " go
let g:go_fmt_command = "goimports" let g:go_fmt_command = "goimports"

8
zshenv
View file

@ -28,4 +28,12 @@ fi
# MAN # MAN
[[ -d "$GNU_TOOLS_MAN_PATH" ]] && MANPATH="$GNU_TOOLS_MAN_PATH:$MANPATH" [[ -d "$GNU_TOOLS_MAN_PATH" ]] && MANPATH="$GNU_TOOLS_MAN_PATH:$MANPATH"
# EDITOR
if [[ -x "$(command -v nvim)" ]]; then
export {EDITOR,GIT_EDITOR}=nvim
else
export {EDITOR,GIT_EDITOR}=vim
fi
export GOPATH="$HOME/go-workspace/" export GOPATH="$HOME/go-workspace/"