-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
153 lines (126 loc) · 4.03 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
150
151
152
153
set nocompatible " be iMproved, required
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'easymotion/vim-easymotion'
Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
Plugin 'scrooloose/nerdtree'
Plugin 'jistr/vim-nerdtree-tabs'
Plugin 'vim-ruby/vim-ruby'
"Plugin 'Valloric/YouCompleteMe'
"Plugin 'mdempsky/gocode', {'rtp': 'vim/'}
"Plugin 'shougo/deoplete.nvim'
Plugin 'terryma/vim-multiple-cursors'
Plugin 'junegunn/vim-easy-align'
Plugin 'christoomey/vim-tmux-navigator'
Plugin 'nathanaelkane/vim-indent-guides'
Plugin 'nanotech/jellybeans.vim'
Plugin 'godlygeek/csapprox'
"Plugin 'tpope/vim-ragtag'
"Plugin 'VimClojure'
Plugin 'fatih/vim-go'
Plugin 'junegunn/fzf'
Plugin 'junegunn/fzf.vim'
Plugin 'hashivim/vim-terraform'
Plugin 'calviken/vim-gdscript3'
call vundle#end() " required
"Move lines
"" Normal mode
nnoremap ∆ :m .+1<CR>==
nnoremap ˚ :m .-2<CR>==
" Visual mode
vnoremap ∆ :m '>+1<CR>gv=gv
vnoremap ˚ :m '<-2<CR>gv=gv
" Visual mode move horizontally
vnoremap ˙ xhp
vnoremap ¬ xlP
vnoremap < <gv
vnoremap > >gv
" Start interactive EasyAlign in visual mode (e.g. vip<Enter>)
vmap <Enter> <Plug>(EasyAlign)
" Start interactive EasyAlign for a motion/text object (e.g. <Leader>aip)
nmap <Leader>a <Plug>(EasyAlign)
" For local replace
nnoremap gr gd[{V%::s/<C-R>///gc<left><left><left>
" For global replace
nnoremap gR gD:%s/<C-R>///gc<left><left><left>
" Quick Save
nnoremap SS :w<CR>
imap ZZ <ESC>ZZ
imap SS <ESC>SS
imap ZQ <ESC>ZQ
imap <C-l> <Del>
inoremap <C-c> <ESC>
set dir=/tmp
set cursorline
set number
set ic
set background=dark
set backspace=2
set hlsearch
set incsearch
hi Search cterm=NONE ctermfg=white ctermbg=blue
syntax on " Enable syntax highlighting
filetype on " Enable filetype detection
filetype indent on " Enable filetype-specific indenting
filetype plugin on " Enable filetype-specific plugins
au FileType sh setl sw=2 sts=2 et
au FileType ruby setl sw=2 sts=2 et
au FileType eruby setl sw=2 sts=2 et
au FileType python setl ts=8 et sw=4 sts=4
au FileType yaml setlocal ts=2 sts=2 sw=2 expandtab
au FileType tf setlocal ts=2 sts=2 sw=2 expandtab
au FileType javascript setlocal ts=2 sts=2 sw=2 expandtab
au FileType html setlocal ts=2 sts=2 sw=2 expandtab
au FileType css setlocal ts=2 sts=2 sw=2 expandtab
au BufNewFile,BufRead *.scss set filetype=eruby
au BufNewFile,BufRead *.erb set filetype=eruby
au BufNewFile,BufRead *.gd setlocal ts=2 sts=2 sw=2 expandtab
au BufNewFile,BufRead *.dot setlocal ts=2 sts=2 sw=2 expandtab
au BufNewFile,BufRead *.ts setlocal ts=2 sts=2 sw=2 expandtab
map <Leader>n <plug>NERDTreeTabsToggle<CR>
set hlsearch
hi Search cterm=NONE ctermfg=white ctermbg=blue
set t_Co=256
let g:jellybeans_use_lowcolor_black = 0
colorscheme jellybeans
au VimEnter * IndentGuidesEnable
" let g:nerdtree_tabs_open_on_console_startup=1
" make mvim clipboard work in tmux
set clipboard=unnamed
set swapfile
set splitright
set completeopt-=preview
let g:go_highlight_types = 1
"let g:go_highlight_fields = 1
let g:go_highlight_functions = 1
let g:go_highlight_function_calls = 1
let g:go_highlight_operators = 1
"let g:go_highlight_extra_types = 1
let g:go_highlight_function_arguments = 1
let g:go_highlight_build_constraints = 1
let g:go_highlight_structs = 1
let g:go_highlight_methods = 1
autocmd BufNewFile,BufRead *.go setlocal noexpandtab tabstop=4 shiftwidth=4
let g:go_fmt_command = "goimports"
" fzf: https://github.com/junegunn/fzf.vim#usage
" Mapping selecting mappings
nmap <leader><tab> <plug>(fzf-maps-n)
xmap <leader><tab> <plug>(fzf-maps-x)
omap <leader><tab> <plug>(fzf-maps-o)
" Insert mode completion
imap <c-x><c-k> <plug>(fzf-complete-word)
imap <c-x><c-f> <plug>(fzf-complete-path)
imap <c-x><c-j> <plug>(fzf-complete-file-ag)
imap <c-x><c-l> <plug>(fzf-complete-line)
nnoremap <c-p> :Files<cr>
nnoremap <silent> <Leader>ag :Ag <C-R><C-W><CR>
set splitright
set splitbelow
set number relativenumber
set colorcolumn=80
let g:terraform_align=1
let g:deoplete#enable_at_startup = 1
" Disable Ex mode
nnoremap Q <Nop>
nmap <leader>pf <c-p>