Vim-editor

Der Editor „vim“ ist bei QNAP bereits installiert, allerdings beherrscht er kein Syntax highlighting und andere gewohnte Tastatursteuerungen.
Hier eine Anleitung welche abhilfe schafft.

Quelle: https://forum.qnap.com/viewtopic.php?t=165256

  1. vim<VERSION> source package herunterladen
    http://ftp.vim.org/ftp/pub/vim/unix/]]
  2. Verzeichnis $HOME/local erstellen, Quellpakete herunterladen und entpacken
    mkdir $HOME/local
    cd ~/local
    wget http://ftp.vim.org/ftp/pub/vim/unix/vim-7.2.tar.bz2
    bzip2 -d vim-7.2.tar.bz2
    tar xf vim-7.2.tar
  3. VIM Umgebungsvariable in $HOME/.profile oder $HOME/.bashrc setzen
    export VIM=$HOME/local/vim72/runtime
  4. Da QNAP die termcap Datenbank nicht installiert hat wird vim nicht wissen wie er Farben setzen soll.
    Daher muss noch die Datei $HOME/.vimrc für die Konfiguration von vim erstellt werden.
    .vimrc uses " for commenting.
    BELOW, THE ^[ SHOULD BE ENTERED BY TYPING <Control-V> <Escape>. IF YOU JUST COPY AND PASTE WHAT YOU "SEE" BELOW INTO A FILE, IT WONT WORK !
    I.e. after t_AB= you would type <Control-v> <Escape> [ 4 8 ; 5 ; % d m (but no spaces) I hope I am being as clear as possible.

    Inhalt von .vimrc:

    " work around broken/non-existent termcap database on QNAP
    set t_Co=8
    set t_AF=^[[38;5;%dm
    set t_AB=^[[48;5;%dm
    syntax on

Weitere Infos aus der Quelle, welche ggf. noch gemacht werden können:

That should do it! At this point, if you open e.g. a bash script (with #!/bin/bash she-bang at the top) then vim can identify it as bash, and can colorize it.
If vim doesn't identify the file type automatically, you can do something like...
CODE: SELECT ALL

set ft=bash
syntax on
That would be for a bash file. For C code, e.g. it would be
CODE: SELECT ALL

  set ft=c  
or for TCL it would be
CODE: SELECT ALL

  set ft=tcl  
OK I hope that helps! I've been on this forum for 10+ years. I recently had to re-create my account. I rarely posted but received a lot of help. Hope this might be useful to someone !