鱼C论坛

 找回密码
 立即注册
查看: 2544|回复: 2

vim报错

[复制链接]
发表于 2019-5-3 19:26:45 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
本帖最后由 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行已经全部被注释掉了
  1. let $VIMRUNTIME="/usr/share/vim/vim81"
  2. set runtimepath=/usr/share/vim/vim81
  3. :set fileformat=unix
  4. source $VIMRUNTIME/vimrc_example.vim
  5. source $VIMRUNTIME/mswin.vim
  6. "behave mswin
  7. "set diffexpr=MyDiff()
  8. "function MyDiff()
  9. "  let opt = '-a --binary '
  10. "  if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
  11. "  if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
  12. "  let arg1 = v:fname_in
  13. "  if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif
  14. "  let arg2 = v:fname_new
  15. "  if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif
  16. "  let arg3 = v:fname_out
  17. "  if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif
  18. "  let eq = ''
  19. "  if $VIMRUNTIME =~ ' '
  20. "    if &sh =~ '\<cmd'
  21. "      let cmd = '""' . $VIMRUNTIME . '\diff"'
  22. "      let eq = '"'
  23. "    else
  24. "      let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"'
  25. "    endif
  26. "  else
  27. "    let cmd = $VIMRUNTIME . '\diff'
  28. "  endif
  29. "  silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq
  30. "endfunction
  31. set nu                                "设置 显示 行号
  32. "set nowrap                        "设置 不 自动换行
  33. set ruler
  34. set cindent
  35. set cursorline                                        "突出显示当前行
  36. set mouse=a                                                                " 在任何模式下启用鼠标
  37. set shortmess=atI                                                "去掉欢迎界面
  38. set showcmd
  39. set showmode
  40. set tabstop=4
  41. "set expandtab
  42. set autoindent
  43. set cmdheight=1                                                        "设置命令行的高度为2,默认为1
  44. set scrolloff=3
  45. set fenc=chinese
  46. set nocompatible
  47. set laststatus=2                                                "启用 状态栏 信息
  48. set shiftwidth=4                                                "换行时自动缩进宽度,可更改(宽度同tabstop)
  49. set softtabstop=4
  50. set encoding=utf-8                                                "设置gvim内部编码,默认不更改
  51. set backupcopy=yes
  52. nmap <cr> :MRU<cr>
  53. set enc=utf8
  54. set fencs=utf8,gbk,gb2312,gb18030,cp936
  55. set ignorecase smartcase
  56. set backspace=indent,eol,start
  57. set fileencodings=utf-8,chinese                        "设置支持打开的文件的编码
  58. set guifont=DejaVu\ Sans\ mono\ 11                "设置字体:字号(字体名称空格用下划线代替)
  59. colorscheme elflord                                                "Gvim配色方案
  60. "murphy,pablo,peachpuff,ron,torte,blue,darkblue,desert,elflord,industry,koehler
  61. syntax on
  62. syntax enable
  63. "if &term=="xterm"
  64.         "set t_Co=256                                                        "貌似 是 开启 256 色 支持,感觉 没 大用
  65. "        set t_Sb=^[[4%dm
  66. "        set t_Sf=^[[3%dm
  67. "endif

  68. source $VIMRUNTIME/delmenu.vim
  69. source $VIMRUNTIME/menu.vim
  70. language messages zh_CN.utf-8
  71. if has("win32")
  72. set fileencoding=chinese
  73. set termencoding=chinese
  74. else
  75. set fileencoding=utf-8
  76. endif

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

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

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

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

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

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

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

  98. " \v                  从公共剪贴板粘贴
  99. vmap <leader>v <ESC>"+p
  100. imap <leader>v <ESC>"+p
  101. nmap <leader>v "+p
  102. cmap <leader>v "+p

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

  122. " original repos on github (Github网站上非vim-scripts仓库的插件,按下面格式填写)
  123. Bundle 'tpope/vim-fugitive'
  124. Bundle 'Lokaltog/vim-easymotion'
  125. Bundle 'rstacruz/sparkup', {'rtp': 'vim/'}
  126. Bundle 'tpope/vim-rails.git'
  127. Bundle 'gmarik/vundle'
  128. " vim-scripts repos (vim-scripts仓库里的,按下面格式填写)
  129. Bundle 'L9'
  130. Bundle 'bash-support.vim'
  131. Bundle 'perl-support.vim'
  132. Bundle 'FuzzyFinder'
  133. " non github repos (非上面两种情况的,按下面格式填写)
  134. Bundle 'git://git.wincent.com/command-t.git'
  135. "filetype plugin on
  136. filetype indent on
  137. set lines=40 columns=34
  138. func! CompileGcc()
  139.     exec "w"
  140.     let compilecmd="!gcc "
  141.     let compileflag="-o %< "
  142.     if search("mpi\.h") != 0
  143.         let compilecmd = "!mpicc "
  144.     endif
  145.     if search("glut\.h") != 0
  146.         let compileflag .= " -lglut -lGLU -lGL "
  147.     endif
  148.     if search("cv\.h") != 0
  149.         let compileflag .= " -lcv -lhighgui -lcvaux "
  150.     endif
  151.     if search("omp\.h") != 0
  152.         let compileflag .= " -fopenmp "
  153.     endif
  154.     if search("math\.h") != 0
  155.         let compileflag .= " -lm "
  156.     endif
  157.     exec compilecmd." % ".compileflag
  158. endfunc
  159. func! CompileGpp()
  160.     exec "w"
  161.     let compilecmd="!g++ "
  162.     let compileflag="-o %< "
  163.     if search("mpi\.h") != 0
  164.         let compilecmd = "!mpic++ "
  165.     endif
  166.     if search("glut\.h") != 0
  167.         let compileflag .= " -lglut -lGLU -lGL "
  168.     endif
  169.     if search("cv\.h") != 0
  170.         let compileflag .= " -lcv -lhighgui -lcvaux "
  171.     endif
  172.     if search("omp\.h") != 0
  173.         let compileflag .= " -fopenmp "
  174.     endif
  175.     if search("math\.h") != 0
  176.         let compileflag .= " -lm "
  177.     endif
  178.     exec compilecmd." % ".compileflag
  179. endfunc

  180. func! RunPython()
  181.         exec "!python %"
  182. endfunc
  183. func! CompileJava()
  184.     exec "!javac %"
  185. endfunc


  186. func! CompileCode()
  187.         exec "w"
  188.         if &filetype == "cpp"
  189.                 exec "call CompileGpp()"
  190.         elseif &filetype == "c"
  191.                 exec "call CompileGcc()"
  192.         elseif &filetype == "python"
  193.                 exec "call RunPython()"
  194.         elseif &filetype == "java"
  195.                 exec "call CompileJava()"
  196.         endif
  197. endfunc

  198. func! RunResult()
  199.         exec "w"
  200.         if search("mpi\.h") != 0
  201.             exec "!mpirun -np 4 ./%<"
  202.         elseif &filetype == "cpp"
  203.             exec "! ./%<"
  204.         elseif &filetype == "c"
  205.             exec "! ./%<"
  206.         elseif &filetype == "python"
  207.             exec "call RunPython"
  208.         elseif &filetype == "java"
  209.             exec "!java %<"
  210.         endif
  211. endfunc

  212. map <F5> :call CompileCode()<CR>
  213. imap <F5> <ESC>:call CompileCode()<CR>
  214. vmap <F5> <ESC>:call CompileCode()<CR>
  215. "F5 编译
  216. map <F6> :call RunResult()<CR>
  217. "F6 运行
  218. :set cscopequickfix=s-,c-,d-,i-,t-,e-
  219. ":cs add $dev3/cscope.out $dev3
  220. set nocscopeverbose
  221. function! TabPos_ActivateBuffer(num)
  222.     let s:count = a:num
  223.     exe "tabfirst"
  224.     exe "tabnext" s:count
  225. endfunction
  226.       
  227. function! TabPos_Initialize()  
  228. for i in range(1, 9)
  229.         exe "map <M-" . i . "> :call TabPos_ActivateBuffer(" . i . ")<CR>"
  230.     endfor
  231.     exe "map <M-0> :call TabPos_ActivateBuffer(10)<CR>"
  232. endfunction

复制代码



小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

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

评分

参与人数 1荣誉 +2 鱼币 +2 收起 理由
dt3tc + 2 + 2

查看全部评分

小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

 楼主| 发表于 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了
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2025-5-29 05:51

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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