-
Notifications
You must be signed in to change notification settings - Fork 9
/
.vimrc
executable file
·119 lines (99 loc) · 2.68 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
call plug#begin('~/.vim/plugged')
Plug 'jiangmiao/auto-pairs'
Plug 'kchmck/vim-coffee-script'
Plug 'scrooloose/nerdcommenter'
Plug 'groenewege/vim-less'
Plug 'derekwyatt/vim-scala'
Plug 'tpope/vim-haml'
Plug 'vim-ruby/vim-ruby'
Plug 'tpope/vim-rails'
Plug 'pangloss/vim-javascript'
Plug 'garbas/vim-snipmate'
Plug 'MarcWeber/vim-addon-mw-utils'
Plug 'tomtom/tlib_vim'
Plug 'honza/vim-snippets'
Plug 'tpope/vim-surround'
Plug 'othree/html5.vim'
Plug 'nono/vim-handlebars'
Plug 'mklabs/grunt.vim'
Plug 'tikhomirov/vim-glsl'
Plug 'scrooloose/nerdtree'
Plug 'digitaltoad/vim-jade'
Plug 'junegunn/goyo.vim'
Plug 'junegunn/limelight.vim'
Plug 'keith/swift.vim'
Plug 'elzr/vim-json'
Plug 'leafgarland/typescript-vim'
Plug 'vim-scripts/groovy.vim'
Plug 'tfnico/vim-gradle'
Plug 'Vimjas/vim-python-pep8-indent'
Plug 'mxw/vim-jsx'
Plug 'w0rp/ale'
call plug#end()
syntax on
filetype indent plugin on
set nocompatible
set title
set ruler
set esckeys
set hlsearch
set showmode
set showmatch
set expandtab
set linebreak
set tabstop=2
set scrolloff=2
set shiftwidth=2
set softtabstop=2
set encoding=UTF-8
set fileencodings=UTF-8
set backspace=eol,start,indent
set mouse=a
"If tabstop settings does not work, check by
"":verbose set tabstop sw softtabstop expandtab"
map j gj
map k gk
"map <Up> <NOP>
"map <Down> <NOP>
"map <Left> <NOP>
"map <Right> <NOP>
"imap <Up> <NOP>
"imap <Down> <NOP>
"imap <Left> <NOP>
"imap <Right> <NOP>
let g:goyo_width = 70
let g:limelight_conceal_ctermfg = 240
let g:limelight_default_coefficient = 0.9
let g:syntastic_html_tidy_exec = 'tidy5'
let g:syntastic_cpp_compiler = 'clang++'
let g:syntastic_cpp_compiler_options = ' -std=c++11 -stdlib=libc++'
let g:syntastic_mode_map = { 'mode': 'active',
\ 'passive_filetypes': ['scala', 'java'] }
cabbrev E Explore
if has("autocmd")
" When editing a file, always jump to the last known cursor position.
" Don't do it when the position is invalid or when inside an event handler
" (happens when dropping a file on gvim).
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal g`\"" |
\ endif
autocmd BufEnter * let &titlestring = expand("%:t") . " :: vim"
autocmd! User GoyoEnter Limelight
autocmd! User GoyoLeave Limelight!
endif
" python
au Bufenter *.py map <F5> :!python %<CR>
" c
au Bufenter *.c map <F5> :!gcc % -lm && ./a.out<CR>
" cpp
au Bufenter *.cpp map <F5> :!g++ % -lm -std=c++11 && ./a.out<CR>
" ruby
au Bufenter *.rb map <F5> :!ruby %<CR>
" js
au Bufenter *.js map <F5> :!node %<CR>
" Makefile <F6>
map <F6> :!make<CR>
" md (requires grip, install it by `pip install grip`)
au Bufenter *.md map <F5> :!grip --gfm % 0.0.0.0:8080<CR>
colorscheme default