Advertisement
QinghaoHu

ABCDEFGVIM

Mar 24th, 2024
22
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.77 KB | None | 0 0
  1. "cliboard-setting
  2. set clipboard=unnamed
  3. set ruler
  4. "font
  5. "set gfn=SauceCodePro\ NFM:h10
  6. "set gfn=consolas:h15
  7. "set gfn=FiraCode\ Nerd\ Font\ Mono:h9.5
  8. "set gfn=JetBrainsMono\ Nerd\ Font\ Mono:h10
  9. "set gfn=FixedsysExcelsiorIIIb_NFM:h12
  10. "set gfn=Consolas\ NF:h9.75
  11. "set gfn=UbuntuMono\ Nerd\ Font\ Mono:h11
  12. set gfn=Hack\ Nerd\ Font\ Mono:h9.5
  13. "set gfn=MesloLGSDZ\ Nerd\ Font\ Mono:h9.5
  14. "set gfn=MesloLGL\ Nerd\ Font\ Mono:h9
  15. "set gfn=MesloLGMDZ\ Nerd\ Font\ Mono:h9
  16. "set gfn=MesloGLDS\ Nerd\ Font\ Mono:h9
  17. "set gfn=MesloLGS\ Nerd\ Font\ Mono:h9.5
  18.  
  19. "filesetting
  20. set hidden
  21. set backspace=2
  22. set noswapfile
  23. set nobackup
  24. set hlsearch
  25. "set nocompatible
  26. set nocp
  27. set encoding=utf-8
  28. "set cursorline
  29.  
  30. set nu
  31. set splitbelow
  32. "set relativenumber
  33. "syntax
  34. syntax on
  35.  
  36. "indent
  37. set autoindent
  38. set smartindent
  39. set cindent
  40. "set cursorline
  41. set expandtab
  42. set smarttab
  43.  
  44. "tab
  45. set ts=4
  46. set sw=4
  47.  
  48. "set auto-pairs
  49. inoremap { {}<Left>
  50. inoremap {<CR> {<CR>}<Esc>O
  51. inoremap {{ {
  52. inoremap {} {}
  53. inoremap } <c-r>=ClosePair('}')<CR>
  54. inoremap ( ()<ESC>i
  55. inoremap ) <c-r>=ClosePair(')')<CR>
  56. inoremap [ []<ESC>i
  57. inoremap ] <c-r>=ClosePair(']')<CR>
  58.  
  59. function! ClosePair(char)
  60. if getline('.')[col('.') - 1] == a:char
  61. return "\<Right>"
  62. else
  63. return a:char
  64. endif
  65. endfunction
  66.  
  67.  
  68. "Compile
  69. func! Comp()
  70. exec "w"
  71. if &filetype == "cpp"
  72. exec "!g++ -O2 -std=c++17 -Wall -Wfatal-errors % -o %<"
  73. elseif &filetype == "cc"
  74. exec "!g++ -O2 -std=c++17 -Wall -Wfatal-errors % -o %<"
  75. elseif &filetype == "java"
  76. exec "!javac %"
  77. endif
  78. endfunc
  79. set guioptions -=T
  80. func! Run()
  81. exec "w"
  82. if &filetype == "java"
  83. exec "!java %<"
  84. elseif &filetype == "cc"
  85. exec "!%<.exe"
  86. elseif &filetype == "cpp"
  87. exec "!%<.exe"
  88. endif
  89. endfunc
  90.  
  91. call plug#begin('~/vimfiles/plugged')
  92. Plug 'dawikur/base16-vim-airline-themes'
  93. Plug 'doums/darcula'
  94. Plug 'vim-airline/vim-airline'
  95. Plug 'vim-airline/vim-airline-themes'
  96. " Plug 'itchyny/lightline.vim'
  97. Plug 'christoomey/vim-tmux-navigator'
  98. Plug 'fenetikm/falcon'
  99. Plug 'octol/vim-cpp-enhanced-highlight'
  100. Plug 'neoclide/coc.nvim', {'branch': 'release'}
  101. Plug 'sonph/onehalf', { 'rtp': 'vim' }
  102. Plug 'altercation/vim-colors-solarized'
  103. Plug 'morhetz/gruvbox'
  104. Plug 'Yggdroot/indentLine'
  105. Plug 'tinted-theming/base16-vim'
  106. Plug 'sainnhe/gruvbox-material'
  107. Plug 'echasnovski/mini.base16'
  108. Plug 'vim-airline/vim-airline-themes'
  109. Plug 'junegunn/seoul256.vim'
  110. Plug 'lifepillar/vim-solarized8'
  111. Plug 'lifepillar/vim-gruvbox8'
  112. Plug 'sainnhe/sonokai'
  113. Plug 'ryanoasis/vim-devicons'
  114. Plug 'joshdick/onedark.vim'
  115. Plug 'tomasiser/vim-code-dark'
  116. Plug 'preservim/nerdtree'
  117. Plug 'preservim/tagbar'
  118. Plug 'frazrepo/vim-rainbow'
  119. "Plug 'mengelbrecht/lightline-bufferline'
  120. Plug 'chriskempson/vim-tomorrow-theme'
  121. call plug#end()
  122. set cursorline
  123. set background=light
  124. "colorscheme gruvbox-material
  125. "colorscheme base16-google-dark
  126. "colorscheme base16-gruvbox-material-dark-hard
  127. "colorscheme base16-gruvbox-dark-hard
  128. "colorscheme base16-outrun-dark
  129. colorscheme solarized8_flat
  130. "colorscheme base16-blueforest
  131. "colorscheme base16-lime
  132. "colorscheme base16-gruvbox-material-light-soft
  133. "colorscheme base16-solarized-dark
  134. "colorscheme base16-solarized-light
  135. "colorscheme base16-tokyo-night-storm
  136. "colorscheme base16-tokyo-night-terminal-light
  137. "colorscheme base16-kanagawa
  138. "colorscheme base16-spaceduck
  139. "colorscheme base16-eighties
  140. "colorscheme base16-tube
  141. "colorscheme base16-spacemacs
  142. "colorscheme base16-selenized-light
  143. "colorscheme base16-selenized-black
  144. "colorscheme base16-windows-highcontrast
  145. "colorscheme base16-windows-nt
  146. "colorscheme base16-windows-95-light
  147. "let g:seoul256_background = 256
  148. "colorscheme seoul256
  149. "colorscheme solarized8_flat
  150. "colorscheme sonokai
  151. "colorscheme onedark
  152. "colorscheme codedark
  153. "colorscheme onehalflight
  154. "colorscheme solarized8_flat
  155. "colorscheme gruvbox8
  156. "colorscheme Tomorrow
  157. "colorscheme base16-monokai
  158. "AirlineTheme base16_vim
  159. noremap x :bd<CR>
  160.  
  161.  
  162. augroup VIMRC
  163. au!
  164. au BufWritePost .vimrc so %
  165. augroup END
  166.  
  167. "set keymaps
  168. noremap <F2> :NERDTreeToggle<CR>
  169. noremap L :bn<CR>
  170. noremap H :bp<CR>
  171. noremap <F4> :w<CR>
  172. noremap <F5> :CocRestart<CR>
  173. noremap <F6> :set hlsearch<CR>:/
  174. noremap <F7> :noh<CR>
  175. noremap <F8> :TagbarToggle<CR>
  176. noremap J :u<CR>
  177. noremap <F9> :call Comp()<CR>
  178. noremap <F11> :call Run()<CR>
  179. noremap <F12> :!%<.exe <
  180.  
  181. "background
  182. hi NONTEXT ctermbg=NONE
  183. hi NORMAL ctermbg=NONE
  184. "template
  185.  
  186. set laststatus=2 "永远显示状态栏
  187. let g:airline_powerline_fonts = 1 " 支持 powerline 字体
  188. let g:airline#extensions#tabline#enabled = 1
  189. let g:airline#extensions#whitespace#enabled = 0
  190.  
  191.  
  192. "syntax setting
  193. let g:cpp_class_scope_highlight = 1
  194. let g:cpp_member_variable_highlight = 1
  195. let g:cpp_class_decl_highlight = 1
  196. let g:cpp_posix_standard = 1
  197. let g:cpp_experimental_simple_template_highlight = 1
  198. let g:cpp_concepts_highlight = 1
  199.  
  200. set updatetime=300
  201.  
  202. inoremap <silent><expr> <CR> coc#pum#visible() ? coc#pum#confirm()
  203. \: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
  204. inoremap <silent><expr> <TAB>
  205. \ coc#pum#visible() ? coc#_select_confirm() :
  206. \ coc#expandableOrJumpable() ? "\<C-r>=coc#rpc#request('doKeymap', ['snippets-expand-jump',''])\<CR>" :
  207. \ CheckBackspace() ? "\<TAB>" :
  208. \ coc#refresh()
  209.  
  210. function! CheckBackspace() abort
  211. let col = col('.') - 1
  212. return !col || getline('.')[col - 1] =~# '\s'
  213. endfunction
  214.  
  215. let g:coc_snippet_next = '<tab>'
  216.  
  217. "indentline
  218. let g:indentLine_setColors = 0
  219.  
  220. "airline
  221. let g:airline#extensions#tabline#fnamemod = ':t'
  222.  
  223. let g:airline#extensions#tabline#show_tab_type = 0
  224.  
  225. set guioptions-=m "menu bar
  226. set guioptions-=T "toolbar
  227. set guioptions-=r "scrollbar
  228.  
  229. au FileType c,cpp,objc,objcpp call rainbow#load()
  230. let g:rainbow_active = 1
  231.  
  232.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement