-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.vimrc
More file actions
201 lines (166 loc) · 5.31 KB
/
.vimrc
File metadata and controls
201 lines (166 loc) · 5.31 KB
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
set nocompatible " choose no compatibility with legacy vi
runtime macros/matchit.vim
runtime ftplugin/man.vim
filetype off
call pathogen#runtime_append_all_bundles()
filetype plugin indent on
call plug#begin()
Plug 'Shougo/denite.nvim'
Plug 'flazz/vim-colorschemes'
Plug 'chrisbra/csv.vim'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-repeat'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-rails'
Plug 'tpope/vim-haml'
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-endwise'
Plug 'bingaman/vim-sparkup'
Plug 'sickill/vim-pasta'
Plug 'maxbrunsfeld/vim-yankstack'
Plug 'pangloss/vim-javascript'
Plug 'vim-scripts/rainbow_parentheses.vim'
Plug 'jpalardy/vim-slime'
if has('nvim')
Plug 'Shougo/defx.nvim', { 'do': ':UpdateRemotePlugins' }
else
Plug 'Shougo/defx.nvim'
Plug 'roxma/nvim-yarp'
Plug 'roxma/vim-hug-neovim-rpc'
endif
if has('nvim')
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
else
Plug 'Shougo/deoplete.nvim'
Plug 'roxma/nvim-yarp'
Plug 'roxma/vim-hug-neovim-rpc'
endif
let g:deoplete#enable_at_startup = 1 " Enable deoplete
" begin: deoplete completion sources
Plug 'Shougo/neco-syntax'
Plug 'carlitux/deoplete-ternjs', { 'do': 'npm install -g tern' }
" end: deoplete completion sources
call plug#end()
syntax enable
set encoding=utf-8
set modelines=0
set background=dark
silent! colorscheme 1989
let g:solarized_termcolors=256
set number
set ruler " show the cursor position all the time
set cursorline
hi CursorLine cterm=NONE ctermbg=darkred ctermfg=white
set showcmd " display incomplete commands
set undofile
set wildmenu
set wildmode=full
set foldlevelstart=99
"" Whitespace
set nowrap " don't wrap lines
set tabstop=2 shiftwidth=2 " a tab is two spaces (or set this to 4)
set expandtab " use spaces, not tabs (optional)
set backspace=indent,eol,start " backspace through everything in insert mode
set list
set listchars=tab:▸\ ,extends:❯,precedes:❮
let ruby_fold=1
let ruby_space_errors = 1
let c_space_errors = 1
let mapleader=","
"" Searching
set hlsearch " highlight matches
set incsearch " incremental searching
set showmatch " show matches
set ignorecase " searches are case insensitive...
set smartcase " ... unless they contain at least one capital letter
nnoremap <leader><space> :noh<cr> " clear search
nnoremap <leader>ft Vatzf
nnoremap <leader>v V`]
inoremap jj <ESC> " Quick escape
if has("autocmd")
au BufNewFile,BufRead *.json set ft=javascript " treat JSON like JavaScript
" Remember last location in file, but not for commit messages
" see :help last-position-jump
au BufReadPost * if &filetype != '^git\c' && line("'\"") > 0 && line("'\"") <= line("$")
\| exe "normal! g`\"" | endif
endif
" provide some context when editing
set scrolloff=3
" http://vimcasts.org/e/14
cnoremap %% <C-R>=expand('%:h').'/'<cr>
nnoremap <leader><leader> <c-^>
" easier navigation between split windows
nnoremap <c-j> <c-w>j
nnoremap <c-k> <c-w>k
nnoremap <c-h> <c-w>h
nnoremap <c-l> <c-w>l
set noswapfile
set backupdir=~/.vim/backup
set undodir=~/.vim/backup
set directory=~/.vim/backup
" yankstack
nmap <ESC>p <Plug>yankstack_substitute_older_paste
nmap <leader>p <Plug>yankstack_substitute_older_paste
nmap <ESC>n <Plug>yankstack_substitute_newer_paste
nmap <leader>P <Plug>yankstack_substitute_newer_paste
" Rainbox Parentheses {{{
nnoremap <leader>R :RainbowParenthesesToggle<cr>
let g:rbpt_colorpairs = [
\ ['brown', 'RoyalBlue3'],
\ ['Darkblue', 'SeaGreen3'],
\ ['darkgray', 'DarkOrchid3'],
\ ['darkgreen', 'firebrick3'],
\ ['darkcyan', 'RoyalBlue3'],
\ ['darkred', 'SeaGreen3'],
\ ['darkmagenta', 'DarkOrchid3'],
\ ['brown', 'firebrick3'],
\ ['gray', 'RoyalBlue3'],
\ ['black', 'SeaGreen3'],
\ ['darkmagenta', 'DarkOrchid3'],
\ ['Darkblue', 'firebrick3'],
\ ['darkgreen', 'RoyalBlue3'],
\ ['darkcyan', 'SeaGreen3'],
\ ['darkred', 'DarkOrchid3'],
\ ['red', 'firebrick3'],
\ ]
let g:rbpt_max = 16
" }}}
if has("statusline") && !&cp
set laststatus=2 " always show the status bar
" Start the status line
set statusline=%t%(\ [%n%m]%)%(\ %H%R%W%)\
" Add fugitive
set statusline+=%{fugitive#statusline()}
" Finish the statusline
set statusline+=%(%c-%v,\ %l\ of\ %L,\ (%o)\ %P\ 0x%B\ (%b)%)
endif
" Syntax changes Ruby 1.8 -> 1.9 {{{
command! -range Ruby19ify <line1>,<line2>s/:\([^ ]\+\) \+=> \+/\1: /g | :noh
" }}}
" R plugin {{{
let g:r_indent_align_args = 0
let g:vimrplugin_assign = 0
let g:r_syntax_folding = 1
" }}}
" Denite {{{
if executable('rg')
call denite#custom#var('grep', 'command', ['rg'])
call denite#custom#var('grep', 'default_opts', ['--vimgrep', '--no-heading'])
call denite#custom#var('grep', 'recursive_opts', [])
call denite#custom#var('grep', 'pattern_opt', ['--regexp'])
call denite#custom#var('grep', 'separator', ['--'])
call denite#custom#var('grep', 'final_opts', [])
endif
nnoremap [denite] <Nop>
nmap <C-f> [denite]
nnoremap <silent> <C-p> :<C-u>Denite
\ -buffer-name=buffer file/rec<CR>
nnoremap <silent> [denite]g :<C-u>Denite
\ grep<CR>
nnoremap <silent> [denite]r :<C-u>Denite
\ -buffer-name=register register<CR>
nnoremap <silent> [denite]o :<C-u>Denite
\ outline<CR>
nnoremap <silent> [denite]w :<C-u>DeniteCursorWord
\ tag file/rec<CR>
" }}}