bingxuan9112

Untitled

Jun 22nd, 2020
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 1.88 KB | None | 0 0
  1. set encoding=utf8
  2. set fileencoding=utf8
  3.  
  4. " let c_no_curly_error=1 " enhanced highlight issue
  5. call plug#begin('~/.vim/plugged')
  6.  
  7. Plug 'kaicataldo/material.vim'
  8. Plug 'itchyny/lightline.vim'
  9. Plug 'preservim/nerdtree'
  10. " Plug 'Xuyuanp/nerdtree-git-plugin'
  11. Plug 'gabrielelana/vim-markdown'
  12. Plug 'joker1007/vim-markdown-quote-syntax'
  13. " Plug 'octol/vim-cpp-enhanced-highlight'
  14.  
  15. call plug#end()
  16.  
  17. if has("gui_running")
  18.     au GUIEnter * simalt ~x " maximize window
  19.     set guioptions-=m " menu
  20.     set guioptions-=T " toolbar
  21.     set guioptions-=L " left scrollbar
  22.     set guioptions-=r " right scrollbar
  23.     " set guioptions-=b " buttom scrollbar
  24.     " set showtabline=0 " tabline
  25.     set guifont=Microsoft\ Yahei\ Mono:h14 " for Windows
  26.     " set guifont=Ubuntu\ Mono\ derivative\ Powerline:h14
  27.     au GUIEnter * set vb t_vb=
  28. endif
  29.  
  30. " color desert
  31. color material
  32. let g:lightline = { 'colorscheme': 'wombat' }
  33. set laststatus=2
  34.  
  35. syntax on
  36. set nu rnu ai bs=2 et sw=4 sts=4 hls
  37. set noeb vb t_vb=
  38. set cursorline noshowmode lazyredraw termguicolors
  39. au! InsertEnter,InsertLeave
  40. au InsertEnter,InsertLeave * set rnu!
  41.  
  42. inoremap {<CR> {<CR>}<C-o>O
  43. nnoremap ya :%y+<CR>
  44. nnoremap <silent> <C-TAB> :tabNext<CR>
  45. nnoremap <silent> <C-S-TAB> :tabprevious<CR>
  46. nnoremap <C-N> :tabnew<CR>:e
  47. nnoremap <silent> <A-j> :m.1<CR>==
  48. nnoremap <silent> <A-k> :m.-2<CR>==
  49. vnoremap <silent> <A-j> :m '>+1<CR>gv=gv
  50. vnoremap <silent> <A-k> :m '<-2<CR>gv=gv
  51. vnoremap > >gv
  52. vnoremap < <gv
  53.  
  54. nnoremap <silent> <F2> :cd %:h<CR>:NERDTreeToggle<CR>
  55.  
  56. au BufEnter,BufLeave *.cpp call CppFastBuild()
  57. function CppFastBuild()
  58.     nnoremap <F9> :w<CR>:!g++ % -o %:r -std=c++17 -Dlocal<CR>:!%:r<CR><CR>
  59.     nnoremap <F10> :!%:r<CR><CR>
  60. endfunction
  61.  
  62. au BufEnter,BufLeave *.py call PythonFastBuild()
  63. function PythonFastBuild()
  64.     nnoremap <F10> :w<CR>:!%<CR><CR>
  65.     nnoremap <F8> :w<CR>:!cmd<CR><CR>
  66. endfunction
Add Comment
Please, Sign In to add comment