2015-03-20 17:16:03 +00:00
|
|
|
" set the directory where my vimrc git project is located
|
|
|
|
source ~/.vimrc_local
|
|
|
|
|
2015-10-14 02:48:33 +00:00
|
|
|
" it is a big fat key, after all
|
|
|
|
let mapleader = "\<Space>"
|
2015-10-13 18:58:49 +00:00
|
|
|
|
2015-03-20 17:16:03 +00:00
|
|
|
" source aux files also under git control
|
|
|
|
let oldwd = getcwd()
|
|
|
|
exec "cd " . vimrc_git
|
|
|
|
source vundle.vim
|
2015-10-14 02:48:33 +00:00
|
|
|
source airline.vim
|
|
|
|
source syntastic.vim
|
|
|
|
source unite.vim
|
|
|
|
source mapping.vim
|
2015-03-20 17:16:03 +00:00
|
|
|
exec "cd " . oldwd
|
|
|
|
|
2015-03-27 15:06:56 +00:00
|
|
|
" turn on file type plugins
|
2015-03-20 17:16:03 +00:00
|
|
|
filetype plugin indent on
|
2015-03-27 15:06:56 +00:00
|
|
|
" turn off compatibility mode
|
|
|
|
set nocompatible
|
|
|
|
" turn on syntax support
|
2015-03-20 17:16:03 +00:00
|
|
|
syntax on
|
2015-10-13 18:54:28 +00:00
|
|
|
" set up a line number on the current line but relative above and below to help
|
|
|
|
" with motion commands
|
|
|
|
set number
|
|
|
|
set relativenumber
|
|
|
|
|
2015-10-14 02:48:33 +00:00
|
|
|
" even with the nice space/tab autodetect, prefer 4 for tab stops
|
|
|
|
" but let file type specifics override (for instance a setting of 2 for markdown
|
|
|
|
set tabstop=4
|
|
|
|
" default to folding on syntax
|
|
|
|
set foldmethod=syntax
|
|
|
|
" set a readable width
|
|
|
|
set textwidth=80
|
|
|
|
" make white space visible, where that matters
|
|
|
|
set list
|
|
|
|
" except for help
|
|
|
|
autocmd FileType help set nolist
|
|
|
|
" set up folding preferences
|
|
|
|
set fde=1
|
|
|
|
" vim's spelling is smart enough for code, to only check comments
|
|
|
|
set spell
|
|
|
|
" add a hint for long lines
|
|
|
|
set colorcolumn=120
|
|
|
|
" default to expanding tabs, I'm not insane
|
|
|
|
set expandtab
|
2015-10-13 15:29:03 +00:00
|
|
|
|
2015-03-27 15:06:56 +00:00
|
|
|
" change buffer behaviors to no longer require changes when hiding a buffer
|
|
|
|
set hidden
|
|
|
|
|
|
|
|
" look for vimrc in the current director as well as $MYVIMRC
|
2015-03-20 17:16:03 +00:00
|
|
|
set exrc
|
2015-03-27 15:06:56 +00:00
|
|
|
" make looking for local changes secure
|
2015-03-20 17:16:03 +00:00
|
|
|
set secure
|
2015-04-01 15:13:36 +00:00
|
|
|
" more secure
|
|
|
|
set modelines=0
|
|
|
|
" preserve some context
|
|
|
|
set scrolloff=3
|
|
|
|
" make the cursor a bit easier to follows
|
|
|
|
set cursorline
|
2015-03-27 15:06:56 +00:00
|
|
|
" make search work a bit more like tab completion in bash
|
2015-03-20 17:16:03 +00:00
|
|
|
set incsearch
|
|
|
|
set wildmode=longest:full
|
|
|
|
set wildmenu
|
2015-03-27 15:06:56 +00:00
|
|
|
" line break handling
|
2015-10-14 02:48:33 +00:00
|
|
|
set linebreak
|
|
|
|
set showbreak=+
|
2015-03-27 15:06:56 +00:00
|
|
|
" always on status line
|
2015-03-20 17:16:03 +00:00
|
|
|
set laststatus=2
|
2015-03-30 15:19:35 +00:00
|
|
|
|
2015-03-30 15:21:15 +00:00
|
|
|
" let backspace work more naturally
|
|
|
|
set backspace=start,indent,eol
|
|
|
|
" favor modern encoding
|
|
|
|
set enc=utf-8
|
|
|
|
" more readable config for list mode
|
|
|
|
set listchars+=nbsp:¬,tab:»·,trail:·
|
|
|
|
set listchars-=eol:$
|
|
|
|
" smarter handling of case during search
|
|
|
|
set ignorecase
|
|
|
|
set smartcase
|
|
|
|
" disable outdated data loss protections
|
|
|
|
set nobackup
|
|
|
|
set noswapfile
|
|
|
|
" make pastemode more accessible
|
|
|
|
set pastetoggle=<F2>
|
2015-04-01 15:13:36 +00:00
|
|
|
" save when moving away
|
|
|
|
au FocusLost * :wa
|
2015-03-30 15:21:15 +00:00
|
|
|
|
2015-04-17 21:46:35 +00:00
|
|
|
" open is OS X only, the closest equiv in line, xdg-open, doesn't allow an
|
|
|
|
" argument for speciying a particular app
|
|
|
|
if has('gui_macvim')
|
2015-10-14 01:35:19 +00:00
|
|
|
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
|
|
" Open current file with app given
|
|
|
|
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
|
|
function! s:OpenWith(appname)
|
|
|
|
noautocmd silent execute "!open -a \"" . a:appname . "\" " . expand("%:p")
|
|
|
|
if v:shell_error
|
|
|
|
echohl Error
|
|
|
|
echon "Problem opening the file."
|
|
|
|
echohl Normal
|
|
|
|
endif
|
|
|
|
endfunction
|
2015-04-17 18:52:17 +00:00
|
|
|
|
2015-10-14 01:35:19 +00:00
|
|
|
command! -bar -nargs=1 OpenWith call s:OpenWith(<f-args>)
|
2015-04-17 21:46:35 +00:00
|
|
|
endif
|
2015-04-29 18:39:52 +00:00
|
|
|
|
2015-10-14 02:48:33 +00:00
|
|
|
if has("gui_running")
|
|
|
|
let narrows = ['text', 'markdown']
|
|
|
|
" from the help, recommended for widest possible
|
|
|
|
" for text, narrow width to make side to side scanning easier
|
|
|
|
autocmd BufEnter * if index(narrows, &ft) >= 0 | set columns=120 | else | set columns=9999 | endif
|
|
|
|
endif
|
|
|
|
|
2015-04-29 18:39:52 +00:00
|
|
|
" make sure to set TERM to xterm-256color in terminal program or app
|
|
|
|
colorscheme solarized
|