vim配置imrc 你们的配置是怎么样的啊?我只想知道语法高亮怎么配。

Vim、Emacs配置和使用
回复
头像
tencrance
帖子: 51
注册时间: 2010-06-04 14:58
联系:

vim配置imrc 你们的配置是怎么样的啊?我只想知道语法高亮怎么配。

#1

帖子 tencrance » 2012-03-19 22:53

RT:
我的配置是着样的:
1 :set hlsearch
2 :set backspace=2
3 :set autoindent
4 :set ruler
5 :set showmode
6 :set nu

但是语法不高高亮,请问怎么配啊,
系统是ubuntu 11.10 vi 是7.3.154的。
网上搜的一些是很早的配置,有些不是适应,我想看看你们的配置,能晒出来下看下吗?
或者帮我看下怎么配synatx
Life is not all beer and skittles.
头像
枫叶饭团
帖子: 14683
注册时间: 2010-06-16 1:05
系统: Mac OS X
来自: Tencent
联系:

Re: vim配置imrc 你们的配置是怎么样的啊?我只想知道语法高亮怎么配。

#2

帖子 枫叶饭团 » 2012-03-19 22:58

synatx on
头像
tencrance
帖子: 51
注册时间: 2010-06-04 14:58
联系:

Re: vim配置imrc 你们的配置是怎么样的啊?我只想知道语法高亮怎么配。

#3

帖子 tencrance » 2012-03-19 23:04

枫叶饭团 写了:synatx on
提示这样:
E492: Not an editor command: :synatx on
Press ENTER or type command to continue
Life is not all beer and skittles.
头像
枫叶饭团
帖子: 14683
注册时间: 2010-06-16 1:05
系统: Mac OS X
来自: Tencent
联系:

Re: vim配置imrc 你们的配置是怎么样的啊?我只想知道语法高亮怎么配。

#4

帖子 枫叶饭团 » 2012-03-19 23:13

反正近似这样子的,我ubuntu的配置拿到arch下也不高亮。。。
alanfly
帖子: 334
注册时间: 2007-12-19 16:15

Re: vim配置imrc 你们的配置是怎么样的啊?我只想知道语法高亮怎么配。

#5

帖子 alanfly » 2012-03-19 23:57

tencrance 写了:
枫叶饭团 写了:synatx on
提示这样:
E492: Not an editor command: :synatx on
Press ENTER or type command to continue
syntax on
aerofox
帖子: 1453
注册时间: 2008-05-24 8:30

Re: vim配置imrc 你们的配置是怎么样的啊?我只想知道语法高亮怎么配。

#6

帖子 aerofox » 2012-03-20 23:28

代码: 全选

set fileencodings=ucs-bom,utf-8,cp936,latin1

set ai
set sw=4
set ss=1
set siso=4
if has("gui_running")
    syn on
    set guifont=Bitstream\ Vera\ Sans\ Mono\ 11
endif
set hlsearch
set incsearch
set modeline
set mousefocus
set display=lastline
set cursorline

" -------------- For latex-suite ------------------- Begin ----------
" REQUIRED. This makes vim invoke Latex-Suite when you open a tex file.
filetype plugin on

" IMPORTANT: win32 users will need to have 'shellslash' set so that latex
" can be called correctly.
set shellslash

" IMPORTANT: grep will sometimes skip displaying the file name if you
" search in a singe file. This will confuse Latex-Suite. Set your grep
" program to always generate a file-name.
set grepprg=grep\ -nH\ $*

" OPTIONAL: This enables automatic indentation as you type.
filetype indent on

" OPTIONAL: Starting with Vim 7, the filetype of empty .tex files defaults to
" 'plaintex' instead of 'tex', which results in vim-latex not being loaded.
" The following changes the default filetype back to 'tex':
let g:tex_flavor='latex'
" -------------- For latex-suite -------------------- End -----------

let g:input_toggle = 1
function! Fcitx2en()
   let s:input_status = system("fcitx-remote")
   if s:input_status == 2
      let g:input_toggle = 1
      let l:a = system("fcitx-remote -c")
   endif
endfunction

function! Fcitx2zh()
   let s:input_status = system("fcitx-remote")
   if s:input_status != 2 && g:input_toggle == 1
      let l:a = system("fcitx-remote -o")
      let g:input_toggle = 0
   endif
endfunction

set timeoutlen=150
autocmd InsertLeave * call Fcitx2en()
autocmd InsertEnter * call Fcitx2zh()
头像
枫叶饭团
帖子: 14683
注册时间: 2010-06-16 1:05
系统: Mac OS X
来自: Tencent
联系:

Re: vim配置imrc 你们的配置是怎么样的啊?我只想知道语法高亮怎么配。

#7

帖子 枫叶饭团 » 2012-03-21 0:05

我英语没过四级π_π
头像
tencrance
帖子: 51
注册时间: 2010-06-04 14:58
联系:

Re: vim配置imrc 你们的配置是怎么样的啊?我只想知道语法高亮怎么配。

#8

帖子 tencrance » 2012-03-21 20:52

aerofox 写了:

代码: 全选

set fileencodings=ucs-bom,utf-8,cp936,latin1

set ai
set sw=4
set ss=1
set siso=4
if has("gui_running")
    syn on
    set guifont=Bitstream\ Vera\ Sans\ Mono\ 11
endif
set hlsearch
set incsearch
set modeline
set mousefocus
set display=lastline
set cursorline

" -------------- For latex-suite ------------------- Begin ----------
" REQUIRED. This makes vim invoke Latex-Suite when you open a tex file.
filetype plugin on

" IMPORTANT: win32 users will need to have 'shellslash' set so that latex
" can be called correctly.
set shellslash

" IMPORTANT: grep will sometimes skip displaying the file name if you
" search in a singe file. This will confuse Latex-Suite. Set your grep
" program to always generate a file-name.
set grepprg=grep\ -nH\ $*

" OPTIONAL: This enables automatic indentation as you type.
filetype indent on

" OPTIONAL: Starting with Vim 7, the filetype of empty .tex files defaults to
" 'plaintex' instead of 'tex', which results in vim-latex not being loaded.
" The following changes the default filetype back to 'tex':
let g:tex_flavor='latex'
" -------------- For latex-suite -------------------- End -----------

let g:input_toggle = 1
function! Fcitx2en()
   let s:input_status = system("fcitx-remote")
   if s:input_status == 2
      let g:input_toggle = 1
      let l:a = system("fcitx-remote -c")
   endif
endfunction

function! Fcitx2zh()
   let s:input_status = system("fcitx-remote")
   if s:input_status != 2 && g:input_toggle == 1
      let l:a = system("fcitx-remote -o")
      let g:input_toggle = 0
   endif
endfunction

set timeoutlen=150
autocmd InsertLeave * call Fcitx2en()
autocmd InsertEnter * call Fcitx2zh()
thanks,我研究下~``
Life is not all beer and skittles.
chenxing
帖子: 152
注册时间: 2006-01-03 18:23
联系:

Re: vim配置imrc 你们的配置是怎么样的啊?我只想知道语法高亮怎么配。

#9

帖子 chenxing » 2012-03-21 23:48

配置文件里不要用冒号开头。。

建议参考下文配置:
http://linux-wiki.cn/wiki/%E7%94%A8Vim% ... 0%E5%B7%A7
以Wiki模式创建中文Linux文档,欢迎加入 http://linux-wiki.cn
回复