Loading ...
Sorry, an error occurred while loading the content.

Re: Re (OOPS): Unable to get syntax highlighting to work for root account

Expand Messages
  • Tony Mechelynck
    ... [...] This is a small version and it has -autocmd. As such, it has no support for filetypes, since that support requires several kinds of autocommands:
    Message 1 of 9 , Mar 1, 2008
    • 0 Attachment
      YGirouard wrote:
      >
      > Thanks Tony,
      >
      > Not sure it applies to my issue though, as it's doing it for every filetype
      > (conf files, php files, perl, etc). As for the additional details you asked,
      > it was partially in the "Additional Info" section of my post but here goes
      > anyway... let me know if that helps:
      >
      > I'm using Linux RedHat Fedora Core 7 on a virtual dedicated server. I only
      > have shell access (no gui).
      >
      > The version output of vi echoes this (I put the whole thing anyway in
      > case...):
      >
      > VIM - Vi IMproved 7.1 (2007 May 12, compiled Jan 9 2008 08:28:40)
      > Included patches: 1-211
      > Modified by <bugzilla@...>
      > Compiled by <bugzilla@...>
      > Small version without GUI. Features included (+) or not (-):
      > -arabic -autocmd -balloon_eval -browse +builtin_terms -byte_offset -cindent
      > -clientserver -clipboard -cmdline_compl +cmdline_hist -cmdline_info
      > -comments
      > -cryptv -cscope -cursorshape -dialog -diff -digraphs -dnd -ebcdic
      > -emacs_tags -eval -ex_extra -extra_search -farsi -file_in_path -find_in_path
      > -folding
      > -footer +fork() -gettext -hangul_input +iconv -insert_expand +jumplist
      > -keymap -langmap -libcall -linebreak -lispindent -listcmds -localmap -menu
      > -mksession
      > -modify_fname -mouse -mouse_dec -mouse_gpm -mouse_jsbterm -mouse_netterm
      > -mouse_xterm +multi_byte -multi_lang -mzscheme -netbeans_intg -osfiletype
      > -path_extra -perl -printer -profile -python -quickfix -reltime -rightleft
      > -ruby -scrollbind -signs -smartindent -sniff -statusline -sun_workshop
      > -syntax
      > -tag_binary -tag_old_static -tag_any_white -tcl +terminfo -termresponse
      > -textobjects -title -toolbar -user_commands -vertsplit -virtualedit +visual
      > -visualextra -viminfo -vreplace +wildignore -wildmenu +windows +writebackup
      > -X11 -xfontset -xim -xsmp -xterm_clipboard -xterm_save
      > system vimrc file: "/etc/virc"
      > user vimrc file: "$HOME/.vimrc"
      > user exrc file: "$HOME/.exrc"
      > fall-back for $VIM: "/usr/share/vim"
      > Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -O2 -g -pipe -Wall
      > -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
      > --param=ssp-buffer-size=4 -m32 -
      > march=i386 -mtune=generic -fasynchronous-unwind-tables -D_GNU_SOURCE
      > -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2
      > Linking: gcc -L/usr/local/lib -o vim -lselinux -lncurses -lacl
      [...]

      This is a "small" version and it has -autocmd. As such, it has no support for
      filetypes, since that support requires several kinds of autocommands: for
      instance, $VIMRUNTIME/filetype.vim, which implements filetype detection, sets
      up a huge number of autocommands for the BufRead and BufNewFile events.

      Try invoking vim as vim, not as vi. Does it make a difference?


      Best regards,
      Tony.
      --
      Give me a Plumber's friend the size of the Pittsburgh dome, and a place
      to stand, and I will drain the world.


      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Tony Mechelynck
      ... The reason root doesn t use that alias is because /bin is guaranteed to be always mounted when your system is running, even in single-user
      Message 2 of 9 , Mar 1, 2008
      • 0 Attachment
        YGirouard wrote:
        >
        > Ok, I fixed it... all I had to do was to add an alias for vi pointing to
        > /usr/bin/vim in my /root/.bashrc file. Root was using /bin/vi which is the
        > Small version, while other accounts were aliasing vi as vim, which is why it
        > was working... I was also able to get syntax to work as root by using just
        > "vim filename" instead of vi... Silly me... Thanks for pointing me in the
        > right direction Tony! :)

        The reason root doesn't use that alias is because /bin is guaranteed to be
        always mounted when your system is running, even in single-user
        emergency-repairs runlevel, and even if /usr is on a different partition,
        which might be left unmounted in that case.

        What I recommend is not to set up that alias, but instead to teach yourself to
        invoke vim as vim (not vi) whenever you want "big" capabilities such as syntax
        highlighting (and /usr is mounted). That way, if someday you find yourself
        trying to do emergency repairs on a Red Hat system (not necessarily this one),
        you'll know that if "vim" isn't on a mounted volume, you can invoke a minimum
        vim version as "vi" -- while for normal editing purposes on a fully-running
        system, "vim" will give you what you want.


        Best regards,
        Tony.
        --
        You need no longer worry about the future. This time tomorrow you'll
        be dead.


        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_use" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      Your message has been successfully submitted and would be delivered to recipients shortly.