-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
111 lines (93 loc) · 2.57 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
call plug#begin('~/.vim/plugged')
Plug 'ambv/black'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'Valloric/YouCompleteMe'
Plug 'ludovicchabant/vim-gutentags'
Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
Plug 'nvie/vim-flake8'
Plug 'morhetz/gruvbox'
call plug#end()
set encoding=utf-8
" Black
autocmd BufWritePre *.py execute ':Black'
" colorscheme
colorscheme gruvbox
set background=dark
" key mappings
let mapleader=","
inoremap <C-d> import code; code.interact(local = locals())<ESC>
inoremap <C-e> import sys; sys.exit(0)<ESC>
inoremap <C-k> ("")<Left><Left>
inoremap <C-l> [""]<Left><Left> inoremap jk <ESC>
inoremap jk <ESC>
inoremap Jk <ESC>
inoremap JK <ESC>
noremap <S-r> :w<CR>:!%:p
nnoremap <Tab> :bnext<CR>
nnoremap <S-Tab> :bprevious<CR>
nnoremap <Leader>rtw :%s/\s\+$//e<CR>
map <leader>q :bp<bar>sp<bar>bn<bar>bd<CR>
" Whitespace
set tabstop=4
set softtabstop=4
set expandtab
set shiftwidth=4
set autoindent
set nosmartindent
set linespace=0
set nojoinspaces
set number
" speed
set ttyfast
set lazyredraw
set backspace=indent,eol,start
set laststatus=2
" multiple vim window nav "
noremap <C-j> <C-w>j<C-j>
noremap <C-k> <C-w>k<C-k>
noremap <C-l> <C-w>l<C-l>
noremap <C-h> <C-w>h<C-h>
set hlsearch!
nnoremap <F3> :set hlsearch!<CR>
set encoding=utf-8
" color
set t_Co=256
" airline
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#left_alt_sep = '▶'
let g:airline#extensions#tabline#left_alt_sep = '>'
let g:airline#extensions#tabline#left_sep = '>'
let g:airline_theme='bubblegum'
" Resizing with Arrows
nnoremap <Left> :vertical resize +2<CR>
nnoremap <Right> :vertical resize -2<CR>
nnoremap <Up> :resize -2<CR>
nnoremap <Down> :resize +2<CR>
" undo settings
set undofile
set undodir=~/.vim/undodir
set hlsearch
"hi Search cterm=NONE ctermfg=black ctermbg=white
"hi CursorLineNr cterm=None ctermfg=white ctermbg=black
highlight ExtraWhitespace ctermbg=red ctermfg=black guibg=lightgray guifg=black
match ExtraWhitespace /\s\+$/
"highlight OverLength ctermbg=lightgray ctermfg=black guibg=lightgray guifg=black
"2match OverLength /\%>80v.\+/
augroup BgHighlight
autocmd!
autocmd WinEnter * set cul
autocmd WinLeave * set nocul
augroup END
if &term =~ '256color'
" disable Background Color Erase (BCE) so that color schemes
" render properly when inside 256-color tmux and GNU screen.
" see also http://snk.tuxfamily.org/log/vim-256color-bce.html
set t_ut=
endif
" Gutentags
" Don't load me if there's no ctags file
"if !executable('ctags')
" let g:gutentags_dont_load = 1
"endif