dt3tc 发表于 2019-5-3 19:26:45

vim报错

本帖最后由 dt3tc 于 2019-5-4 07:08 编辑

vim 启动时报错:
Not an editor command:tlnumenu *
以tlnumenu为关键字在 软件包仓库 搜索 未果.
Google 未果
发行版 Calculate Linux 18.12-x86_64
vim 8.1

谢谢

补充:
这个错误对应的行号为8,但是从第6行到第30行已经全部被注释掉了
let $VIMRUNTIME="/usr/share/vim/vim81"
set runtimepath=/usr/share/vim/vim81
:set fileformat=unix
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
"behave mswin
"set diffexpr=MyDiff()
"function MyDiff()
"let opt = '-a --binary '
"if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
"if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
"let arg1 = v:fname_in
"if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif
"let arg2 = v:fname_new
"if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif
"let arg3 = v:fname_out
"if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif
"let eq = ''
"if $VIMRUNTIME =~ ' '
"    if &sh =~ '\<cmd'
"      let cmd = '""' . $VIMRUNTIME . '\diff"'
"      let eq = '"'
"    else
"      let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"'
"    endif
"else
"    let cmd = $VIMRUNTIME . '\diff'
"endif
"silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq
"endfunction
set nu                                "设置 显示 行号
"set nowrap                        "设置 不 自动换行
set ruler
set cindent
set cursorline                                        "突出显示当前行
set mouse=a                                                                " 在任何模式下启用鼠标
set shortmess=atI                                                "去掉欢迎界面
set showcmd
set showmode
set tabstop=4
"set expandtab
set autoindent
set cmdheight=1                                                        "设置命令行的高度为2,默认为1
set scrolloff=3
set fenc=chinese
set nocompatible
set laststatus=2                                                "启用 状态栏 信息
set shiftwidth=4                                                "换行时自动缩进宽度,可更改(宽度同tabstop)
set softtabstop=4
set encoding=utf-8                                                "设置gvim内部编码,默认不更改
set backupcopy=yes
nmap <cr> :MRU<cr>
set enc=utf8
set fencs=utf8,gbk,gb2312,gb18030,cp936
set ignorecase smartcase
set backspace=indent,eol,start
set fileencodings=utf-8,chinese                        "设置支持打开的文件的编码
set guifont=DejaVu\ Sans\ mono\ 11                "设置字体:字号(字体名称空格用下划线代替)
colorscheme elflord                                                "Gvim配色方案
"murphy,pablo,peachpuff,ron,torte,blue,darkblue,desert,elflord,industry,koehler
syntax on
syntax enable
"if &term=="xterm"
        "set t_Co=256                                                        "貌似 是 开启 256 色 支持,感觉 没 大用
"        set t_Sb=^[[4%dm
"        set t_Sf=^[[3%dm
"endif

source $VIMRUNTIME/delmenu.vim
source $VIMRUNTIME/menu.vim
language messages zh_CN.utf-8
if has("win32")
set fileencoding=chinese
set termencoding=chinese
else
set fileencoding=utf-8
endif

" Ctrl + H            光标移当前行行首
"imap <c-h> <ESC>I

" Ctrl + J            光标移下一行行首
imap <c-j> <ESC><Down>I

" Ctrl + K            光标移上一行行尾
imap <c-k> <ESC><Up>A

" Ctrl + L            光标移当前行行尾
imap <c-l> <ESC>A

" \s                  复制 选中内容 至公共剪贴板
vmap <leader>s <ESC>"+y
imap <leader>s <ESC>"+y
nmap <leader>s "+y

" \l                  复制 当前行 至公共剪贴板
vmap <leader>l <ESC>V"+y
imap <leader>l <ESC>V"+y
nmap <leader>l V"+y

" \a                  复制所有至公共剪贴板
vmap <leader>a <ESC>ggvG"+y
imap <leader>a <ESC>ggvG"+y
nmap <leader>a ggvG"+y
cmap <leader>a ggvG"+y

" \v                  从公共剪贴板粘贴
vmap <leader>v <ESC>"+p
imap <leader>v <ESC>"+p
nmap <leader>v "+p
cmap <leader>v "+p

set encoding=utf-8 fileencodings=ucs-bom,utf-8,cp936
set keywordprg=sdcv
"Toggle Menu and Toolbar
set guioptions-=m
set guioptions-=T
map <silent> <F2> :if &guioptions =~# 'T' <Bar>
      \set guioptions-=T <Bar>
      \set guioptions-=m <bar>
    \else <Bar>
      \set guioptions =T <Bar>
      \set guioptions =m <Bar>
    \endif<CR>
