当前时区为 UTC + 8 小时



发表新帖 回复这个主题  [ 6 篇帖子 ] 
作者 内容
1 楼 
 文章标题 : some vim function error in BackTrack4
帖子发表于 : 2010-12-14 18:20 
头像

注册: 2010-03-16 12:34
帖子: 107
送出感谢: 0 次
接收感谢: 0 次
代码:
mybe my contents is too long, but i do not which part should i paste. you can paste vimrc into a file and open with a editor so that you can see the line number.

代码:
here is my vimrc


"Author: Roy L Zuo (roylzuo at gmail dot com)
"Description: vim runtime configure file
"source $VIMRUNTIME/vimrc_example.vim
" vim: ft=vim

set nocompatible " not vi compatible
set mouse="" " disable mouse
filetype plugin indent on
filetype plugin on

set history=50 " keep 50 lines of command line history
" keep record of editing information for cursor restore and more
set viminfo='10,\"100,:20,%,n~/.viminfo

" do incremental searching
set incsearch hlsearch wrapscan
set ignorecase smartcase

set showmatch " show the matching brackets when typing

set showcmd " display incomplete commands
set ruler " show the cursor position all the time in statusline
set laststatus=2 " always display a nicer status bar
set statusline=%<%h%m%r\ %f%=[%{&filetype},%{&fileencoding},%{&fileformat}]%k\ %-14.(%l/%L,%c%V%)\ %P
set wildmenu " show possible command when pressing <TAB>
"set cmdheight=2
set notitle " do not set xterm dynamic title
set number

set matchtime=5

set lazyredraw " faster for macros

set guifont=Monaco\ 10
set guifontwide=WenQuanYi\ Micro\ Hei\ 12
set guioptions-=T
set guioptions-=r

set smartindent autoindent
set expandtab
set shiftwidth=4
set tabstop=4 " set tab with 4 blank
set softtabstop=4 " replace <tab> with 4 blank space.
set textwidth=80 " wrap text for 78 letters
set smarttab

map Q gq
set wrap
set whichwrap=b,s,<,>,[,],h,l
set linebreak " no breakline in the middle of a word

set formatprg=fmt
"set formatoptions+=mM " default tcq, mM to help wrap chinese

set backup
set backupdir=$HOME/.backup

set commentstring=#%s " default comment style
set sps=best,10 " only show 10 best spell suggestions
set dictionary+=/usr/share/dict/words

set magic

" 输入:set list命令是应该显示些啥?
"set listchars=tab:>-,eol:<
set listchars=nbsp:¬,eol:¶,tab:>-,extends:»,precedes:«,trail:•

" 光标移动到buffer的顶部和底部时保持3行距离
set scrolloff=3

"dynamic cursor color for xterm \033=>\e 007=>\a (BEL)
if &term =~ "xterm"
:silent !echo -ne "\e]12;IndianRed2\007"
let &t_SI = "\e]12;RoyalBlue1\007"
let &t_EI = "\e]12;IndianRed2\007"
autocmd VimLeave * :!echo -ne "\e]12;green\007"
"elseif &term =~ "screen" " screen in urxvt or xterm
":silent !echo -ne "\eP\e]12;IndianRed2\007\e\\"
"let &t_SI = "\eP\e]12;RoyalBlue1\007\e\\"
"let &t_EI = "\eP\e]12;IndianRed2\007\e\\"
"autocmd VimLeave * :!echo -ne "\eP\e]12;green\007\e\\"
endif

let fortran_have_tabs=1 " this line must be placed before syntax on
let fortran_fold=1

" fold function
set foldenable
set foldmethod=syntax
set foldnestmax=1
set foldlevel=100
" if you set foldlevel=1, vim will fold with syntax when you open vim

set background=dark

syntax on
syntax enable
"maybe necessary for urxvt, because vim use ^H for backspace,
"but urxvt can use both ^H and ^?
"fixdel

"if has 256 colour, use a 256 colour theme
if $TERM =~ '^xterm' || $TERM =~ '^screen' || has("gui_running")
if !has("gui_running")
set t_Co=256
endif
"colorscheme molokai_transparent
colorscheme molokai
"colorscheme ir_black
else
"colorscheme tango
"colorscheme molokai
"colorscheme molokai_transparent
colorscheme ir_black
endif

