Show My VIMRC
"" "" "" New File title "" "" "" "" New. C,.h,.sh,.java file, automatically insert file header Autocmd bufnewfile *.cpp,*. [Ch],*.sh,*.java exec: Call Settitle () "" "Define function Settitle, automatically insert file header func settitle () if file type is. sh file if &filetype = = ' sh ' call Setline (1, "\#########################################################################") CA ll Append (Line ("."), "\# File Name:". Expand ("%")) called Append (Line (".") +1, "\# Author:oldz") Call Append (Line (".") +2, "\# mail:afireswallow@outlook.com") Call Append (Line (".") +3, "\# Created Time:". Strftime ("%c")) called Append (Line (".") +4, "\#########################################################################") Call Append (Line (".") +5, "\#!/bin/bash") Call Append (Line (".")
+6, "") Else call Setline (1, "/*************************************************************************") Call Append ("."), "> File Name:". Expand ("%")) called Append (Line (".") +1, "> Author:oLdz ") Call Append (Line (". ") +2, "> mail:afireswallow@outlook.com") Call Append (Line (".") +3, "> Created time:". Strftime ("%c")) called Append (Line (".") +4, "************************************************************************/") Call Append (Line (".") +5, "") endif if &filetype = = ' cpp ' Call Append (Line (".") +6, "#include <iostream>") Call Append (Line (".")
+7, "using namespace std;") Call Append (Line (".") +8, "") endif if &filetype = = ' C ' Call Append (Line (".") +6, "#include <stdio.h>") Call Append (Line (".") +7, "endif new file, automatically navigates to the end of the file autocmd bufnewfile * Normal G Endfunc" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" Set Mouse=a "" "," "" "", "" "" "" " Tax on "Automatic syntax highlighting ColorScheme Molokai" Set color scheme set number "shows line numbers set Cursorline" Highlight current line set ruler "open status bar ruler set Shiftwidth =4 "Set << and >> command when the width of the 4 set softtabstop=4" so that when the backspace key can be deleted at one time 4 spaces set tabstop=4 "set tab length of 4 set Nobackup" Overwriting a file does not back up filetype plugin indent on "Open plugin set Backupcopy=yes" Set the behavior of the backup to overwrite set ignorecase smartcase "Search when the case is ignored, but in one or more uppercase Keep the case sensitive set Nowrapscan "Prohibit search to file at both ends when searching for set Incsearch" When you enter a search for a search result set hlsearch when searching for text set smartindent "Turn on new rows using Smart Auto indent set Backspace=indent,eol,start" does not set the backspace and delete keys to remove carriage return set foldenable in the Insert state start folding set Foldmethod=syntax Set syntax collapse set foldcolumn=0 set the width of the collapsed area setlocal foldlevel=1 set the number of fold layers to set Foldclose=all to automatically close the collapsed Nnoremap <space> ; @= (foldclosed ('. ') < 0)?
' Zc ': ' zo ' <CR> "Use the SPACEBAR to switch and collapse set Novisualbell" Do not blink, don ' t know what set scrolloff=5 "the cursor moves to the top and bottom of the buffer to maintain 5 line spacing Set Autoread "setting automatically loads the set Completeopt=preview,menu" code completion when a file is changed: Inoremap [[]<esc>i:inoremap] <c-r& Gt;=closepair ('] ') <CR> ": Inoremap" "<esc>i": Inoremap ' <esc>i set iskeyword+=_,$,@,%,#,-"Words with the following symbols should not be wrapped to break the AU bufreadpost * if line (" ' \ ") > 0|if lines (" ' ") <= line (" $ ") |exe (" norm "") |else|exe "nor" M $ "|endif|endif" last cursor exit location Press F5 compile run map <F5>: Call COMPILERUNGCC () <CR> func! COMPILERUNGCC () Exec "W" if &filetype = = ' C ' exec '!g++%-o%< "exec"! ./%< "Elsei"
F &filetype = = ' cpp ' EXEC '!g++%-o%< ' exec '! ./%< elseif &filetype = ' java ' Exec "!javac%" exec "!java%<" elseif &filetype = ' sh ':!. /% endif endfunc "c,c++ Debug map <F8>: Call Rungdb () <CR> func! Rungdb () Exec "W" exec "!g++%-g-o%<" exec "!gdb ./%<" Endfunc