"c 语言 当前 行 为 // 风格 注释 时不 自动 注释 下一行
autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
" For vundle
set nocompatible
filetype off
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()

" original repos on github (Github网站上非vim-scripts仓库的插件,按下面格式填写)
Bundle 'tpope/vim-fugitive'
Bundle 'Lokaltog/vim-easymotion'
Bundle 'rstacruz/sparkup', {'rtp': 'vim/'}
Bundle 'tpope/vim-rails.git'
Bundle 'gmarik/vundle'
" vim-scripts repos (vim-scripts仓库里的,按下面格式填写)
Bundle 'L9'
Bundle 'bash-support.vim'
Bundle 'perl-support.vim'
Bundle 'FuzzyFinder'
" non github repos (非上面两种情况的,按下面格式填写)
Bundle 'git://git.wincent.com/command-t.git'
"filetype plugin on
filetype indent on
set lines=40 columns=34
func! CompileGcc()
    exec "w"
    let compilecmd="!gcc "
    let compileflag="-o %< "
    if search("mpi\.h") != 0
      let compilecmd = "!mpicc "
    endif
    if search("glut\.h") != 0
      let compileflag .= " -lglut -lGLU -lGL "
    endif
    if search("cv\.h") != 0
      let compileflag .= " -lcv -lhighgui -lcvaux "
    endif
    if search("omp\.h") != 0
      let compileflag .= " -fopenmp "
    endif
    if search("math\.h") != 0
      let compileflag .= " -lm "
    endif
    exec compilecmd." % ".compileflag
endfunc
func! CompileGpp()
    exec "w"
    let compilecmd="!g++ "
    let compileflag="-o %< "
    if search("mpi\.h") != 0
      let compilecmd = "!mpic++ "
    endif
    if search("glut\.h") != 0
      let compileflag .= " -lglut -lGLU -lGL "
    endif
    if search("cv\.h") != 0
      let compileflag .= " -lcv -lhighgui -lcvaux "
    endif
    if search("omp\.h") != 0
      let compileflag .= " -fopenmp "
    endif
    if search("math\.h") != 0
      let compileflag .= " -lm "
    endif
    exec compilecmd." % ".compileflag
endfunc

func! RunPython()
      exec "!python %"
endfunc
func! CompileJava()
    exec "!javac %"
endfunc


func! CompileCode()
      exec "w"
      if &filetype == "cpp"
                exec "call CompileGpp()"
      elseif &filetype == "c"
                exec "call CompileGcc()"
      elseif &filetype == "python"
                exec "call RunPython()"
      elseif &filetype == "java"
                exec "call CompileJava()"
      endif
endfunc

func! RunResult()
      exec "w"
      if search("mpi\.h") != 0
            exec "!mpirun -np 4 ./%<"
      elseif &filetype == "cpp"
            exec "! ./%<"
      elseif &filetype == "c"
            exec "! ./%<"
      elseif &filetype == "python"
            exec "call RunPython"
      elseif &filetype == "java"
            exec "!java %<"
      endif
endfunc

map <F5> :call CompileCode()<CR>
imap <F5> <ESC>:call CompileCode()<CR>
vmap <F5> <ESC>:call CompileCode()<CR>
"F5 编译
map <F6> :call RunResult()<CR>
"F6 运行
:set cscopequickfix=s-,c-,d-,i-,t-,e-
":cs add $dev3/cscope.out $dev3
set nocscopeverbose
function! TabPos_ActivateBuffer(num)
    let s:count = a:num
    exe "tabfirst"
    exe "tabnext" s:count
endfunction
      
function! TabPos_Initialize()
for i in range(1, 9)
      exe "map <M-" . i . "> :call TabPos_ActivateBuffer(" . i . ")<CR>"
    endfor
    exe "map <M-0> :call TabPos_ActivateBuffer(10)<CR>"
endfunction




jackz007 发表于 2019-5-3 20:49:14

       vim 涉及到的配置文件包括 /root/.vimrc 和 $HOME/.vimrc,启动 vim 的时候,会使用这 2 个文件来进行环境定制和配置。两个文件中,后者完全来自用户,不是很重要,完全可以删除,楼主可以看看这 2 个文件是否存在,如果后者存在,可以试着将其重命名看看是否有效果。

dt3tc 发表于 2019-5-4 06:57:32

本帖最后由 dt3tc 于 2019-5-4 07:10 编辑

jackz007 发表于 2019-5-3 20:49
vim 涉及到的配置文件包括 /root/.vimrc 和 $HOME/.vimrc,启动 vim 的时候,会使用这 2 个文件来进 ...

这样有效是没错,但是其他的自定义设置也同时没了
ps:
我把完整的vimrc文件发到1L了
页: [1]
查看完整版本: vim报错