-
Notifications
You must be signed in to change notification settings - Fork 1
/
.vimrc
115 lines (92 loc) · 2.76 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
" Masq's vimrc 9/17/2017
execute pathogen#infect()
" Ensure vim doesn't act weird
set nocompatible
" Turn on syntax highlighting
syntax enable
" enable line numbering
set number
" highlight/underline current line
set cursorline
" Set a colorcolumn at 80 (know when to stop typing ish) and make it purple
set cc=80
highlight ColorColumn ctermbg=5
" Set tabs and such to 2, shiftround so that shifts will round to our shiftwidth
set shiftwidth=4 softtabstop=4 tabstop=4 shiftround
" Turn on autoindenting
set autoindent
" Make tabs act/be written out as spaces
"set expandtab
" Make vim better-colored for dark backgrounds
set background=dark
" Ensure lines don't wrap down, and just carry on forever
set nowrap
" Move current tab into the specified direction.
"
" @param direction -1 for left, 1 for right.
function! TabMove(direction)
" get number of tab pages.
let total_pages=tabpagenr("$")
" move tab, if necessary.
if total_pages > 0
" get number of current tab page.
let current_index=tabpagenr()
" move left.
if a:direction < 0
if current_index == 1
let index=total_pages " move to the last
else
let index=a:direction " move by -1
endif
elseif a:direction > 0
if current_index == total_pages
let index=0 " move tab forward to position 0
else
let index="+1" " move forward by 1
endif
endif
" move tab page.
execute "tabmove ".index
endif
endfunction
nnoremap <silent> gr :call TabMove(-1)<CR>
nnoremap <silent> gy :call TabMove(1)<CR>
function! Paste_Func()
let s:inPaste = &paste
if !s:inPaste
set paste
endif
echom s:inPaste
augroup paste_callback
autocmd!
autocmd InsertLeave <buffer> call Paste_End()
augroup END
startinsert
endfunction
function! Paste_End()
augroup paste_callback
autocmd!
augroup END
augroup! paste_callback
if !s:inPaste
set nopaste
endif
endfunction
nnoremap ; :call Paste_Func()<cr>
" Python specific coding
autocmd FileType py setlocal shiftwidth=4 tabstop=4 softtabstop=4 expandtab
autocmd FileType python setlocal shiftwidth=4 tabstop=4 softtabstop=4 expandtab
" Syntastic Python
let g:syntastic_python_checkers = ['mypy', 'pylint', 'flake8']
"let g:syntastic_python_checkers = ['pylint', 'flake8']
"let g:syntastic_python_checkers = ['flake8']
" Javascript module specific coding
au BufNewFile,BufRead *.mjs set syntax=javascript
" Syntastic settings
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
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