" 高亮当前行
"set cursorline
"set cursorcolumn
autocmd InsertLeave * set nocursorline
autocmd InsertEnter * set cursorline

"---------------------encoding detection--------------------------------
"set encoding& " terminal charset: follows current locale
"set termencoding=
"set fileencodings-=latin1
"set fileencoding& " auto-sensed charset of current buffer
"function GetEncoding(f) "automatic update encoding
"let e = system('enca -L none -Pm "' . a:f . '"')
"let e = substitute(e, '/.*', '', '')
"if e =~ 'unknown'
"return 'utf-8'
"endif
"return e
"endfunc

"autocmd BufReadPre *
"\exec "set fileencodings+=" . GetEncoding(expand('<afile>'))

set encoding=utf-8
set fileencoding&
set fileencodings=ucs-bom,utf-8,enc-cn,cp936,gbk,latin1
"---------------------completion settings-------------------------------
"make completion menu usable even when some characters are typed.
set completeopt=longest,menuone
"inoremap <expr> <cr> pumvisible() ? "\<c-y>" : "\<c-g>u\<cr>"
"inoremap <expr> <c-n> pumvisible() ?
"\"\<c-n>" : "\<c-n>\<c-r>=pumvisible() ? \"\\<down>\" : \"\\<cr>\""
"inoremap <expr> <m-;> pumvisible() ?
"\"\<c-n>" : "\<c-x>\<c-o>\<c-n>\<c-p>\<c-r>=pumvisible() ?
"\\"\\<down>\" : \"\\<cr>\""
"---------------------keyboard mappings---------------------------------
set winaltkeys=no

