"Linux Configuration" Vim configuration file contents

Source: Internet
Author: User
Tags define function

  • Configuration of Vim
  • Files: ~/.VIMRC
  • Edit configuration in the. vimrc file in your home directory
  • Settings are as follows:
  • 1Set Nu"Serial Number2Set tabstop=4  "the size of the TAB key3 Set ShowCmd4Nnoremap <F2>: Set Nonumber!<cr>:set foldcolumn=0<CR>"use F2 to switch numbers for easy copying5 6 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""7 "create a new. c,.h,.sh,.java file, insert the file header automatically8Autocmd Bufnewfile *.CPP,*. [Ch],*.SH, *.java exec": Call Settitle ()" 9 ""define function settitle, insert file header automaticallyTen func settitle () One     "If the file type is. sh file A     if&filetype = ='SH'  -Call Setline (1,"\#########################################################################")  -Call Append ("."),"\# File Name:". Expand ("%"))  theCall Append (".")+1,"\#[email protected] Author:panhao_neo")"here is the copyright name (author) -Call Append (".")+2,"\# Mail: [email protected]")"Email -Call Append (".")+3,"\# Created Time:". Strftime ("%c")) -Call Append (".")+4,"\#########################################################################") +Call Append (".")+5,"\#!/bin/bash") -Call Append (".")+6,"") +     Else ACall Setline (1,"/*************************************************************************") atCall Append ("."),"> File Name:". Expand ("%")) -Call Append (".")+1,"> [email protected] Author:panhao_neo")   -Call Append (".")+2,"> Mail: [email protected]") -Call Append (".")+3,"> Created Time:". Strftime ("%c")) -Call Append (".")+4," ************************************************************************/") -Call Append (".")+5,"") in endif -     if&filetype = ='CPP' toCall Append (".")+6,"#include <iostream>") +Call Append (".")+7,"using namespace std;") -Call Append (".")+8,"") the endif *     if&filetype = ='C' $Call Append (".")+6,"#include <stdio.h>")Panax NotoginsengCall Append (".")+7,"int main ()") -Call Append (".")+8,"{") theCall Append (".")+9,"    ") +Call Append (".")+Ten,"}") A endif the     "if &filetype = = ' java ' +     "Call Append (".") +6,"public class". Expand ("%")) -     "Call Append (".") +7,"") $     "endif $     "automatically navigates to the end of a file after creating a new file -Autocmd Bufnewfile *Normal G -Endfunc

"Linux Configuration" Vim configuration file contents

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.