Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "cliboard-setting
- set clipboard=unnamed
- set ruler
- "font
- "set gfn=SauceCodePro\ NFM:h10
- "set gfn=consolas:h15
- "set gfn=FiraCode\ Nerd\ Font\ Mono:h10
- "set gfn=JetBrainsMono\ Nerd\ Font\ Mono:h10
- set gfn=FixedsysExcelsiorIIIb_NFM:h12
- set gfn=Consolas\ NF:h10.5
- "filesetting
- set hidden
- set backspace=2
- set noswapfile
- set nobackup
- set nocompatible
- set encoding=utf-8
- set nu
- set splitbelow
- "set relativenumber
- "syntax
- syntax on
- "indent
- set autoindent
- set smartindent
- set cindent
- "set cursorline
- set expandtab
- set smarttab
- "tab
- set ts=4
- set sw=4
- "set auto-pairs
- inoremap {<CR> {<CR>}<ESC>O
- inoremap { {}<ESC>i
- inoremap } <c-r>=ClosePair('}')<CR>
- inoremap ( ()<ESC>i
- inoremap ) <c-r>=ClosePair(')')<CR>
- inoremap [ []<ESC>i
- inoremap ] <c-r>=ClosePair(']')<CR>
- function! ClosePair(char)
- if getline('.')[col('.') - 1] == a:char
- return "\<Right>"
- else
- return a:char
- endif
- endfunction
- "Compile
- func! Comp()
- exec "w"
- if &filetype == "cpp"
- exec "!g++ -O2 -std=c++17 -Wall -Wfatal-errors % -o %<"
- elseif &filetype == "cc"
- exec "!g++ -O2 -std=c++17 -Wall -Wfatal-errors % -o %<"
- elseif &filetype == "java"
- exec "!javac %"
- endif
- endfunc
- set guioptions -=T
- func! Run()
- exec "w"
- if &filetype == "java"
- exec "!java %<"
- elseif &filetype == "cc"
- exec "!%<.exe"
- elseif &filetype == "cpp"
- exec "!%<.exe"
- endif
- endfunc
- call plug#begin('~/vimfiles/plugged')
- Plug 'vim-airline/vim-airline'
- Plug 'vim-airline/vim-airline-themes'
- Plug 'christoomey/vim-tmux-navigator'
- Plug 'fenetikm/falcon'
- Plug 'octol/vim-cpp-enhanced-highlight'
- Plug 'neoclide/coc.nvim', {'branch': 'release'}
- Plug 'sonph/onehalf', { 'rtp': 'vim' }
- Plug 'altercation/vim-colors-solarized'
- Plug 'morhetz/gruvbox'
- Plug 'Yggdroot/indentLine'
- Plug 'tinted-theming/base16-vim'
- Plug 'sainnhe/gruvbox-material'
- Plug 'echasnovski/mini.base16'
- Plug 'vim-airline/vim-airline-themes'
- Plug 'junegunn/seoul256.vim'
- Plug 'lifepillar/vim-solarized8'
- Plug 'sainnhe/sonokai'
- Plug 'ryanoasis/vim-devicons'
- Plug 'joshdick/onedark.vim'
- Plug 'tomasiser/vim-code-dark'
- Plug 'preservim/nerdtree'
- Plug 'preservim/tagbar'
- Plug 'lycuid/vim-far'
- call plug#end()
- set background=dark
- "colorscheme base16-google-dark
- "colorscheme base16-gruvbox-material-dark-hard
- "colorscheme base16-gruvbox-material-light-hard
- "colorscheme base16-solarized-dark
- "colorscheme base16-solarized-light
- "colorscheme base16-tokyo-night-light
- "colorscheme base16-tokyo-night-terminal-light
- "colorscheme base16-kanagawa
- "colorscheme base16-spaceduck
- "colorscheme base16-eighties
- "colorscheme base16-tube
- "colorscheme base16-spacemacs
- "colorscheme base16-selenized-light
- "colorscheme base16-selenized-black
- "colorscheme base16-windows-highcontrast
- "colorscheme base16-windows-nt-light
- "colorscheme base16-windows-95-light
- "let g:seoul256_background = 256
- "colorscheme seoul256
- "colorscheme solarized8_high
- "colorscheme sonokai
- "colorscheme onedark
- "colorscheme codedark
- "colorscheme onehalflight
- colorscheme far
- noremap x :bd<CR>
- augroup VIMRC
- au!
- au BufWritePost .vimrc so %
- augroup END
- "set keymaps
- noremap <F2> :NERDTreeToggle<CR>
- noremap L :bn<CR>
- noremap H :bp<CR>
- noremap <F3> :!git status<CR>
- noremap <F4> :w<CR>
- noremap <F5> :CocRestart<CR>
- noremap <F6> :!git add .<CR>
- noremap <F7> :!git commit -m "
- noremap <F8> :TagbarToggle<CR>
- noremap J :u<CR>
- noremap <F9> :call Comp()<CR>
- noremap <F10> :!git push<CR>
- noremap <F11> :call Run()<CR>
- noremap <F12> :!%<.exe <
- "background
- hi NONTEXT ctermbg=NONE
- hi NORMAL ctermbg=NONE
- "template
- set laststatus=2 "永远显示状态栏
- let g:airline_powerline_fonts = 1 " 支持 powerline 字体
- let g:airline#extensions#tabline#enabled = 1
- "syntax setting
- let g:cpp_class_scope_highlight = 1
- let g:cpp_member_variable_highlight = 1
- let g:cpp_class_decl_highlight = 1
- let g:cpp_posix_standard = 1
- let g:cpp_experimental_simple_template_highlight = 1
- let g:cpp_concepts_highlight = 1
- set updatetime=300
- inoremap <silent><expr> <CR> coc#pum#visible() ? coc#pum#confirm()
- \: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
- inoremap <silent><expr> <TAB>
- \ coc#pum#visible() ? coc#_select_confirm() :
- \ coc#expandableOrJumpable() ? "\<C-r>=coc#rpc#request('doKeymap', ['snippets-expand-jump',''])\<CR>" :
- \ CheckBackspace() ? "\<TAB>" :
- \ coc#refresh()
- function! CheckBackspace() abort
- let col = col('.') - 1
- return !col || getline('.')[col - 1] =~# '\s'
- endfunction
- let g:coc_snippet_next = '<tab>'
- "indentline
- let g:indentLine_setColors = 0
- "airline
- let g:airline#extensions#tabline#fnamemod = ':t'
- let g:airline#extensions#tabline#show_tab_type = 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement