免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 2312 | 回复: 10
打印 上一主题 下一主题

Ubuntu11.04下VIM7.3.35问题。 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2012-02-24 00:53 |只看该作者 |倒序浏览
VIM无法设置高亮,无法set nu,无法自动缩进。
学习C,想方便点儿,但是修改了/etc/vim/vimrc之后没有作用。
  1. " 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. " This line should not be removed as it ensures that various options are
  9. " properly set to work with the Vim-related packages available in Debian.
  10. runtime! debian.vim

  11. " Uncomment the next line to make Vim more Vi-compatible
  12. " NOTE: debian.vim sets 'nocompatible'.  Setting 'compatible' changes numerous
  13. " options, so any other options should be set AFTER setting 'compatible'.
  14. "set compatible

  15. " Vim5 and later versions support syntax highlighting. Uncommenting the next
  16. " line enables syntax highlighting by default.
  17. if has("syntax")
  18.   syntax on
  19. endif

  20. " If using a dark background within the editing area and syntax highlighting
  21. " turn on this option as well
  22. "set background=dark

  23. " Uncomment the following to have Vim jump to the last position when
  24. " reopening a file
  25. "if has("autocmd")
  26. "  au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
  27. "endif

  28. " Uncomment the following to have Vim load indentation rules and plugins
  29. " according to the detected filetype.
  30. "if has("autocmd")
  31. "  filetype plugin indent on
  32. "endif

  33. " The following are commented out as they cause vim to behave a lot
  34. " differently from regular Vi. They are highly recommended though.
  35. "set showcmd                " Show (partial) command in status line.
  36. "set showmatch                " Show matching brackets.
  37. "set ignorecase                " Do case insensitive matching
  38. "set smartcase                " Do smart case matching
  39. "set incsearch                " Incremental search
  40. "set autowrite                " Automatically save before commands like :next and :make
  41. "set hidden             " Hide buffers when they are abandoned
  42. "set mouse=a                " Enable mouse usage (all modes)

  43. " Source a global configuration file if available
  44. if filereadable("/etc/vim/vimrc.local")
  45.   source /etc/vim/vimrc.local
  46. endif
复制代码

论坛徽章:
4
CU大牛徽章
日期:2013-03-13 15:29:07CU大牛徽章
日期:2013-03-13 15:29:49CU大牛徽章
日期:2013-03-13 15:30:192015年迎新春徽章
日期:2015-03-04 09:57:09
2 [报告]
发表于 2012-02-24 15:20 |只看该作者
set number
set expandtab
set shiftwidth=4
set softtabstop=4
set tabstop=4
set ignorecase smartcase
set incsearch
set hlsearch
set magic
syntax on
colorscheme default

论坛徽章:
4
CU大牛徽章
日期:2013-03-13 15:29:07CU大牛徽章
日期:2013-03-13 15:29:49CU大牛徽章
日期:2013-03-13 15:30:192015年迎新春徽章
日期:2015-03-04 09:57:09
3 [报告]
发表于 2012-02-24 15:20 |只看该作者
把以上内容写到~/.vimrc内即可。

论坛徽章:
1
2015年迎新春徽章
日期:2015-03-04 09:58:11
4 [报告]
发表于 2012-02-24 16:06 |只看该作者
~/.vimrc

论坛徽章:
0
5 [报告]
发表于 2012-02-24 19:50 |只看该作者
回复 3# dooros


    谢谢哦   哈哈! 我试试!

论坛徽章:
0
6 [报告]
发表于 2012-02-24 20:01 |只看该作者
回复 2# dooros


    还是不好用。。。。

论坛徽章:
0
7 [报告]
发表于 2012-02-24 20:06 |只看该作者
回复 2# dooros


    额 好用了 但是最后两个 开启高亮和颜色设置不能用 提示有错误。。。

论坛徽章:
4
CU大牛徽章
日期:2013-03-13 15:29:07CU大牛徽章
日期:2013-03-13 15:29:49CU大牛徽章
日期:2013-03-13 15:30:192015年迎新春徽章
日期:2015-03-04 09:57:09
8 [报告]
发表于 2012-02-24 20:09 |只看该作者
提示什么错误?

论坛徽章:
0
9 [报告]
发表于 2012-02-24 21:05 |只看该作者
回复 8# dooros


    说是syntax on对此版本不适用
还有就是找不到colorscheme default

论坛徽章:
4
CU大牛徽章
日期:2013-03-13 15:29:07CU大牛徽章
日期:2013-03-13 15:29:49CU大牛徽章
日期:2013-03-13 15:30:192015年迎新春徽章
日期:2015-03-04 09:57:09
10 [报告]
发表于 2012-02-24 21:11 |只看该作者
不可能啊,你的说明文档里都有这句,肯定能用啊

if has("syntax")
  syntax on
endif
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP