Advertisement
QinghaoHu

My CP vimrc

Oct 20th, 2023
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 1.55 KB | None | 0 0
  1.  
  2. set modelines=0     " CVE-2007-2438
  3.  
  4. " Normally we use vim-extensions. If you want true vi-compatibility
  5. " remove change the following statements
  6. set nocompatible    " Use Vim defaults instead of 100% vi compatibility
  7. set backspace=2     " more powerful backspacing
  8.  
  9. " Don't write backup file if vim is being called by "crontab -e"
  10. au BufWrite /private/tmp/crontab.* set nowritebackup nobackup
  11. " Don't write backup file if vim is being called by "chpass"
  12. au BufWrite /private/etc/pw.* set nowritebackup nobackup
  13.  
  14. let skip_defaults_vim=1
  15.  
  16. set autoindent
  17.  
  18. set ts=4
  19. set sw=4
  20. set showcmd
  21. set showmode
  22. set clipboard=unnamed
  23.  
  24. set mouse=a
  25.  
  26. set noswapfile
  27. set nobackup
  28. set nocompatible
  29.  
  30. syntax on
  31. set number
  32.  
  33. map <F5> :call Run()<CR>
  34. map <F6> :call ST()<CR>
  35. map <F7> :call Rnjava()<CR>
  36. map <F9> :%y+<CR>
  37.  
  38. func! Rnjava()
  39.     exec "w"
  40.     exec "!javac %"
  41. endfunc
  42.  
  43. func! Run()
  44.     exec "w"
  45.     exec "!g++-13 % -o %< -O2"
  46. endfunc
  47.  
  48. func! ST()
  49.     exec "!./%<"
  50. endfunc
  51.  
  52. colorscheme sorbet
  53.  
  54. set guifont=Fixedsys_Excelsior_3.01:h18
  55.  
  56. inoremap ' ''<ESC>i
  57. inoremap " ""<ESC>i
  58. inoremap {<CR> {<CR>}<Esc>O
  59. inoremap {<SPACE> {}<LEFT>
  60.  
  61. set nu
  62.  
  63. inoremap <F8> #include<bits/stdc++.h><CR><CR>typedef long long ll;<CR>typedef long double ld;<CR><CR>using namespace std;<CR><CR>int main(){<CR>    ios::sync_with_stdio(0);<CR>cin.tie(0);<CR><CR><CR>return 0;<CR><ESC>i}
  64. inoremap <F10> void setOI(string s){<CR>    freopen((s + ".in").c_str(), "r", stdin);<CR>freopen((s + ".out").c_str(), "w", stdout);<CR><ESC>i}<CR>
  65.  
  66. "autocmd BufNewFile *.cpp 0r ~/a.cpp
  67.  
  68. set relativenumber
  69.  
  70.  
  71.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement