• .vimrc配置


    本配置是按照博主本人的喜好来写的

    可根据自己的喜好进行改编

    摘自https://www.cnblogs.com/shengy/p/7478287.html

    color evening     " 设置背景主题  
    set showcmd         " 输入的命令显示出来,看的清楚些  
    "set cursorline
    "high CursorLine cterm=NONE ctermbg=gray
    
    autocmd BufNewFile *.cpp exec ":call SetTitle()" 
    func SetTitle() 
        if &filetype == 'cpp'
        	call setline(1,"#include <cstdio>")
            call append(line("."), "#include <cstring>")
            call append(line(".")+1, "#include <iostream>")
            call append(line(".")+2, "#include <algorithm>")
    		call append(line(".")+3, "")
    		call append(line(".")+4, "typedef long long ll;")
    		call append(line(".")+5, "typedef unsigned long long ull;")
    		call append(line(".")+6, "")
    		call append(line(".")+7, "using namespace std;")
    		call append(line(".")+8, "")
    		call append(line(".")+9, "const int maxn = 1e5 + 50, INF = 0x3f3f3f3f;")
    		call append(line(".")+10, "")
    		call append(line(".")+11, "inline int read () {")
    		call append(line(".")+12, "	register int x = 0, w = 1;")
    		call append(line(".")+13, "	register char ch = getchar ();")
    		call append(line(".")+14, "	for (; ch < '0' || ch > '9'; ch = getchar ()) if (ch == '-') w = -1;")
    		call append(line(".")+15, "	for (; ch >= '0' && ch <= '9'; ch = getchar ()) x = x * 10 + ch - '0';")
    		call append(line(".")+16, "	return x * w;")
    		call append(line(".")+17, "}")
    		call append(line(".")+18, "")
    		call append(line(".")+19, "inline void write (register int x) {")
    		call append(line(".")+20, "	if (x / 10) write (x / 10);")
    		call append(line(".")+21, "	putchar (x % 10 + '0');")
    		call append(line(".")+22, "}")
    		call append(line(".")+23, "")
    		call append(line(".")+24, "int main () {")
    		call append(line(".")+25, "")
    		call append(line(".")+26, "	return 0;")
    		call append(line(".")+27, "}")
        endif
    endfunc 
    
    nnoremap <F2> :g/^s*$/d<CR> 
    ino <F5> <esc>:call Run()<cr>
    map <F5> :call Run()<cr>
    func Run()
        exec "w"
        exec "!g++ % -o %< && time ./%<"
    endf
    no <F8> <esc>:call Gdb()<cr>
    map <F8> :call Gdb()<cr>
    func Gdb()
        exec "w"
        exec "!g++ % -o %< -g && gdb %<"
    endf
    map <C-d> dd
    imap <C-d> <esc>ddi
    map <C-z> u
    imap <C-z> <esc>ui
    map <M-down> ddp
    imap <M-down> <esc>ddpi
    map <M-up> <up>ddp<up>
    imap <M-up> <esc><up>ddp<up>i
    "从不备份  
    set nobackup
    " 自动缩进
    set autoindent
    set cindent
    " Tab键的宽度
    set tabstop=4
    " 统一缩进为4
    set softtabstop=4
    set shiftwidth=4
    " 显示行号
    set number
    " 允许backspace和光标键跨越行边界
    set whichwrap+=<,>,h,l
    " 可以在buffer的任何地方使用鼠标(类似office中在工作区双击鼠标定位)
    set mouse=a
    " 高亮显示匹配的括号
    set showmatch
    "自动补全
    :inoremap ( ()<ESC>i
    :inoremap ) <c-r>=ClosePair(')')<CR>
    :inoremap { {}<ESC>i
    :inoremap } <c-r>=ClosePair('}')<CR>
    :inoremap [ []<ESC>i
    :inoremap ] <c-r>=ClosePair(']')<CR>
    :inoremap " ""<ESC>i
    :inoremap ' ''<ESC>i
    function! ClosePair(char)
        if getline('.')[col('.') - 1] == a:char
            return "<Right>"
        else
            return a:char
        endif
    endfunction
    
    
    
  • 相关阅读:
    Http与WWW服务精解
    Http与WWW服务精解
    6-13
    好用的工具说明
    JVM、JRE和JDK三者间的区别和联系
    css进阶之二:flex弹性布局
    MVVM
    如何理解TCP的三次握手协议?
    java里面的设计模式
    linux常用命令
  • 原文地址:https://www.cnblogs.com/Rubyonly233/p/13245929.html
Copyright © 2020-2023  润新知