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

80
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,40 +35,45 @@ 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
set formatoptions=crq set formatoptions=crq
set textwidth=80 set textwidth=80
set cpoptions+=$ " delimit end of change text 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 cursorline " Highlight current line
set cursorcolumn " Highlight current column 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
set wrapscan " Wraped search set wrapscan " Wraped search
set incsearch " Search as yuo type set incsearch " Search as yuo type
set ignorecase " Ignore case with search 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 colorcolumn=80 " Ruler at line 80 set smartindent
set colorcolumn=80 " Ruler at line 80
set nomodeline set nomodeline
set relativenumber " Relative line numbers set relativenumber " Relative line numbers
set number set number
set noswapfile " Hope for the best set noswapfile " Hope for the best
set virtualedit=all " Cursor can go anywhere set virtualedit=all " Cursor can go anywhere
set scrolloff=3 " Keep cursor from touching edges set scrolloff=3 " Keep cursor from touching edges
set timeoutlen=500 " Don't wait too long (ambiguous leaders) 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 wildignorecase " Ignore case on commandline 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 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
@ -79,7 +83,7 @@ set tabstop=2
set softtabstop=2 set softtabstop=2
set shiftwidth=2 set shiftwidth=2
set expandtab set expandtab
set shiftround " if at odd number spaces, make >> go to next even set shiftround " if at odd number spaces, make >> go to next even
" Show whitespace markers before cursor in insert mode " Show whitespace markers before cursor in insert mode
set list listchars=tab:\ \ ,trail set list listchars=tab:\ \ ,trail
" Ignore stuff " Ignore stuff
@ -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"