forked from mathiasbynens/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
149 lines (119 loc) · 3.44 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
call plug#begin('~/.vim/plugged')
Plug 'rking/ag.vim'
Plug 'tpope/vim-fugitive'
Plug 'guns/vim-clojure-static'
Plug 'kien/ctrlp.vim'
Plug 'tpope/vim-eunuch'
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-surround'
Plug 'wesQ3/vim-windowswap'
Plug 'Raimondi/delimitMate'
Plug 'tpope/vim-endwise'
Plug 'tpope/vim-repeat'
Plug 'christoomey/vim-tmux-navigator'
Plug 'janko-m/vim-test'
Plug 'benmills/vimux'
Plug 'tpope/vim-sensible'
Plug 'tpope/vim-sleuth'
Plug 'tommcdo/vim-lion'
Plug 'tpope/vim-fireplace'
Plug 'tpope/vim-sexp-mappings-for-regular-people'
Plug 'guns/vim-sexp'
Plug 'tpope/vim-salve'
Plug 'kana/vim-textobj-user'
Plug 'elixir-lang/vim-elixir'
Plug 'jnurmine/Zenburn'
Plug 'morhetz/gruvbox'
" Initialize plugin system
call plug#end()
filetype plugin indent on
let &t_Co=256
if &term =~ '256color'
" disable Background Color Erase (BCE) so that color schemes
" render properly when inside 256-color tmux and GNU screen.
" see also http://snk.tuxfamily.org/log/vim-256color-bce.html
set t_ut=
endif
colorscheme Zenburn
syntax on
" Do not enforce Vi compatibility
set nocompatible
" Set utf8 as standard encoding and en_US as the standard language
set encoding=utf8
" Show white spaces
set list
" Characters to replace white spaces
set listchars=tab:→\ ,trail:·,eol:¬,nbsp:+
" Set ruler information in bottom right corner
set ruler
" Do not wrap lines
set nowrap
" Set color of the 80th column, to let you know when to wrap
set colorcolumn=80
set autoindent
" Number of spaces to use for each step of (auto)indent.
set shiftwidth=2
" Spaces instead of tabs
set expandtab
" Number of columns a tab counts for (to display existing text)
set tabstop=2
"Number of colums a tab counts for when you hit tab, in insert mode
set softtabstop=2
" Correct backspace behavior
set backspace=indent,eol,start
" Do not use backup and swap files
set nobackup
set noswapfile
" Highlight cursor line
set cursorline
" Set search incremental matching
set incsearch
" Set map leader key
let mapleader = ","
" Remove scrolling bars from the GUI
set guioptions-=r
set guioptions-=l
set guioptions-=b
" Add ctrlp plugin
set runtimepath^=~/.vim/bundle/ctrlp.vim
"http://jeffkreeftmeijer.com/2013/vims-new-hybrid-line-number-mode/
set relativenumber
set number
" ctrlp options
let g:ctrlp_map = '<c-p>'
let g:ctrlp_cmd = 'CtrlP'
let g:ctrlp_working_path_mode = 'ra'
let g:ctrlp_root_markers = ['.git', '.hg', 'Rakefile']
let g:ctrlp_custom_ignore = '\v[\/](\.(git|hg|svn))|(node_modules|vendor|coverage|target)$'
" use silver searcher
" http://robots.thoughtbot.com/faster-grepping-in-vim
if executable('ag')
" Use ag over grep
set grepprg=ag\ --nogroup\ --nocolor
" Use ag in CtrlP for listing files. Lightning fast and respects .gitignore
let g:ctrlp_user_command = 'ag %s -l -i --nocolor -g ""'
" ag is fast enough that CtrlP doesn't need to cache
let g:ctrlp_use_caching = 0
endif
" make Vim use the system clipboard
set clipboard+=unnamed
" map fd to ESC
:inoremap fd <Esc>
nnoremap \ :Ag<SPACE>
" vim-rails options
map <Leader>m :Rmodel <CR>
map <Leader>c :Rcontroller <CR>
map <Leader>v :Rview <CR>
map <Leader>u :Runittest <CR>
" vim-test options
"
" select test running strategy
let g:test#strategy = 'vimux' " VimuxRunCommand(<test commmand>)"
"
" mappings
nmap <silent> <leader>t :TestNearest<CR>
nmap <silent> <leader>T :TestFile<CR>
nmap <silent> <leader>a :TestSuite<CR>
nmap <silent> <leader>l :TestLast<CR>
" vim sexp
let g:sexp_enable_insert_mode_mappings = 0