"ascii art escape sequence for /etc/motd, ssh banner and etc
imap ,e <C-V><C-[>[

"move among windows
nmap <C-h> <C-W>h
nmap <C-l> <C-W>l
nmap <C-j> <C-W>j
nmap <C-k> <C-W>k

"move in insert mode
inoremap <m-h> <left>
inoremap <m-l> <Right>
inoremap <m-j> <C-o>gj
inoremap <m-k> <C-o>gk

" search for visual-mode selected text
vmap / y/<C-R>"<CR>

" taglist.vim
let g:Tlist_GainFocus_On_ToggleOpen=1
let g:Tlist_Exit_OnlyWindow=1
"let g:Tlist_Use_Right_Window=1
let g:Tlist_Show_One_File=1
let g:Tlist_Enable_Fold_Column=0
let g:Tlist_Auto_Update=1
"nmap <F2> :TlistToggle<CR>

" NERDtree
nmap <F3> :NERDTreeToggle<CR>

"insert time stamp in insert mode
inoremap <F5> <C-R>=strftime("%Y-%m-%d %T %Z")<CR>

"Make and make test
nmap <F5> :w<CR>:make<CR>
nmap <F6> :make test<CR>

" NERO_comment.vim
let g:NERDShutUp=1
nmap <F9> ,c<SPACE>
vmap <F9> ,c<SPACE>

" tab navigation
nmap tp :tabprevious<cr>
nmap tn :tabnext<cr>
nmap to :tabnew<cr>
nmap tc :tabclose<cr>
nmap gf <C-W>gf

"Auomatically add file head. NERO_commenter.vim needed.
function! AutoHead()
let fl = line(".")
if getline(fl) !~ "^$"
let fl += 1
endif
let ll = fl+2
call setline(fl,"mail: (numbchild at gmail dot com)")
call append(fl,"Notice: you can not use my file without my permit !")
call append(fl+1,"Description: ")
execute fl . ','. ll .'call NERDComment(0,"toggle")'
endfunc
nmap ,h :call AutoHead()<cr>

let g:timestamp_regexp = '\v\C%(<Last %([cC]hanged?|[Mm]odified):\s+)@<=.*$'

"--------------------------file type settings---------------------------
"tags
"use semicolon to seperate so that vim searches parent directories!
set tags=tags;
set tags=/home/stardiviner/.vim/tags

"Python
"autocmd Filetype python setlocal omnifunc=pythoncomplete#Complete
autocmd BufNewFile *.py
\0put=\"#!/usr/bin/env python\<nl># -*- coding: UTF-8 -*-\<nl>\"
\|call AutoHead()
autocmd FileType python set omnifunc=pythoncomplete#Complete

"ruby
autocmd BufNewFile *.rb 0put=\"#!/usr/bin/env ruby\<nl># coding: utf-8\<nl>\" |call AutoHead()
"autocmd FileType ruby set omnifunc=rubycomplete#Complete

"C/C++
autocmd FileType cpp setlocal nofoldenable
\|nmap ,a :A<CR>
autocmd FileType c setlocal cindent

"Fortran
"autocmd FileType fortran let b:fortran_free_source = 1

"Txt, set syntax file and spell check
"autocmd BufRead,BufNewFile *.txt set filetype=txt
"autocmd BufRead *.txt setlocal spell spelllang=en_gb

"Tex ''spelllang=en_gb
"let g:tex_flavor="context"
autocmd FileType tex,plaintex,context
\|silent set spell
\|nmap <buffer> <F8> gwap

" shell script
autocmd BufNewFile *.sh 0put=\"#!/bin/bash\<nl># author: chris\<nl>\" |call AutoHead()

"Gnuplot
autocmd BufNewFile *.gpi 0put='#!/usr/bin/gnuplot -persist' |call AutoHead()

"emails,
"delete old quotations, set spell and put cursor in the first line
autocmd FileType mail
\|:silent set spell
"\|:silent 0put=''
"\|:silent 0put=''
\|:silent g/^.*>\sOn.*wrote:\s*$\|^>\s*>.*$/de
"\|:silent %s/^\s*>\s*--\_.\{-\}\_^\s*\_$//ge
\|:silent 1

"openGL shading language (glsl)
au BufNewFile,BufRead *.frag,*.vert,*.fp,*.vp,*.glsl setf glsl

"cuda
au BufNewFile,BufRead *.cu set ft=cuda |setlocal cindent

"markdown
autocmd BufNewFile,BufRead *.mkd,*.mdown set ft=mkd comments=n:> nu nospell textwidth=0

"RestructuredText
autocmd BufNewFile,BufRead *.rst set ft=rest ai formatoptions=tcroqn2

"viki
autocmd BufNewFile,BufRead *.viki set ft=viki

"fcron
autocmd BufNewFile,BufRead /tmp/fcr-* set ft=crontab

"bbcode
autocmd BufNewFile,BufRead /tmp/*forum.ubuntu.org.cn* set ft=bbcode

"remind
autocmd BufNewFile,BufRead *.rem set ft=remind
"-------------------special settings------------------------------------
"big files?
let g:LargeFile = 0.3 "in megabyte
augroup LargeFile
au!
au BufReadPre *
\let f=expand("<afile>")
\|if getfsize(f) >= g:LargeFile*1023*1024 || getfsize(f) <= -2
\|let b:eikeep = &ei
\|let b:ulkeep = &ul
\|let b:bhkeep = &bh
\|let b:fdmkeep= &fdm
\|let b:swfkeep= &swf
\|set ei=FileType
\|setlocal noswf bh=unload fdm=manual
\|let f=escape(substitute(f,'\','/','g'),' ')
\|exe "au LargeFile BufEnter ".f." set ul=-1"
\|exe "au LargeFile BufLeave ".f." let &ul=".b:ulkeep."|set ei=".b:eikeep
\|exe "au LargeFile BufUnload ".f." au! LargeFile * ". f
\|echomsg "***note*** handling a large file"
\|endif
au BufReadPost *
\if &ch < 2 && getfsize(expand("<afile>")) >= g:LargeFile*1024*1024
\|echomsg "***note*** handling a large file"
\|endif
augroup END

"Restore cursor to file position in previous editing session
autocmd BufReadPost *
\if line("'\"") > 0 && line("'\"") <= line("$")
\|exe "normal g`\""
\|endif

"warn long lines
"au BufWinEnter * let w:m2=matchadd('ErrorMsg', '\%>' . &textwidth . 'v.\+', -1)

" cscope
set cscopequickfix=s-,c-,d-,i-,t-,e-

" MiniBufExplore
let g:miniBufExplMapWindowNavVim = 1
let g:miniBufExplMapWindowNavArrows = 1
let g:miniBufExplMapCTabSwitchBufs = 1
let g:miniBufExplModSelTarget = 1

" SuperTab.vim
" this setting will let press Tab but press <C-x><C-o>
" the default auto complete is <C-p>, now change into <C-x><C-o>
let g:SuperTabRetainCompletionType=2
let g:SuperTabDefaultCompletionType="<C-X><C-O>"

" cursorline current lline hilight
set cursorline
hi Cursorline cterm=NONE ctermbg=red ctermfg=white guibg=darkred guifg=white
hi CursorColumn cterm=NONE ctermbg=red ctermfg=white guibg=darkred guifg=white


代码:
 here is my vim output errors


Error detected while processing /home/chris/.vimrc:
line 8:
E319: Sorry, the command is not available in this version: filetype plugin indent on
line 9:
E319: Sorry, the command is not available in this version: filetype plugin on
line 84:
E319: Sorry, the command is not available in this version: let fortran_have_tabs=1^I " this line must be placed before syntax on
line 85:
E319: Sorry, the command is not available in this version: let fortran_fold=1
line 88:
E518: Unknown option: foldenable
line 89:
E518: Unknown option: foldmethod=syntax
line 90:
E518: Unknown option: foldnestmax=1
line 91:
E518: Unknown option: foldlevel=100
line 96:
E319: Sorry, the command is not available in this version: syntax on
line 97:
E319: Sorry, the command is not available in this version: syntax enable
line 120:
E319: Sorry, the command is not available in this version: autocmd InsertLeave * set nocursorline
line 121:
E319: Sorry, the command is not available in this version: autocmd InsertEnter * set cursorline
line 174:
E319: Sorry, the command is not available in this version: let g:Tlist_GainFocus_On_ToggleOpen=1
line 175:
E319: Sorry, the command is not available in this version: let g:Tlist_Exit_OnlyWindow=1
line 177:
E319: Sorry, the command is not available in this version: let g:Tlist_Show_One_File=1
line 178:
E319: Sorry, the command is not available in this version: let g:Tlist_Enable_Fold_Column=0
line 179:
E319: Sorry, the command is not available in this version: let g:Tlist_Auto_Update=1
line 193:
E319: Sorry, the command is not available in this version: let g:NERDShutUp=1
line 205:
E319: Sorry, the command is not available in this version: function! AutoHead()
line 206:
E319: Sorry, the command is not available in this version: let fl = line(".")
line 210:
E319: Sorry, the command is not available in this version: let ll = fl+2
line 211:
E319: Sorry, the command is not available in this version: call setline(fl,"mail: (numbchild at gmail dot com)")
line 212:
E319: Sorry, the command is not available in this version: call append(fl,"Notice: you can not use my file without my permit !")
line 213:
E319: Sorry, the command is not available in this version: call append(fl+1,"Description: ")
line 214:
E319: Sorry, the command is not available in this version: execute fl . ','. ll .'call NERDComment(0,"toggle")'
line 215:
E319: Sorry, the command is not available in this version: endfunc
line 218:
E319: Sorry, the command is not available in this version: let g:timestamp_regexp = '\v\C%(<Last %([cC]hanged?|[Mm]odified):\s+)@<=.*$'
line 230:
E319: Sorry, the command is not available in this version: autocmd BufNewFile *.py 0put=\"#!/usr/bin/env python\<nl># -*- coding: UTF-8 -*-\<nl>\" |call AutoHead()
line 231:
E319: Sorry, the command is not available in this version: autocmd FileType python set omnifunc=pythoncomplete#Complete
line 234:
E319: Sorry, the command is not available in this version: autocmd BufNewFile *.rb 0put=\"#!/usr/bin/env ruby\<nl># coding: utf-8\<nl>\" |call AutoHead()
line 239:
E319: Sorry, the command is not available in this version: autocmd FileType cpp setlocal nofoldenable|nmap ,a :A<CR>
line 240:
E319: Sorry, the command is not available in this version: autocmd FileType c setlocal cindent
line 253:
E319: Sorry, the command is not available in this version: autocmd FileType tex,plaintex,context|silent set spell|nmap <buffer> <F8> gwap^I
line 256:
E319: Sorry, the command is not available in this version: autocmd BufNewFile *.sh 0put=\"#!/bin/bash\<nl># author: chris\<nl>\" |call AutoHead()
line 259:
E319: Sorry, the command is not available in this version: autocmd BufNewFile *.gpi 0put='#!/usr/bin/gnuplot -persist' |call AutoHead()
line 264:
E319: Sorry, the command is not available in this version: autocmd FileType mail |:silent set spell
line 272:
E319: Sorry, the command is not available in this version: au BufNewFile,BufRead *.frag,*.vert,*.fp,*.vp,*.glsl setf glsl
line 275:
E319: Sorry, the command is not available in this version: au BufNewFile,BufRead *.cu set ft=cuda |setlocal cindent
line 278:
E319: Sorry, the command is not available in this version: autocmd BufNewFile,BufRead *.mkd,*.mdown set ft=mkd comments=n:> nu nospell textwidth=0
line 281:
E319: Sorry, the command is not available in this version: autocmd BufNewFile,BufRead *.rst set ft=rest ai formatoptions=tcroqn2
line 284:
E319: Sorry, the command is not available in this version: autocmd BufNewFile,BufRead *.viki set ft=viki
line 287:
E319: Sorry, the command is not available in this version: autocmd BufNewFile,BufRead /tmp/fcr-* set ft=crontab
line 290:
E319: Sorry, the command is not available in this version: autocmd BufNewFile,BufRead /tmp/*forum.ubuntu.org.cn* set ft=bbcode
line 293:
E319: Sorry, the command is not available in this version: autocmd BufNewFile,BufRead *.rem set ft=remind
line 296:
E319: Sorry, the command is not available in this version: let g:LargeFile = 0.3^I"in megabyte
line 297:
E319: Sorry, the command is not available in this version: augroup LargeFile
line 298:
E319: Sorry, the command is not available in this version: au!
line 314:
E319: Sorry, the command is not available in this version: au BufReadPre *let f=expand("<afile>")|if getfsize(f) >= g:LargeFile*1023*1024 || getfsize(f) <= -2|let b:eikeep = &ei|let b:ulkeep = &ul|let b:bhkeep = &bh|let b:fdmkeep= &fdm|let b:swfkeep= &swf|set ei=FileType|setlocal noswf bh=unload fdm=manual|let f=escape(substitute(f,'\','/','g'),' ')|exe "au LargeFile BufEnter ".f." set ul=-1"|exe "au LargeFile BufLeave ".f." let &ul=".b:ulkeep."|set ei=".b:eikeep|exe "au LargeFile BufUnload ".f." au! LargeFile * ". f|echomsg "***note*** handling a large file"|endif
line 318:
E319: Sorry, the command is not available in this version: au BufReadPost *if &ch < 2 && getfsize(expand("<afile>")) >= g:LargeFile*1024*1024|echomsg "***note*** handling a large file"|endif
line 319:
E319: Sorry, the command is not available in this version: augroup END
line 325:
E319: Sorry, the command is not available in this version: autocmd BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") |exe "normal g`\"" |endif
line 334:
E319: Sorry, the command is not available in this version: let g:miniBufExplMapWindowNavVim = 1
line 335:
E319: Sorry, the command is not available in this version: let g:miniBufExplMapWindowNavArrows = 1
line 336:
E319: Sorry, the command is not available in this version: let g:miniBufExplMapCTabSwitchBufs = 1
line 337:
E319: Sorry, the command is not available in this version: let g:miniBufExplModSelTarget = 1
line 342:
E319: Sorry, the command is not available in this version: let g:SuperTabRetainCompletionType=2
line 343:
E319: Sorry, the command is not available in this version: let g:SuperTabDefaultCompletionType="<C-X><C-O>"
Press ENTER or type command to continue


_________________
My Blog: http://stardiviner.tumblr.com/


页首
 用户资料  
 
2 楼 
 文章标题 : Re: some vim function error in BackTrack4
帖子发表于 : 2010-12-14 19:42 
头像

注册: 2009-04-11 23:46
帖子: 4131
系统: Arch Linux
送出感谢: 11
接收感谢: 124
Your vim does not support many of the commands in your vimrc. Try install vim-gnome or vim-gtk (which is a 'huge' version). If the problem still exists, paste the output of 'vim --version' here.

BTW: PLEASE enclose your code with the 'code' tag.


_________________
我的博客 https://blog.lilydjwg.me/
提问的智慧
Arch Linux 中文论坛

我的vimrc: https://git.io/vimrc


页首
 用户资料  
 
3 楼 
 文章标题 : Re: some vim function error in BackTrack4
帖子发表于 : 2010-12-14 20:00 

注册: 2010-05-04 14:12
帖子: 435
送出感谢: 0 次
接收感谢: 0 次
传说中的bt4?我就是一直没法和Ubuntu一起安装成功!楼上的都是英语高手啊!神马也没听懂!


_________________
只为能打造个能适合自己的ubuntu!


页首
 用户资料  
 
4 楼 
 文章标题 : Re: some vim function error in BackTrack4
帖子发表于 : 2010-12-14 20:41 
头像

注册: 2010-03-16 12:34
帖子: 107
送出感谢: 0 次
接收感谢: 0 次
lilydjwg 写道:
Your vim does not support many of the commands in your vimrc. Try install vim-gnome or vim-gtk (which is a 'huge' version). If the problem still exists, paste the output of 'vim --version' here.

BTW: PLEASE enclose your code with the 'code' tag.


i do one job similar with your concept, it works. thanx


_________________
My Blog: http://stardiviner.tumblr.com/


页首
 用户资料  
 
5 楼 
 文章标题 : Re: some vim function error in BackTrack4
帖子发表于 : 2010-12-14 21:48 
头像

注册: 2010-08-27 15:53
帖子: 803
送出感谢: 0 次
接收感谢: 1
BT4也来了啊,这个站被各个发行版来踩场呢,呵呵

可惜vim也没玩好,怎么玩bt4啊,,,很怀疑


_________________
基础问题,请看入门手册http://people.ubuntu.com/~happyaron/udc-cn/lucid-html/

Acer aspire 4736G / Ubuntu 10.04LTS
Asus eeepc900 / Xandros
Nokia N900 / Maemo 1.2.12


页首
 用户资料  
 
6 楼 
 文章标题 : Re: some vim function error in BackTrack4
帖子发表于 : 2011-10-20 20:24 
头像

注册: 2008-12-28 16:01
帖子: 728
送出感谢: 2
接收感谢: 15
我找bbcode居然找到了这里。

顺便跟楼主说下,vim脚本放在vim标签里面,就像这个
[vim]
set nocompatible " not vi compatible
set mouse="" " disable mouse
filetype plugin indent on
filetype plugin on

set history=50 " keep 50 lines of command line history
" keep record of editing information for cursor restore and more
set viminfo='10,\"100,:20,%,n~/.viminfo

" do incremental searching
set incsearch hlsearch wrapscan
set ignorecase smartcase
[/vim]


_________________
爱因斯坦会弹钢琴
爱因斯坦会拉小提琴
爱因斯坦会骑自行车


页首
 用户资料  
 
显示帖子 :  排序  
发表新帖 回复这个主题  [ 6 篇帖子 ] 

当前时区为 UTC + 8 小时


在线用户

正在浏览此版面的用户:没有注册用户 和 5 位游客


不能 在这个版面发表主题
不能 在这个版面回复主题
不能 在这个版面编辑帖子
不能 在这个版面删除帖子
不能 在这个版面提交附件

前往 :  
本站点为公益性站点,用于推广开源自由软件,由 DiaHosting VPSBudgetVM VPS 提供服务。
我们认为:软件应可免费取得,软件工具在各种语言环境下皆可使用,且不会有任何功能上的差异;
人们应有定制和修改软件的自由,且方式不受限制,只要他们自认为合适。

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
简体中文语系由 王笑宇 翻译