Vim changes

* persistent undo and autowrite
* Neat search and stop mapping cap q
* fix fat finger
* auto indent smarter
This commit is contained in:
Andrew Tomaka 2016-02-13 21:05:10 -05:00
parent 909dad929c
commit f0a7112908
2 changed files with 53 additions and 38 deletions

22
vimrc
View file

@ -1,8 +1,6 @@
" Fix for CSE servers
scriptencoding utf-8 scriptencoding utf-8
set encoding=utf-8 set encoding=utf-8
" vundle bundle; not for changing " vundle bundle; not for changing
set nocompatible " Disable vi compatibility set nocompatible " Disable vi compatibility
filetype off filetype off
@ -14,6 +12,7 @@ Plugin 'gmarik/vundle'
Plugin 'airblade/vim-gitgutter' Plugin 'airblade/vim-gitgutter'
Plugin 'bronson/vim-trailing-whitespace' Plugin 'bronson/vim-trailing-whitespace'
Plugin 'chip/vim-fat-finger'
Plugin 'ctrlpvim/ctrlp.vim' Plugin 'ctrlpvim/ctrlp.vim'
Plugin 'godlygeek/tabular' Plugin 'godlygeek/tabular'
Plugin 'itchyny/lightline.vim' Plugin 'itchyny/lightline.vim'
@ -36,7 +35,7 @@ filetype plugin indent on
" end vundle " end vundle
" Options " Options
set fileformats=unix,dos " File format prefer unix endings set fileformats=unix,mac,dos " File format prefer unix endings
set endofline " Add newlien at end of file set endofline " Add newlien at end of file
set shellslash " Forward slashes set shellslash " Forward slashes
set nobackup " No backup files set nobackup " No backup files
@ -57,7 +56,8 @@ set ignorecase " Ignore case with search
set smartcase " Search will not ignore uppercase set smartcase " Search will not ignore uppercase
set showcmd " Show command as you type set showcmd " Show command as you type
set ruler " Show cursor position set ruler " Show cursor position
set autoindent set autoindent " autoindent AND be smart about it
set smartindent
set colorcolumn=80 " Ruler at line 80 set colorcolumn=80 " Ruler at line 80
set nomodeline set nomodeline
set relativenumber " Relative line numbers set relativenumber " Relative line numbers
@ -69,7 +69,11 @@ set timeoutlen=500 " Don't wait too long (ambiguous leaders)
set showmatch " Show matching brackets set showmatch " Show matching brackets
set hidden " Allow unsaved buffers to be hidden set hidden " Allow unsaved buffers to be hidden
set wildmenu " Command line completion set wildmenu " Command line completion
set wildmode=list:longest,full " Better file completion
set infercase " Adjust completions to match case
set noshowmode " Already tracking mode with plugin
set wildignorecase " Ignore case on commandline set wildignorecase " Ignore case on commandline
set autowrite " Save file when focus is lost
" Make syntax highlighting faster " Make syntax highlighting faster
syntax sync minlines=256 syntax sync minlines=256
set ttyfast set ttyfast
@ -88,6 +92,12 @@ set wildignore+=*/\.git/*
set wildignore+=*/build/*,*/grade/*,*\.class set wildignore+=*/build/*,*/grade/*,*\.class
" Frontend " Frontend
set wildignore+=*/node_modules/*,*/bower_components/*,*/dist/* set wildignore+=*/node_modules/*,*/bower_components/*,*/dist/*
" Persistent undo stuff
if has('persistent_undo')
set undolevels=5000
set undodir=$HOME/.vim/undo
set undofile
endif
" Filetype stuff " Filetype stuff
syntax on syntax on
@ -97,8 +107,8 @@ syntax on
map <C-s> <esc>:w<CR> map <C-s> <esc>:w<CR>
imap <C-s> <esc>:w<CR> imap <C-s> <esc>:w<CR>
" most common typo ever " quick replaceement
command! Q q nmap S :%s//g<LEFT><LEFT>
" consistency is key - Y should act like C, D " consistency is key - Y should act like C, D
map Y y$ map Y y$

11
zshenv
View file

@ -2,21 +2,26 @@ PERSONAL_BIN_PATH="$HOME/bin"
RBENV_PATH="$HOME/.rbenv/bin" RBENV_PATH="$HOME/.rbenv/bin"
GNU_TOOLS_PATH="/usr/local/opt/coreutils/libexec/gnubin" GNU_TOOLS_PATH="/usr/local/opt/coreutils/libexec/gnubin"
GNU_TOOLS_MAN_PATH="/usr/local/opt/coreutils/libexec/gnuman" GNU_TOOLS_MAN_PATH="/usr/local/opt/coreutils/libexec/gnuman"
GO_PATH="/usr/local/go/bin" APACHE_MAVEN_PATH="$HOME/bin/apache-maven-3.3.9/bin"
if [[ "$OSTYPE" == darwin* ]]; then
GO_DIR="/usr/local/opt/go/libexec"
else
GO_DIR="/usr/local/go/bin"
fi
if [[ "$OSTYPE" == darwin* ]]; then if [[ "$OSTYPE" == darwin* ]]; then
NVM_DIR="/usr/local/opt/nvm" NVM_DIR="/usr/local/opt/nvm"
else else
NVM_DIR="/home/atomaka/.nvm" NVM_DIR="/home/atomaka/.nvm"
fi fi
APACHE_MAVEN_PATH="$HOME/bin/apache-maven-3.3.9/bin"
# BIN # BIN
[[ -d "$PERSONAL_BIN_PATH" ]] && PATH="$PERSONAL_BIN_PATH:$PATH" [[ -d "$PERSONAL_BIN_PATH" ]] && PATH="$PERSONAL_BIN_PATH:$PATH"
[[ -d "$RBENV_PATH" ]] && PATH="$RBENV_PATH:$PATH" [[ -d "$RBENV_PATH" ]] && PATH="$RBENV_PATH:$PATH"
[[ -d "$GNU_TOOLS_PATH" ]] && PATH="$GNU_TOOLS_PATH:$PATH" [[ -d "$GNU_TOOLS_PATH" ]] && PATH="$GNU_TOOLS_PATH:$PATH"
[[ -d "$APACHE_MAVEN_PATH" ]] && PATH="$APACHE_MAVEN_PATH:$PATH" [[ -d "$APACHE_MAVEN_PATH" ]] && PATH="$APACHE_MAVEN_PATH:$PATH"
[[ -d "$GO_PATH" ]] && PATH="$GO_PATH:$PATH" [[ -d "$GO_DIR" ]] && PATH="$GO_DIR:$PATH"
# MAN # MAN
[[ -d "$GNU_TOOLS_MAN_PATH" ]] && MANPATH="$GNU_TOOLS_MAN_PATH:$MANPATH" [[ -d "$GNU_TOOLS_MAN_PATH" ]] && MANPATH="$GNU_TOOLS_MAN_PATH:$MANPATH"