-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
80 lines (78 loc) · 1.83 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
let mapleader=" "
set number
set cursorline
set tabstop=4
set ignorecase
set smartcase
set laststatus=2
set hlsearch
inoremap jj <Esc>
inoremap ZZ <Esc>:wq<CR>
inoremap zz <Esc>:w<CR>
inoremap qq <Esc>:q!<CR>
nnoremap < <<
nnoremap > >>
nnoremap qq <Esc>:q!<CR>
nnoremap ; 0
nnoremap ' $
nnoremap <LEADER>w <C-w>w
nnoremap <LEADER>k <C-w>k
nnoremap <LEADER>j <C-w>j
nnoremap <LEADER>h <C-w>h
nnoremap <LEADER>l <C-w>l
call plug#begin('~/.vim/plugged')
Plug 'preservim/nerdtree'
Plug 'mhinz/vim-startify'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'altercation/vim-colors-solarized'
Plug 'bling/vim-bufferline'
call plug#end()
syntax enable
set background=dark
colorscheme solarized
highlight Pmenu guibg=darkgrey guifg=black
highlight PmenuSel guibg=lightgrey guifg=black
let g:coc_disable_startup_warning = 1
" Compile function
noremap r :call CompileRunGcc()<CR>
func! CompileRunGcc()
exec "w"
if &filetype == 'c'
exec "!g++ % -o %<"
exec "!time ./%<"
elseif &filetype == 'cpp'
set splitbelow
exec "!g++ -std=c++11 % -Wall -o %<"
:sp
:res -15
:term ./%<
elseif &filetype == 'java'
exec "!javac %"
exec "!time java %<"
elseif &filetype == 'sh'
:!time bash %
elseif &filetype == 'python'
set splitbelow
:sp
:term python %
elseif &filetype == 'html'
silent! exec "!".g:mkdp_browser." % &"
elseif &filetype == 'markdown'
exec "InstantMarkdownPreview"
elseif &filetype == 'tex'
silent! exec "VimtexStop"
silent! exec "VimtexCompile"
elseif &filetype == 'dart'
exec "CocCommand flutter.run -d ".g:flutter_default_device
silent! exec "CocCommand flutter.dev.openDevLog"
elseif &filetype == 'javascript'
set splitbelow
:sp
:term export DEBUG="INFO,ERROR,WARNING"; node --trace-warnings .
elseif &filetype == 'go'
set splitbelow
:sp
:term go run .
endif
endfunc
nmap <space>e :CocCommand explorer<CR>