Vim配置文件(用于Gvim)(2)

电脑杂谈  发布时间:2020-04-11 01:27:28  来源:网络整理

“设置标签+ = C: \开发\ GTK \包含\标签”对于GTK +

“设置标签+ = C: \开发\ Lua \ lua \标签”对于Lua

“设置标签+ = G: \ Cygwin \ usr \ include \标签”对于Cygwin

“ TxtBrowser突出显示TXT文本文件

au BufRead,BufNewFile * .txt setlocal ft = txt

“ fencview自动编码识别: FencView视图文件编码和更改文件编码

让g: fencview_autodetect = 1

“ Load_Template根据文件后缀自动加载模板,请使用: LoadTemplate调出

让g: template_path ='D: \ Apps \ Gvim \ vimfiles \ template \'

“ NERD_commenter && authorinfo自动添加作者,时间和其他信息,使用: AuthorInfoDetect进行标注

让g: vimrc_author ='Ruchee'

让g: vimrc_email='my@ruchee.com'

让g: vimrc_homepage ='http: //www.ruchee.com'

“ #########一键保存并编译#########”

“ ##########如果未在此处配置所需的编程语言,请参考示例进行自行配置,这非常简单

“编译C源文件

功能! CompileGcc()

exec“ w”

let compilecmd =“!gcc -Wall -pedantic -std = c99”

let compileflag =“ -o%

exec compilecmd. “%” .compileflag

endfunc

“编译C ++源文件

功能! CompileCpp()

exec“ w”

let compilecmd =“!g ++-墙-pedantic -std = c ++ 98”

let compileflag =“ -o%

exec compilecmd. “%” .compileflag

endfunc

“编译Java源文件

功能! CompileJava()

exec“ w”

exec“!javac%”

endfunc

“编译Haskell源文件

功能! CompileHaskell()

exec“ w”

let compilecmd =“!ghc --make”

let compileflag =“ -o%

exec compilecmd. “%” .compileflag

endfunc

“运行Lua源文件

功能! RunLua()

exec“ w”

exec“!lua%”

endfunc

“运行Perl源文件

功能! RunPerl()

exec“ w”

exec“!perl%”

endfunc

“运行Python源文件

功能! RunPython()

gvim 配置文件_linux环境变量 文件配置_regionservers文件怎么配置

exec“ w”

exec“!python%”

endfunc

“运行Ruby源文件

功能! RunRuby()

exec“ w”

exec“!ruby%”

endfunc

“根据文件类型自动选择相应的编译功能

功能! CompileCode()

exec“ w”

if&filetype ==“ c”

exec“调用CompileGcc()”

elseif&文件类型==“ cpp”

exec“调用CompileCpp()”

elseif&文件类型==“ java”

exec“调用CompileJava()”

elseif&filetype ==“ haskell”

exec“调用CompileHaskell()”

elseif&文件类型==“ lua”

exec“调用RunLua()”

elseif&文件类型==“ perl”

exec“调用RunPerl()”

elseif&filetype ==“ python”

exec“调用RunPython()”

elseif&文件类型==“”

exec“调用RunRuby()”

endif

endfunc

“运行可执行文件

功能! RunResult()

exec“ w”

if&filetype ==“ c”

exec“!%

elseif&文件类型==“ cpp”

exec“!%

elseif&文件类型==“ java”

exec“!Java%

elseif&filetype ==“ haskell”

exec“!%

elseif&文件类型==“ lua”

exec“!lua%

elseif&文件类型==“ perl”

exec“!perl%

elseif&filetype ==“ python”

exec“!python%

elseif&文件类型==“”

exec“!%

endif

endfunc

“ Ctrl + C一键保存,编译

map ^ C: 调用CompileCode()

imap ^ C: 调用CompileCode()

vmap ^ C: 调用CompileCode()

“ Ctrl + R一键保存,运行

map ^ R: 调用RunResult()

imap ^ R: 调用RunResult()

vmap ^ R: 调用RunResult()

“ ######### VimWiki写作助手#########”

“使用鼠标映射

让g: vimwiki_use_mouse = 1

“不要将类似驼峰的短语用作Wiki条目

让g: vimwiki_camel_case = 0


本文来自电脑杂谈,转载请注明本文网址:
https://www.pc-fly.com/a/jisuanjixue/article-171229-2.html

相关阅读
    发表评论  请自觉遵守互联网相关的政策法规,严禁发布、暴力、反动的言论

    热点图片
    拼命载入中...