最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

[无需解决]source /etc/vimrc出错:/etc/vimrc:65: unmatched ‘

Linux crifan 6593浏览 0评论

折腾:

[基本解决]vi中tab默认为8个空格

期间,

想要使得vim的配置生效:

source /etc/vimrc

结果出错:

 SIPEvents source /etc/vimrc 

/etc/vimrc:65: unmatched ‘

但是去看其中内容,又好像没问题:

 SIPEvents cat /etc/vimrc 
if v:lang =~ “utf8$” || v:lang =~ “UTF-8$”
   set fileencodings=ucs-bom,utf-8,latin1
endif
set nocompatible        ” Use Vim defaults (much better!)
set bs=indent,eol,start         ” allow backspacing over everything in insert mode
“set ai                 ” always set autoindenting on
“set backup             ” keep a backup file
set viminfo=’20,\”50    ” read/write a .viminfo file, don’t store more
                        ” than 50 lines of registers
set history=50          ” keep 50 lines of command line history
set ruler               ” show the cursor position all the time
” Only do this part when compiled with support for autocommands
if has(“autocmd”)
  augroup redhat
  autocmd!
  ” In text files, always limit the width of text to 78 characters
  ” autocmd BufRead *.txt set tw=78
  ” When editing a file, always jump to the last cursor position
  autocmd BufReadPost *
  \ if line(“‘\””) > 0 && line (“‘\””) <= line(“$”) |
  \   exe “normal! g’\”” |
  \ endif
  ” don’t write swapfile on most commonly used directories for NFS mounts or USB sticks
  autocmd BufNewFile,BufReadPre /media/*,/run/media/*,/mnt/* set directory=~/tmp,/var/tmp,/tmp
  ” start with spec file template
  autocmd BufNewFile *.spec 0r /usr/share/vim/vimfiles/template.spec
  augroup END
endif
if has(“cscope”) && filereadable(“/usr/bin/cscope”)
   set csprg=/usr/bin/cscope
   set csto=0
   set cst
   set nocsverb
   ” add any database in current directory
   if filereadable(“cscope.out”)
      cs add $PWD/cscope.out
   ” else add database pointed to by environment
   elseif $CSCOPE_DB != “”
      cs add $CSCOPE_DB
   endif
   set csverb
endif
” Switch syntax highlighting on, when the terminal has colors
” Also switch on highlighting the last used search pattern.
if &t_Co > 2 || has(“gui_running”)
  syntax on
  set hlsearch
endif
filetype plugin on
if &term==”xterm”
     set t_Co=8
     set t_Sb=dm
     set t_Sf=dm
endif
” Don’t wake up system with blinking cursor:
” http://www.linuxpowertop.org/known.php
let &guicursor = &guicursor . “,a:blinkon0”

source /etc/vimrc  unmatched ‘

comments – Warning message when sourcing .vimrc – Stack Overflow

好像无需操心?

其会自动使用最新配置?

/etc/vimrc not sourced if ~/.vimrc doesn’t exist · Issue #60 · rkitover/vimpager

Double quote is not interpreted as comment · Issue #441 · vim/vim

 SIPEvents vim –version | grep ‘system vimrc file: ‘ | cut -f 2- -d :
 “/etc/vimrc”

进入vi中运行

:ver

:ver
VIM – Vi IMproved 7.4 (2013 Aug 10, compiled Jul 24 2015 02:21:55)
Included patches: 1-207, 209-629
Modified by <[email protected]>
Compiled by <[email protected]>
Small version without GUI.  Features included (+) or not (-):
+acl             -conceal         -farsi           -libcall         -mouse_sgr       -python3         -tag_old_static  -vreplace
-arabic          -cryptv          -file_in_path    -linebreak       -mouse_sysmouse  -quickfix        -tag_any_white   +wildignore
-autocmd         -cscope          -find_in_path    -lispindent      -mouse_urxvt     -reltime         -tcl             -wildmenu
-balloon_eval    -cursorbind      -float           -listcmds        -mouse_xterm     -rightleft       +terminfo        +windows
-browse          -cursorshape     -folding         -localmap        +multi_byte      -ruby            -termresponse    +writebackup
+builtin_terms   -dialog          -footer          -lua             -multi_lang      -scrollbind      -textobjects     -X11
-byte_offset     -diff            +fork()          -menu            -mzscheme        -signs           -title           -xfontset
-cindent         -digraphs        -gettext         -mksession       -netbeans_intg   -smartindent     -toolbar         -xim
-clientserver    -dnd             -hangul_input    -modify_fname    -path_extra      -sniff           -user_commands   -xsmp
-clipboard       -ebcdic          +iconv           -mouse           -perl            -startuptime     -vertsplit       -xterm_clipboard
-cmdline_compl   -emacs_tags      -insert_expand   -mouse_dec       -persistent_undo -statusline      -virtualedit     -xterm_save
+cmdline_hist    -eval            +jumplist        -mouse_gpm       -printer         -sun_workshop    +visual          -xpm
-cmdline_info    -ex_extra        -keymap          -mouse_jsbterm   -profile         -syntax          -visualextra
-comments        -extra_search    -langmap         -mouse_netterm   -python          -tag_binary      -viminfo
   system vimrc file: “/etc/virc”
     user vimrc file: “$HOME/.vimrc”
 2nd user vimrc file: “~/.vim/vimrc”
      user exrc file: “$HOME/.exrc”
  fall-back for $VIM: “/etc”
 f-b for $VIMRUNTIME: “/usr/share/vim/vim74”
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H     -O2 -g -pipe -Wall -fexceptions -fstack-protector –param=ssp-buffer-size=4 -m64 -mt
une=generic -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc   -L/usr/local/lib -Wl,–as-needed -o vim        -lm  -lselinux -ltinfo -lacl -lattr
Press ENTER or type command to continue

暂时不去管了。

转载请注明:在路上 » [无需解决]source /etc/vimrc出错:/etc/vimrc:65: unmatched ‘

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
84 queries in 0.171 seconds, using 22.09MB memory