Bunch of stuff...
So I retab'd this file 'cause I was tired of all the tabs. There are a few other changes too: - Change my SnipMate email address - Fix my trailing whitespace macro so it restores the cursor position - Change up some of the list mode settings
This commit is contained in:
parent
eab8ef0bbd
commit
086eca5ad8
1 changed files with 50 additions and 34 deletions
84
vimrc
84
vimrc
|
@ -1,43 +1,50 @@
|
||||||
" ~/.vimrc
|
" ~/.vimrc
|
||||||
" Eryn Wells <eryn@3b518c.com>
|
" Eryn Wells <eryn@3b518c.com>
|
||||||
|
|
||||||
set nocompatible "use enhanced vim features
|
set nocompatible "use enhanced vim features
|
||||||
|
|
||||||
call pathogen#helptags()
|
call pathogen#helptags()
|
||||||
call pathogen#runtime_append_all_bundles()
|
call pathogen#runtime_append_all_bundles()
|
||||||
|
|
||||||
set autoread "reread files changed outside of vim
|
set autoread "reread files changed outside of vim
|
||||||
set noautowrite "don't write files before commands like :next and :make
|
set noautowrite "don't write files before commands like :next and :make
|
||||||
|
|
||||||
set ffs=unix,dos,mac "order of line ending formats to try
|
set ffs=unix,dos,mac "order of line ending formats to try
|
||||||
|
|
||||||
set hidden " allow hidden buffers (rather than closing them)
|
set hidden " allow hidden buffers (rather than closing them)
|
||||||
|
|
||||||
set number " show line numbers
|
set number " show line numbers
|
||||||
set relativenumber " line numbers are relative to current line rather
|
set relativenumber " line numbers are relative to current line rather
|
||||||
" than absolute
|
" than absolute
|
||||||
set ruler " show ruler (line and col count)
|
set ruler " show ruler (line and col count)
|
||||||
set showmode " show mode
|
set showmode " show mode
|
||||||
set showcmd " show last command
|
set showcmd " show last command
|
||||||
set title " change terminal title
|
set title " change terminal title
|
||||||
set visualbell " don't beep
|
set visualbell " don't beep
|
||||||
set noerrorbells " PLEASE don't beep
|
set noerrorbells " PLEASE don't beep
|
||||||
set ttyfast " fast terminals
|
set ttyfast " fast terminals
|
||||||
|
|
||||||
set nowrap " don't wrap long lines
|
set nowrap " don't wrap long lines
|
||||||
set linebreak " break at between words
|
set linebreak " break at between words
|
||||||
set textwidth=80 " wrap at 80 characters
|
set textwidth=80 " wrap at 80 characters
|
||||||
set colorcolumn=80 " highlight 85th column
|
set colorcolumn=80 " highlight 85th column
|
||||||
set showmatch " show matching things: (), {}, [], etc
|
set showmatch " show matching things: (), {}, [], etc
|
||||||
|
|
||||||
set fo+=n " format numbered lists properly
|
set fo+=n " format numbered lists properly
|
||||||
set fo+=2 " format paragraphs with first line indent different
|
set fo+=2 " format paragraphs with first line indent different
|
||||||
" from rest
|
" from rest
|
||||||
|
|
||||||
set list
|
if has('gui_running')
|
||||||
set lcs+=tab:▸\ " show tabs
|
set list
|
||||||
set lcs+=eol:¬ " show end-of-lines
|
endif
|
||||||
set lcs+=trail:・ " show trailing spaces
|
"set lcs+=tab:▸\ " show tabs
|
||||||
|
"set lcs+=eol:¬ " show end-of-lines
|
||||||
|
"set lcs+=trail:・ " show trailing spaces
|
||||||
|
"set lcs+=extends:→ " show long lines (that go offscreen)
|
||||||
|
"set lcs+=nbsp:. " show non-breaking spaces
|
||||||
|
set lcs+=tab:>\ " show tabs
|
||||||
|
set lcs+=eol:$ " show end-of-lines
|
||||||
|
set lcs+=trail:. " show trailing spaces
|
||||||
set lcs+=extends:# " show long lines (that go offscreen)
|
set lcs+=extends:# " show long lines (that go offscreen)
|
||||||
set lcs+=nbsp:. " show non-breaking spaces
|
set lcs+=nbsp:. " show non-breaking spaces
|
||||||
|
|
||||||
|
@ -45,7 +52,7 @@ set ignorecase " ignore case in searches
|
||||||
set smartcase " case-sensitive search if pattern contains a capital
|
set smartcase " case-sensitive search if pattern contains a capital
|
||||||
set incsearch " show search matches as you type
|
set incsearch " show search matches as you type
|
||||||
set hlsearch " highlight search matches
|
set hlsearch " highlight search matches
|
||||||
set gdefault " apply searches globally to a line by default
|
set gdefault " apply searches globally to a line by default
|
||||||
|
|
||||||
" use PCREs for searches
|
" use PCREs for searches
|
||||||
nnoremap / /\v
|
nnoremap / /\v
|
||||||
|
@ -60,8 +67,8 @@ endif
|
||||||
|
|
||||||
set noswapfile " disable swap file
|
set noswapfile " disable swap file
|
||||||
set nobackup " disable backup files
|
set nobackup " disable backup files
|
||||||
set undofile " save undo history
|
set undofile " save undo history
|
||||||
set undodir=~/.vim/undo " save undo files here
|
set undodir=~/.vim/undo " save undo files here
|
||||||
set history=1000 " remember 1000 commands in history
|
set history=1000 " remember 1000 commands in history
|
||||||
set undolevels=1000 " keep lots of undo history
|
set undolevels=1000 " keep lots of undo history
|
||||||
set viminfo=%100,'100,/100,h,\"500,:100,n~/.viminfo
|
set viminfo=%100,'100,/100,h,\"500,:100,n~/.viminfo
|
||||||
|
@ -74,7 +81,7 @@ set tabstop=8 " tabs are always 8 spaces
|
||||||
set shiftwidth=4 " shift lines 4 spaces with >> and <<
|
set shiftwidth=4 " shift lines 4 spaces with >> and <<
|
||||||
set softtabstop=4 " tab key inserts 4 spaces
|
set softtabstop=4 " tab key inserts 4 spaces
|
||||||
set shiftround " round off indent to multiple of shiftwidth
|
set shiftround " round off indent to multiple of shiftwidth
|
||||||
set smarttab " insert tabs on start of line according to sw, not ts
|
set expandtab " always use spaces
|
||||||
set nojoinspaces " insert 1 space instead of 2 after punctuation on line
|
set nojoinspaces " insert 1 space instead of 2 after punctuation on line
|
||||||
" join
|
" join
|
||||||
set autoindent " always use autoindenting
|
set autoindent " always use autoindenting
|
||||||
|
@ -104,21 +111,25 @@ if has('autocmd')
|
||||||
" spaces as tabs for python
|
" spaces as tabs for python
|
||||||
autocmd filetype python setlocal expandtab
|
autocmd filetype python setlocal expandtab
|
||||||
" don't show tabs in html and xml
|
" don't show tabs in html and xml
|
||||||
autocmd filetype html,xml set listchars-=tab:>-
|
autocmd filetype html,xml set listchars-=tab:▸\
|
||||||
|
|
||||||
" Jump to last known cursor position unless it's the first line, or past the
|
" Jump to last known cursor position unless it's the first line, or past the
|
||||||
" end of the file
|
" end of the file
|
||||||
autocmd BufReadPost *
|
autocmd BufReadPost *
|
||||||
\ if line("'\"") > 1 && line("'\"") <= line("$") |
|
\ if line("'\"") > 1 && line("'\"") <= line("$") |
|
||||||
\ exe "normal! g`\"" |
|
\ exe "normal! g`\"" |
|
||||||
\ endif
|
\ endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" use a colorscheme if the terminal can support it (or we're in a GUI)
|
" use a colorscheme if the terminal can support it (or we're in a GUI)
|
||||||
if &t_Co >= 256 || has('gui_running')
|
if &t_Co >= 256 || has('gui_running')
|
||||||
set cursorline
|
if has('gui_running')
|
||||||
set bg=light
|
set bg=light
|
||||||
colorscheme solarized
|
colorscheme solarized
|
||||||
|
else
|
||||||
|
set bg=dark
|
||||||
|
colorscheme default
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" use syntax highlighting if the terminal can support it (or we're in a GUI)
|
" use syntax highlighting if the terminal can support it (or we're in a GUI)
|
||||||
|
@ -127,18 +138,19 @@ if &t_Co > 2 || has('gui_running')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" tell SnipMate who I am
|
" tell SnipMate who I am
|
||||||
let g:snips_author = 'Eryn Wells <eryn@3b518c.com>'
|
let g:snips_author = 'Eryn Wells <eryn@erynwells.me>'
|
||||||
|
|
||||||
if has('gui_running')
|
if has('gui_running')
|
||||||
|
set cursorline
|
||||||
if has('win32') || has('win64')
|
if has('win32') || has('win64')
|
||||||
set guifont=Inconsolata:h18
|
set guifont=Inconsolata:h18
|
||||||
elseif has('mac')
|
elseif has('mac')
|
||||||
set guifont=Menlo:h14
|
set guifont=Menlo:h14
|
||||||
elseif has('linux')
|
elseif has('linux')
|
||||||
set guifont=Inconsolata\ 14
|
set guifont=Inconsolata\ 14
|
||||||
endif
|
endif
|
||||||
set guioptions-=T " turn off toolbar
|
set guioptions-=T " turn off toolbar
|
||||||
set guioptions-=m " turn off toolbar
|
set guioptions-=m " turn off toolbar
|
||||||
endif
|
endif
|
||||||
|
|
||||||
nmap <F3> :GundoToggle<CR>
|
nmap <F3> :GundoToggle<CR>
|
||||||
|
@ -164,10 +176,14 @@ nnoremap <C-j> <C-w>j
|
||||||
nnoremap <C-k> <C-w>k
|
nnoremap <C-k> <C-w>k
|
||||||
nnoremap <C-l> <C-w>l
|
nnoremap <C-l> <C-w>l
|
||||||
|
|
||||||
" strip all trailing whitespace in the current file
|
|
||||||
nnoremap <leader>W :%s/\s\+$//<CR>:let @/=''<CR>
|
|
||||||
|
|
||||||
let mapleader=','
|
let mapleader=','
|
||||||
|
" strip all trailing whitespace in the current file
|
||||||
|
nnoremap <leader>W mkHml:%s/\v\s+$//<CR>`lzt`k
|
||||||
|
" edit and source my .vimrc
|
||||||
nmap <silent> <leader>ev :e $MYVIMRC<CR>
|
nmap <silent> <leader>ev :e $MYVIMRC<CR>
|
||||||
nmap <silent> <leader>sv :so $MYVIMRC<CR>
|
nmap <silent> <leader>sv :so $MYVIMRC<CR>
|
||||||
|
" hide search terms
|
||||||
nmap <silent> <leader><space> :nohlsearch<CR>
|
nmap <silent> <leader><space> :nohlsearch<CR>
|
||||||
|
" find all
|
||||||
|
nmap <leader>fa :%s/\v
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue