设为首页 收藏本站
查看: 906|回复: 0

[经验分享] Ubuntu下vim插件的在线安装

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2014-4-15 16:18:05 | 显示全部楼层 |阅读模式
今天弄vim插件搞了好久,最后还是发现在线安装是最省事儿的~~

1.安装taglist —浏览源码
源码浏览插件taglist可以把代码中的函数、结构体、变量等罗列在taglist列表中,文件中包含了那些元素,一目了然。
# vim-addons install taglist  

在vimrc中加入taglist的配置描述
.vimrc for taglist                                     let Tlist_Show_One_File = 1       “ 只显示当前文件的taglet Tlist_Use_Left_Window = 1     “ 在左侧显示taglistlet Tlist_Exit_OnlyWindow = 1     “ 当taglist是最后一个窗口时,退出vimlet Tlist_Enable_Fold_Column = 1  “ 显示折叠树let Tlist_WinWidth = 40           “ 设置taglist的宽度let Tlist_WinHeight = 50          “ 设置taglist的高度
安装完成后,vim打开后界面如下:
Center.jpg
如果要让打开vim的时候自动打开taglist则在vimrc中添加:let Tlist_Auto_Open=1   
2 安装winmanager —文件浏览和窗口管理
# vim-addons install winmanager  


安装完成后,进入vim,输入:WMToggle,可以看到左边出现了文件列表。
通过修改vimrc文件,将命令:WMToggle映射为normal模式下的wm命令,这样,下次使用时,就可以直接输入wm。

.vimrc for winmanagernmap wm :WMToggle<cr>


把文件浏览以及taglist整合在最左侧显示,文件浏览在上,taglist在下。
.vimrclet g:winManagerWindowLayout = “FileExplorer|TagList”      let g:winManagerWidth = 40          let g:winManagerHeight = 80   

安装完成后在命令行输入:VMToggle显示如下:
Center.jpg


我的配置文件如下:
" All system-wide defaults are set in $VIMRUNTIME/debian.vim (usually just  
2  " /usr/share/vim/vimcurrent/debian.vim) and sourced by the call to :runtime  
3  " you can find below.  If you wish to change any of those settings, you should  
4  " do it in this file (/etc/vim/vimrc), since debian.vim will be overwritten  
5  " everytime an upgrade of the vim packages is performed.  It is recommended to  
6  " make changes after sourcing debian.vim since it alters the value of the  
7  " 'compatible' option.  
8   
9  " This line should not be removed as it ensures that various options are  
10  " properly set to work with the Vim-related packages available in Debian.  
11  runtime! debian.vim  
12   
13  " Uncomment the next line to make Vim more Vi-compatible  
14  " NOTE: debian.vim sets 'nocompatible'.  Setting 'compatible' changes numerous  
15  " options, so any other options should be set AFTER setting 'compatible'.  
16  "set compatible  
17   
18  " Vim5 and later versions support syntax highlighting. Uncommenting the next  
19  " line enables syntax highlighting by default.  
20  if has("syntax")  
21    syntax on  
22  endif  
23   
24  " If using a dark background within the editing area and syntax highlighting  
25  " turn on this option as well  
26  "set background=dark  
27   
28  " Uncomment the following to have Vim jump to the last position when  
29  " reopening a file  
30  "if has("autocmd")  
31  "  au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif  
32  "endif  
33   
34  " Uncomment the following to have Vim load indentation rules and plugins  
35  " according to the detected filetype.  
36  "if has("autocmd")  
37  "  filetype plugin indent on  
38  "endif  
39   
40  " The following are commented out as they cause vim to behave a lot  
41  " differently from regular Vi. They are highly recommended though.  
42  "set showcmd        " Show (partial) command in status line.  
43  "set showmatch      " Show matching brackets.  
44  "set ignorecase     " Do case insensitive matching  
45  "set smartcase      " Do smart case matching  
46  "set incsearch      " Incremental search  
47  "set autowrite      " Automatically save before commands like :next and :make  
48  "set hidden             " Hide buffers when they are abandoned  
49  "set mouse=a        " Enable mouse usage (all modes)  
50   
51  " Source a global configuration file if available  
52  if filereadable("/etc/vim/vimrc.local")  
53    source /etc/vim/vimrc.local  
54  endif  
55  set tags=tags  
56  set autochdir  
57   
58  "显示行号  
59  set number  
60   
61  "自动缩进与C语言风格缩进  
62  set autoindent  
63  set cindent  
64   
65  "缩进宽度  
66  set tabstop=4  
67  set softtabstop=4  
68  set shiftwidth=4  
69  "建议开启expandtab选项,会自动将tab扩展很空格,代码缩进会更美观  
70  set expandtab  
71  "set noexpandtab  
72   
73  "switch case 对齐风格  
74  set cino=g0,:0  
75   
76   
77  "  
78  " taglist  
79  "  
80  let Tlist_Show_One_File=1    "只显示当前文件的tags  
81  let Tlist_WinWidth=40        "设置taglist宽度  
82  let Tlist_Exit_OnlyWindow=1  "tagList窗口是最后一个窗口,则退出Vim  
83  let Tlist_Use_Right_Window=1 "在Vim窗口右侧显示taglist窗口  
84  let Tlist_Auto_Open=1  
85  let g:winManagerWindowLayout = “FileExplorer|TagList”        
86  let g:winManagerWidth = 40            
87  let g:winManagerHeight = 80     


运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-17496-1-1.html 上篇帖子: ubuntu网络配置初步/etc/network 下篇帖子: grub操作之grub-shell启动iso,及grub修复,亮度无法调节解决 在线安装
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表