-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
154 lines (120 loc) · 3.15 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
154
set nocompatible " be iMproved
filetype off " required!
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle
" required!
Plugin 'gmarik/Vundle.vim'
" My Bundles here:
"
" original repos on github
Plugin 'tpope/vim-rails.git'
Plugin 'vim-ruby/vim-ruby'
Plugin 'tpope/vim-fugitive'
Plugin 'Valloric/YouCompleteMe'
Plugin 'leafoftree/vim-vue-plugin'
Plugin 'dense-analysis/ale'
Plugin 'msanders/snipmate.vim'
call vundle#end()
filetype plugin indent on
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin
ActivateAddons vim-snippets snipmate
set diffexpr=MyDiff()
function MyDiff()
let opt = '-a --binary '
if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
let arg1 = v:fname_in
if arg1 =~ ' ' | let arg2 = '"' . arg1 . '"' | endif
let arg2 = v:fname_new
if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif
let arg3 = v:fname_out
if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif
let eq = ''
if $VIMRUNTIME =~ ' '
if &sh =~ '\<cmd'
let cmd = '""' . $VIMRUNTIME . '\diff"'
let eq = '"'
else
let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"'
endif
else
let cmd = $VIMRUNTIME . '\diff'
endif
silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq
endfunction
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"
" My configurations
"
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"" Number
set number
set noundofile
"" Font
set guifont=Bitstream\ Vera\ Sans\ Mono\ 10
""Colorscheme
colorscheme railscasts
""Indent
set cindent
set smartindent
set autoindent
set expandtab
set tabstop=2
set shiftwidth=2
"" change word
set cpoptions+=$
"" virtual edit
set virtualedit=all
inoremap [ []<Esc>:call BC_AddChar("]")<CR>i
inoremap " ""<Esc>:call BC_AddChar("\"")<CR>i
" jump out of parenthesis
inoremap <C-j> <Esc>:call search(BC_GetChar(), "W")<CR>a
" abbravations
:iabbrev func function foo() {<CR><CR>}<Up><Tab>
:iabbrev cl console.log()<Left><ESC><X><CR>i
function! BC_AddChar(schar)
if exists("b:robstack")
let b:robstack = b:robstack . a:schar
else
let b:robstack = a:schar
endif
endfunction
function! BC_GetChar()
let l:char = b:robstack[strlen(b:robstack)-1]
let b:robstack = strpart(b:robstack, 0, strlen(b:robstack)-1)
return l:char
endfunction
" disabling ~ and .swp files
set nobackup
set noswapfile
" Buf Explorer
let g:bufExplorerShowRelativePath=1
" ctag PATH variable
let Tlist_Ctags_Cmd = 'C:\Program Files\Vim\vim73\tools\ctags58.exe'
" Automaticaly change the current directory to working files directory
set autochdir
" no menu and toolbar
set go-=m
set go-=T
set go-=r
" for hidden buffers
set hidden
" syntax highlight on html
au BufReadPost *.ezt set syntax=html
" *** Keys ***
let mapleader = ","
imap jj <esc>
" *** Abbreviations *** {{{1
iab tihs this
iab tehn then
filetype plugin on
" linting settings
let g:ale_linters = {
\ 'javascript': ['standard'],
\}
let g:ale_fixers = {'javascript': ['standard']}
let g:ale_lint_on_save = 1
let g:ale_fix_on_save = 1