-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
189 lines (156 loc) · 5.38 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
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
set nocompatible " be iMproved, required
filetype off " required
set exrc
set encoding=UTF-8
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" ==== plugin manager
Plugin 'VundleVim/Vundle.vim'
" ==== plugin vim-slime
Plugin 'jpalardy/vim-slime'
" ==== plugin vim-table-mode
Plugin 'dhruvasagar/vim-table-mode'
" ==== helpers
Plugin 'vim-scripts/L9'
" ==== excel
"Plugin 'vim-scripts/excel.vim'
let g:zipPlugin_ext = '*.zip,*.jar,*.xpi,*.ja,*.war,*.ear,*.celzip,*.oxt,*.kmz,*.wsz,*.xap,*.docx,*.docm,*.dotx,*.dotm,*.potx,*.potm,*.ppsx,*.ppsm,*.pptx,*.pptm,*.ppam,*.sldx,*.thmx,*.crtx,*.vdw,*.glox,*.gcsx,*.gqsx'
" ==== File tree
Plugin 'scrooloose/nerdtree'
" ==== Completion
Plugin 'Valloric/YouCompleteMe'
" ==== Git
Plugin 'airblade/vim-gitgutter'
Plugin 'tpope/vim-fugitive'
" ==== syntax helpers
Plugin 'scrooloose/syntastic'
Plugin 'tpope/vim-surround'
Plugin 'cakebaker/scss-syntax.vim'
Plugin 'othree/yajs.vim'
Plugin 'mitsuhiko/vim-jinja'
Plugin 'octol/vim-cpp-enhanced-highlight'
Plugin 'ap/vim-css-color'
Plugin 'Vimjas/vim-python-pep8-indent'
" ==== moving / searching
Plugin 'easymotion/vim-easymotion'
Plugin 'kien/ctrlp.vim'
Plugin 'ervandew/supertab'
" ==== snippets
Plugin 'SirVer/ultisnips'
" Status bar on bottom
Plugin 'bling/vim-airline'
"===== Delay srt(sub)
Plugin 'pamacs/vim-srt-sync'
"Usage :DelaySrt [delay time in milliseconds or timecode format (HH:MM:SS,MIL)]
" ==== PLUGIN THEMES
Plugin 'morhetz/gruvbox'
"===== PYTHON-MODE
"Plugin 'klen/python-mode'
call vundle#end()
filetype plugin indent on
" ==== Colors and other basic settings
"colorscheme gruvbox
set guifont=Monospace\ 10
set fillchars+=vert:\$
syntax enable
set background=dark
set ruler
set hidden
set number
set laststatus=2
set smartindent
set st=4 sw=4 et
set shiftwidth=4
set tabstop=4
let &colorcolumn="80"
:set guioptions-=m "remove menu bar
:set guioptions-=T "remove toolbar
:set guioptions-=r "remove right-hand scroll bar
:set guioptions-=L "remove left-hand scroll bar
":set lines=999 columns=999
" ==== NERDTREE
let NERDTreeIgnore = ['__pycache__', '\.pyc$', '\.o$', '\.so$', '\.a$', '\.swp', '*\.swp', '\.swo', '\.swn', '\.swh', '\.swm', '\.swl', '\.swk', '\.sw*$', '[a-zA-Z]*egg[a-zA-Z]*', '.DS_Store']
let NERDTreeShowHidden=1
let g:NERDTreeWinPos="left"
let g:NERDTreeDirArrows=0
map <C-t> :NERDTreeToggle<CR>
" ==== Syntastic
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_javascript_checkers = ['eslint']
let g:syntastic_javascript_mri_args = "--config=$HOME/.jshintrc"
"let g:syntastic_python_checkers = [ 'pylint', 'flake8', 'pep8', 'pyflakes', 'python3']
let g:syntastic_yaml_checkers = ['jsyaml']
let g:syntastic_html_tidy_exec = 'tidy5'
" === flake8
let g:flake8_show_in_file=1
" ==== snippets
" If you want :UltiSnipsEdit to split your window.
let g:UltiSnipsEditSplit="vertical"
" make YCM compatible with UltiSnips (using supertab)
let g:ycm_key_list_select_completion = ['<C-n>', '<Down>']
let g:ycm_key_list_previous_completion = ['<C-p>', '<Up>']
let g:SuperTabDefaultCompletionType = '<C-n>'
" better key bindings for UltiSnipsExpandTrigger
let g:UltiSnipsExpandTrigger = "<tab>"
let g:UltiSnipsJumpForwardTrigger = "<tab>"
let g:UltiSnipsJumpBackwardTrigger = "<s-tab>"
" ==== Easymotion
let g:EasyMotion_do_mapping = 0
let g:EasyMotion_smartcase = 1
nmap f <Plug>(easymotion-s)
" ==== moving around
nmap <silent> <A-Up> :wincmd k<CR>
nmap <silent> <A-Down> :wincmd j<CR>
nmap <silent> <A-Left> :wincmd h<CR>
nmap <silent> <A-Right> :wincmd l<CR>
" ==== disable mouse
set mouse=a
" ==== disable swap file warning
set shortmess+=A
" ==== custom commands
command! JsonPretty execute ":%!python -m json.tool"
set secure
:let maplocalleader = "\\"
let g:slime_target = "tmux"
:inoremap jk <esc>
augroup filetype_all
autocmd!
" autocmd BufWritePre,BufRead *.html :normal gg=G
" autocmd BufWritePre,BufRead *.py :normal gg=G
autocmd FileType python nnoremap <buffer> \\c I# <esc>
autocmd FileType javascript nnoremap <buffer> \\c I//<esc>
augroup END
:set hlsearch incsearch
:inoremap <C-l> <esc>ggVGd
:nnoremap <C-l> <esc>ggVGd
:inoremap <C-a> <esc>ggVG
"autocmd Filetype python nnoremap <buffer> <F9> exec '!python' shellescape(@%, 1)<cr>
autocmd Filetype python inoremap <F9> <Esc>:w<CR>:!clear;python %<CR>
autocmd Filetype python nnoremap <F9> <Esc>:w<CR>:!clear;python %<CR>
:hi CursorLineNr term=none cterm=none ctermfg=202 guifg=Orange
":set cursorcolumn
":set cursorline
:set nrformats-=octal "fix when <c-a> auto add 07 to 10
" Protect large files from sourcing and other overhead.
" Files become read only
if !exists("my_auto_commands_loaded")
let my_auto_commands_loaded = 1
" Large files are > 10M
" Set options:
" eventignore+=FileType (no syntax highlighting etc
" assumes FileType always on)
" noswapfile (save copy of file)
" bufhidden=unload (save memory when other file is viewed)
" buftype=nowrite (file is read-only)
" undolevels=-1 (no undo possible)
let g:LargeFile = 1024 * 1024 * 10
augroup LargeFile
autocmd BufReadPre * let f=expand("<afile>") | if getfsize(f) > g:LargeFile | set eventignore+=FileType | setlocal noswapfile bufhidden=unload buftype=nowrite undolevels=-1 | else | set eventignore-=FileType | endif
augroup END
endif