-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvimrc
118 lines (92 loc) · 2.19 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
"
" PLUGINS
"
execute pathogen#infect('bundle/{}')
" CtrlP
set runtimepath^=~/.vim/bundle/ctrlp.vim
let g:ctrlp_working_path_mode = 'r'
" Tagbar
let g:tagbar_width = 50
let g:tagbar_autofocus = 1
let g:task_readonly = 0
" Markdown
let g:vim_markdown_folding_disabled = 1
" vim-go
au FileType go nmap <Leader>dv <Plug>(go-def-vertical)
au FileType go nmap <Leader>gd <Plug>(go-doc)
let g:go_fmt_command = "goimports"
let g:go_fmt_options = "-local=github.com/elastic"
let g:go_def_mode='gopls'
let g:go_info_mode='gopls'
" Rust
let g:rustfmt_autosave = 1
set t_Co=256
syntax on
filetype plugin indent on
let mapleader=","
colorscheme molokai
set wildmenu
set lazyredraw
set backspace=indent,eol,start
set autoread
set noswapfile
set ignorecase
set smartcase
set showmatch
set incsearch
set hlsearch
set autoindent
set shiftwidth=4
set tabstop=4
set expandtab
set smarttab
set foldenable
set number
set cursorline
set confirm
" Commands
command! Q :q
command! Qall :qall
command! QAll :qall
command! W :w
command! Wq :wq
command! WQ :wq
command! Wqall :wqall
command! WQall :wqall
command! WQAll :wqall
set laststatus=2
" Hotkeys
inoremap ;; <esc>
nnoremap <F2> :set rnu! \| :set nu!<CR>
nmap <F4> :nohl<CR>
nmap <F5> :source ~/.vimrc<CR>
nmap <F6> :SyntasticReset<CR>
nmap <F7> :SyntasticCheck<CR>
nmap <F8> :TagbarToggle<CR>
nmap <F9> :%s/\s\+$//<CR>
nmap <F10> :setlocal spell spelllang=en_us<CR>
"nmap ip oimport ipdb; ipdb.set_trace()<ESC>
nmap Gt :GoTest<CR>
nmap Gli :GoLint<CR>
nmap Gbu :GoBuild<CR>
nmap Gd :GoDef<CR>
nmap ~~ <Home>i~~<ESC>A~~<ESC>
nmap ~x :s/- \[ \]/- \[x\]/<CR>
"Rust stuff
nmap Rsf i<Right>String::from("")<ESC>hi
nmap Rp i<Right>println!("")<ESC>hi
nmap Ts $i<Right>;
inoremap Ts <ESC>$i<Right>;
"nmap ;im o\begin{figure}[h]<CR>\begin{minted}[breaklines, breakbytoken, fontsize=\footnotesize, bgcolor=codebg]{c}<CR>%%%<CR>\end{minted}<CR>\end{figure}<ESC>
"imap <buffer> mn <C-O>/%%%<CR><C-O>c3l
"nmap <buffer> mn /%%%<CR>c3l
noremap <Up> <NOP>
noremap <Down> <NOP>
noremap <Left> <NOP>
noremap <Right> <NOP>
vnoremap < <gv
vnoremap > >gv
highlight ExtraWhitespace ctermbg=red guibg=red
match ExtraWhitespace /\s\+$/
highlight colorcolumn ctermbg=darkgrey guibg=darkgrey
set colorcolumn=121