-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
87 lines (69 loc) · 2.43 KB
/
vimrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
packadd minpac
call minpac#init()
call minpac#add('k-takata/minpac', {'type': 'opt'})
"call minpac#add('altercation/vim-colors-solarized')
"call minpac#add('kchmck/vim-coffee-script')
call minpac#add('kien/ctrlp.vim')
call minpac#add('scrooloose/nerdtree')
"call minpac#add('tpope/vim-bundler')
"call minpac#add('tpope/vim-rails')
"call minpac#add('pangloss/vim-javascript')
"call minpac#add('tpope/vim-commentary')
"call minpac#add('tpope/vim-surround')
call minpac#add('rking/ag.vim')
call minpac#add('tpope/vim-fugitive')
call minpac#add('tpope/vim-endwise')
call minpac#add('bling/vim-airline')
"call minpac#add('elixir-lang/vim-elixir')
command! PackUpdate call minpac#update()
command! PackClean call minpac#clean()
filetype indent on " Enable filetype-specific indenting
filetype plugin on " Enable filetype-specific plugins
let mapleader = ","
map <C-n> :cn<CR>
map <C-l> :cp<CR>
set expandtab
set tabstop=2
set shiftwidth=2
set autoindent
set showmatch
set number " line numbering
set mouse=a " turn on the mouse
set backspace=indent,eol,start " backspace all the things
set clipboard=unnamed " use the system clipboard
" http://vim.wikia.com/wiki/Any_word_completion
set completeopt=longest " turn off the autocomplete menu
syntax on
" Colors & Fonts
" set background=light
" colorscheme solarized
" Use Silver Searcher instead of grep
set grepprg=ag
" Press F4 to toggle highlighting on/off, and show current value.
noremap <F4> :set hlsearch! hlsearch?<CR>
" Let ctrl-p show hidden files (dotfiles)
let g:ctrlp_show_hidden = 1
let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files . -co --exclude-standard', 'find %s -type f']
" Strip trailing spaces
autocmd FileType rb,c,cpp,java,php autocmd BufWritePre <buffer> :%s/\s\+$//e
" Enable crontab -e on OSX
autocmd filetype crontab setlocal nobackup nowritebackup
" Automatically create parent directories
function s:MkNonExDir(file, buf)
if empty(getbufvar(a:buf, '&buftype')) && a:file!~#'\v^\w+\:\/'
let dir=fnamemodify(a:file, ':h')
if !isdirectory(dir)
call mkdir(dir, 'p')
endif
endif
endfunction
augroup BWCCreateDir
autocmd!
autocmd BufWritePre * :call s:MkNonExDir(expand('<afile>'), +expand('<abuf>'))
augroup END
" Tell vim about arduino
autocmd BufNewFile,BufReadPost *.ino,*.pde set filetype=cpp
" airline config
set laststatus=2
" Mark tabs and trailing whitepace
set list listchars=tab:\|_,trail:·