vim syntax

  • Hallo


    Ich versuche vergeblich syntax highlighting bei vim zu aktivieren.


    meine .vimrc:
    syntax on



    es funktioniert aber nicht!!


    Kann mir bitte jemand helfen und mir mal einen Hinweis geben wie ich mein vim "bunt" bekomme auf dem QNAP TS-659 Pro+
    vielen Dank


    2.6.33.2 #1 SMP Sat Feb 12 00:34:03 CST 2011 x86_64

  • Hi,


    es gab damals den vim noch nicht auf dem NAS nur den vi, darum musste man den vim aus der Optware installieren.
    Jetzt kommt das NAS ja mit vim, jedoch gibt's da keine "syntax.vim", die für das Highlighting verantwortlich ist.
    Also einfach den vim aus der Optware installieren.


    Grüsse, David

  • Hi


    danke für deine Antwort.
    Ja ich habe den vim aus der optware installiert. "ipkg install vim"


    ...dennoch kann ich nicht syntax on machen?
    meine .vimrc liegt unter /root
    mit dem Inhalt: syntax on


    macht er aber nicht.

  • Folgende Meldung bekomme ich wenn ich meine /root/.vimrc bearbeite und syntax on reinschreibe




    Error detected while processing /root/.vimrc:
    line 1:
    E484: Can't open file /usr/local/share/vim/syntax/syntax.vim
    Press ENTER or type command to continue





    Ich habe besagte Datei mal in den Ordner rein kopiert
    Passieren tut nix!! Keine Farbe im vim


    ====


    /usr/local/share/vim/syntax/syntax.vim


    " Vim syntax support file
    " Maintainer: Bram Moolenaar <Bram@vim.org>
    " Last Change: 2001 Sep 04


    " This file is used for ":syntax on".
    " It installs the autocommands and starts highlighting for all buffers.


    if !has("syntax")
    finish
    endif


    " If Syntax highlighting appears to be on already, turn it off first, so that
    " any leftovers are cleared.
    if exists("syntax_on") || exists("syntax_manual")
    so <sfile>:p:h/nosyntax.vim
    endif


    " Load the Syntax autocommands and set the default methods for highlighting.
    runtime syntax/synload.vim


    " Load the FileType autocommands if not done yet.
    if exists("did_load_filetypes")
    let s:did_ft = 1
    else
    filetype on
    let s:did_ft = 0
    endif


    " Set up the connection between FileType and Syntax autocommands.
    " This makes the syntax automatically set when the file type is detected.
    augroup syntaxset
    au! FileType * exe "set syntax=" . expand("<amatch>")
    augroup END



    " Execute the syntax autocommands for the each buffer.
    " If the filetype wasn't detected yet, do that now.
    " Always do the syntaxset autocommands, for buffers where the 'filetype'
    " already was set manually (e.g., help buffers).
    doautoall syntaxset FileType
    if !s:did_ft
    doautoall filetypedetect BufRead
    endif

  • Hi,


    versuche es dann auch mal mit dem vim aus der optware:

    Code
    /opt/bin/vim


    Grüsse, David

  • Zitat von "Terz"

    Hi,


    versuche es dann auch mal mit dem vim aus der optware:

    Code
    /opt/bin/vim


    Grüsse, David



    Danke für den Hinweis, das ist die Lösung! :thumb:


    which vim zeigt: /bin/vim


    LÖSUNG: ln -sf /opt/bin/vim /bin/vim


    ..kann man auch in die autorun.sh aufnehmen...

  • Mache daraus mal lieber ein:

    Code
    export EDITOR=/opt/bin/vim


    ;)



    Grüsse, David

  • ist das BESSER Eexport EDITOR=/opt/bin/vim in die .bashrc in die .profile zu nehmen oder in die .bash_profile ?

    Einmal editiert, zuletzt von frosch2 () aus folgendem Grund: Volltextzitat entfernt

  • Eigentlich in die inputrc, wenn es systemweit sein soll, ansonsten in die bash_profile.


    Grüsse, David

  • Zitat von "Terz"

    Mache daraus mal lieber ein:

    Code
    export EDITOR=/opt/bin/vim


    ;)



    Grüsse, David



    export EDITOR=/opt/bin/vim ---> funktioniert nicht!!


    wenn ich irgend was mit /opt/bin/vim "DATEI" bearbeite habe ich es farbig!
    wenn ich das "ln -sf /opt/bin/vim /bin/vim" mache funktioniert es auch


    mit export EDITOR geht es nicht.


    Anregungen? :roll:

  • Seltsam dass es so net funkt, ich kann nur net nachgucken...
    Naja. Wenn es mit einen Symlink funkt. Warum nicht ;)


    Grüsse, David