Vim remap F5 CTRL-F7 F7 F12

Source: Internet
Author: User

For example, define F5 as the compile execution, F7 as the compile, Ctrl-F7 as the run, define F12 as the debug, because F11 is also used in the terminal under Ubuntu.

"Remap F5 to complie the C ++ Program <br/> func compilerun () <br/> EXEC "W" <br/> If & filetype = 'C' <br/> EXEC "! Rm % <"<br/> EXEC "! GCC %-g-o % <"<br/> EXEC "!. /% <"<Br/> elseif & filetype = 'cpp '| & filetype = 'cc' <br/> EXEC" RM % <"<br/> Exec "! C ++ %-g-o % <"<br/> EXEC "!. /% <"<Br/> elseif & filetype = 'java' <br/> EXEC" RM % <"<br/> EXEC "! Javac % "<br/> EXEC "! Java % <"<br/> endif <br/> endfunc <br/> func compile () <br/> EXEC "W" <br/> If & filetype = 'C' <br/> EXEC "! Rm % <"<br/> EXEC "! GCC %-g-wall-o % <"<br/> elseif & filetype = 'cpp '| & filetype = 'cc' <br/> EXEC" RM % <"<br/> EXEC "! C ++ %-g-wall-o % <"<br/> elseif & filetype = 'java' <br/> EXEC" RM % <"<br/> Exec "! Javac % "<br/> endif <br/> endfunc <br/> func run () <br/> EXEC "W" <br/> If & filetype = 'C' <br/> EXEC "!. /% <"<Br/> elseif & filetype = 'cpp '| & filetype = 'cc' <br/> EXEC "!. /% <"<Br/> elseif & filetype = 'java' <br/> EXEC "! Java % <"<br/> endif <br/> endfunc <br/> func debug () <br/> EXEC "W" <br/> If & filetype = 'C' <br/> EXEC "! GDB./% <"<br/> elseif & filetype = 'cpp '| & filetype = 'cc' <br/> EXEC "! GDB. /% <"<br/> endif <br/> endfunc <br/> Map <F5>: Call compilerun () <CR> <br/> Map <F7>: call compile () <CR> <br/> Map <C-F7>: Call run () <CR> <br/> Map <F12>: Call debug () <CR> <br/>

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.