go语言程序环境适配 go语言环境配置( 三 )


set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" alternatively, pass a path where Vundle should install plugins
"let path = '~/some/path/here'
"call vundle#rc(path)
" let Vundle manage Vundle, required
Plugin 'gmarik/vundle'
" The following are examples of different formats supported.
" Keep Plugin commands between here and filetype plugin indent on.
" scripts on GitHub repos
" Plugin 'tpope/vim-fugitive'
" Plugin 'Lokaltog/vim-easymotion'
" Plugin 'tpope/vim-rails.git'
" The sparkup vim script is in a subdirectory of this repo called vim.
" Pass the path to set the runtimepath properly.
" Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
" scripts from
" Plugin 'L9'
" Plugin 'FuzzyFinder'
" scripts not on GitHub
" Plugin 'git://git.wincent.com/command-t.git'
" git repos on your local machine (i.e. when working on your own plugin)
" Plugin ''
" ...
"
filetype plugin indent on" required
" To ignore plugin indent changes, instead use:
" filetype plugin on
"
" Brief help
" : PluginList- list configured plugins
" : PluginInstall(!) - install (update) plugins
" : PluginSearch(!) foo - search (or refresh cache first) for foo
" : PluginClean(!)- confirm (or auto-approve) removal of unused plugins
"
" see :h vundle for more details or wiki for FAQ
" NOTE: comments after Plugin commands are not allowed.
" Put your stuff after this line
syntax on
" ********************************************************************
" 这里省略了其它不相关的插件
" vimgdb插件
run macros/gdb_mappings.vim
" 官方的插件
" Some Linux distributions set filetype in /etc/vimrc.
" Clear filetype flags before changing runtimepath to force Vim to
"reload them.
filetype off
filetype plugin indent off
set runtimepath+=$GOROOT/misc/vim
filetype plugin indent on
syntax on
autocmd FileType go autocmd BufWritePre buffer Fmt
" 代码补全的插件
Bundle 'Blackrush/vim-gocode'
" 代码跳转提示
Bundle 'dgryski/vim-godef'
" 代码结构提示
Bundle 'majutsushi/tagbar'
nmap F8 :TagbarToggleCR
let g:tagbar_type_go = {
\ 'ctagstype' : 'go',
\ 'kinds': [
\ 'p:package',
\ 'i:imports:1',
\ 'c:constants',
\ 'v:variables',
\ 't:types',
\ 'n:interfaces',
\ 'w:fields',
\ 'e:embedded',
\ 'm:methods',
\ 'r:constructor',
\ 'f:functions'
\ ],
\ 'sro' : '.',
\ 'kind2scope' : {
\ 't' : 'ctype',
\ 'n' : 'ntype'
\ },
\ 'scope2kind' : {
\ 'ctype' : 't',
\ 'ntype' : 'n'
\ },
\ 'ctagsbin': 'gotags',
\ 'ctagsargs' : '-sort -silent'
\ }
go编程语言在windows环境和linux环境下那个更流畅?go 在Linux下其实根本不用安装go语言程序环境适配,解压后复制到usr/local下即可,再配置一下路径go语言程序环境适配:
export PATH=$PATH:/usr/local/go/bin
不过学习程序最好还是在linux环境下,这是因为,
精彩在这里go语言程序环境适配:
除动态语言外,静态语言都会产生目标文件o或obj,然后找到库文件后链接成可执行文件 。C语言如此,Go语言也是如此,你可用go run -work运行程序时来发现运行go语言程序环境适配的目录 。这个目录在linux下就是/tmp目录,为加快速度和减少硬盘损耗(个人认为这更重要),可把tmp设置成tmpfs格式 。
可加入一行:none /tmp tmpfs default 0 0
或加入mount tmpfs /tmp -t tmpfs -o size=128m
减少硬盘读取就是运行流畅 。
windows10怎么配置go语言环境变量首先从网上下载go语言的编译器,我在发布这篇经验的时候go语言编译器的版本已经更新到了1.4版 。根据你的系统平台下载相应的版本后,如果是压缩文件,先解压后双击运行,不是压缩文件,直接双击运行就可以了 , 运行后出现下面的界面,在下面界面上单击“Next” 。

推荐阅读