-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
211 lines (175 loc) · 5.63 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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
"dein Scripts-----------------------------
if &compatible
set nocompatible " Be iMproved
endif
" Required:
set runtimepath+=/Users/johannes/.cache/dein/repos/github.com/Shougo/dein.vim
" Required:
if dein#load_state('/Users/johannes/.cache/dein')
call dein#begin('/Users/johannes/.cache/dein')
" Let dein manage dein
" Required:
call dein#add('/Users/johannes/.cache/dein/repos/github.com/Shougo/dein.vim')
" Add or remove your plugins here like this:
"call dein#add('Shougo/neosnippet.vim')
"call dein#add('Shougo/neosnippet-snippets')
" Installed Plugins -------------------{{{
call dein#add('maralla/completor.vim')
call dein#add('tmhedberg/SimpylFold')
call dein#add('vim-scripts/indentpython.vim')
call dein#add('vim-scripts/a.vim')
call dein#add('nvie/vim-flake8')
call dein#add('jmcantrell/vim-virtualenv')
call dein#add('joshdick/onedark.vim')
call dein#add('vim-syntastic/syntastic')
call dein#add('jnurmine/Zenburn')
call dein#add('altercation/vim-colors-solarized')
call dein#add('scrooloose/nerdtree')
call dein#add('jistr/vim-nerdtree-tabs')
call dein#add('scrooloose/nerdcommenter')
call dein#add('vim-airline/vim-airline')
call dein#add('vim-airline/vim-airline-themes')
call dein#add('tpope/vim-fugitive')
call dein#add('dag/vim-fish')
call dein#add('rust-lang/rust.vim')
call dein#add('rstacruz/sparkup', {'rtp': 'vim/'})
call dein#add('MarcWeber/vim-addon-mw-utils')
call dein#add('tomtom/tlib_vim')
call dein#add('garbas/vim-snipmate')
call dein#add('honza/vim-snippets')
call dein#add('christoomey/vim-tmux-runner')
call dein#add('christoomey/vim-tmux-navigator')
call dein#add('ryanoasis/vim-devicons')
call dein#add('dylanaraps/wal.vim')
" }}}
"
" Required:
call dein#end()
call dein#save_state()
endif
" Required:
filetype plugin indent on
syntax enable
" If you want to install not installed plugins on startup.
if dein#check_install()
call dein#install()
endif
"End dein Scripts-------------------------
filetype off
" Change shell to POSIX shell for plugins
if &shell =~# 'fish$'
set shell=sh
endif
" set rtp+=~/.vim/bundle/Vundle.vim
" call vundle#begin()
" call vundle#begin('~/Documents/vimplugins')
" }}}
" call vundle#end()
set exrc
set secure
set guifont=SauceCodePro\ Nerd\ Font\ Mono\ 11
set t_Co=256
set laststatus=2
set foldmethod=indent
set foldlevel=99
set nu rnu
set encoding=utf-8
set tabstop=4
set softtabstop=4
set shiftwidth=4
set textwidth=79
set expandtab
set autoindent
set fileformat=unix
" Must haves ---------------{{{
filetype plugin indent on
syntax enable
" }}}
" Colorscheme from atom text editor
" colorscheme onedark
colorscheme wal
let python_highlight_all=1
let NERDTreeIgnore=['\.pyc$', '\~$', '\.out$', 'node_modules$', '__pycache__$']
let g:snipMate = { 'snippet_version' : 1 }
let g:rustfmt_autosave=1
let g:airline_theme='murmur'
let g:airline_powerline_fonts=1
let g:airline#extensions#tabline#enabled=1
let g:VtrStripLeadingWhitespace = 0
let g:VtrClearEmptyLines = 0
let g:VtrAppendNewline = 1
let g:completor_python_binary = '/usr/bin/python3'
let g:completor_racer_binary = '/home/johannes/.cargo/bin/racer'
let g:completor_clang_binary = '/usr/bin/clang'
let g:completor_auto_trigger = 0
" General mappings ------------{{{
map <leader>n <plug>NERDTreeTabsToggle<CR>
" }}}
" normal mode mappings----------------{{{
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
nnoremap <space> za
nnoremap <leader>ev :vsplit $MYVIMRC<CR>
nnoremap <leader>sv :source $MYVIMRC<CR>
nnoremap <S-Up> <C-Y>
nnoremap <S-Down> <C-E>
" }}}
" Insert mode mappings ----------------------{{{
inoremap jk <esc>
" inoremap ( ()<left>
" inoremap { {}<left>
" Use TAB to complete when typing words, else inserts TABs as usual. Uses
" dictionary, source files, and completor to find matching words to complete.
" Note: usual completion is on <C-n> but more trouble to press all the time.
" Never type the same word twice and maybe learn a new spellings!
" Use the Linux dictionary when spelling is in doubt.
function! Tab_Or_Complete() abort
" If completor is already open the `tab` cycles through suggested completions.
if pumvisible()
return "\<C-N>"
" If completor is not open and we are in the middle of typing a word then
" `tab` opens completor menu.
elseif col('.')>1 && strpart( getline('.'), col('.')-2, 3 ) =~ '^\w'
return "\<C-R>=completor#do('complete')\<CR>"
else
" If we aren't typing a word and we press `tab` simply do the normal `tab`
" action.
return "\<Tab>"
endif
endfunction
" Use `tab` key to select completions. Default is arrow keys.
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
" Use tab to trigger auto completion. Default suggests completions as you type.
inoremap <expr> <Tab> Tab_Or_Complete()
" }}}
" Visual mode mappings ---------------------{{{
vnoremap jk <esc>
" }}}
" Mapped operators -----------------------{{{
onoremap p i(
" }}}
" Vimscript file settings ----------------- {{{
augroup filetype_vim
autocmd!
autocmd FileType vim setlocal foldmethod=marker
augroup END
" }}}
" Mapping for execution ------------------- {{{
augroup execution
autocmd!
autocmd FileType python imap <F5> <ESC>:w<CR>:!clear;python %<CR>
autocmd FileType c imap <F5> <ESC>:w<CR>:!clear;make<CR>
augroup END
" }}}
" Line Numbering Style --------------------- {{{
augroup numbertoggle
autocmd!
autocmd BufEnter,FocusGained,InsertLeave * set relativenumber
autocmd BufLeave,FocusLost,InsertEnter * set norelativenumber
augroup END
" }}}
command Format :%!jq .
command Unformat :%!jq -c .