SecureCRT and Nice PHP/JS Syntax Highlighting: How To Configure?

0

I'm running SecureCRT using Windows 7. After googling a bit the VanDyke results came up, but I want to get it so instead of just a black background with all green text (sure it's better than the SecureCRT default, but still makes your eyes bleed), it recognizes opening and closing tags, conditional blocks, etc etc etc...both for php/js.

What is the best way to go about this? I use vim at home on my mac and configuring the .vimrc is easy enough, but with Windows it's a bit more daunting.

Any input is appreciated to get this set up.

My SecureCRT:

enter image description here

EDITS:

In my /etc/ folder I have a vimrc file. Not a .vimrc file, a vimrc file.

I open that up and it has some standard vim-like stuff in there, see here:

cif 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

syntax on
colorscheme blue

" Only do this part when compiled with support for autocommands
if has("autocmd")
  augroup fedora
  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/*,/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 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 indent on3f3

if &term=="xterm"
     set t_Co=256
     set t_Sb=[4%dm
     set t_Sf=[3%dm
     colorscheme blue 
endif

" Don't wake up system with blinking cursor:
" http://www.linuxpowertop.org/known.php
let &guicursor = &guicursor . ",a:blinkon0"

Now it seems whatever I do to this file isn't being recognized. How could I set this up so whatever the content is of this vimrc file, it IS recognized?

Based on :version, this is listed as the system vimrc file, see my comment below for the github gist.

Doing a search on the server of

find / -name .vimrc

does not return anything

@romainl I tried to install vim via apt-get but I get

[root@Map16-04 etc]# apt-get install vim
Reading Package Lists... Done
Building Dependency Tree... Done
Selecting vim-enhanced for 'vim'
vim-enhanced is already the newest version.
0 upgraded, 0 newly installed, 0 removed and 0 not upgraded.

vim-full and vim-nox packages could not be found when I tried those.

Nubtacular

Posted 2013-10-02T15:55:26.983

Reputation: 103

Answers

0

Syntax highlighting is done the same way whatever platform you are on.

Assuming your terminal is able a) to display at least 8 colors, b) that it correctly tells vim about its abilities and c) that Vim is actually built with syntax support; adding the following lines to the .vimrc or _vimrc loaded by your Vim is all you need:

filetype plugin indent on
syntax on

But you don't say much about your setup:

  • do you use vim locally or remotely?
  • what is the output of

    :echo $TERM
    :echo &t_Co
    :version
    

EDIT

Judging by your :version the Vim build that you use:

  • can't complete on the command-line -cmdline_compl,
  • can't do diffs -diff,
  • isn't scriptable -eval,
  • can't do folding -fold,
  • can't have a quickfix window -quickfix,
  • and can't do syntax highlighting -syntax.

Since you are programming on that server, that particular Vim build (small) is very close to be worthless.

The only way out of this mess is to install a proper build. If you have the necessary rights, you can use the package manager of your server to install vim-nox or vim-full or, if you don't have much rights on this machine, you can build Vim from sources.

And before you complain, the default Vim on every UNIX-y OS is always crippled in many different ways. It's always perfect for editing config files but never enough for heavy usage.

romainl

Posted 2013-10-02T15:55:26.983

Reputation: 19 227

Hi @romainl. I use vim remotely only (within SecureCRT only, on one of our servers here). Doing those two :echo s does nothing, but :version does this: https://gist.github.com/anonymous/6797630 . I've never used vim on this Windows 7 machine locally, nor configured a .vimrc file on this computer (have only configured .vimrc on my mac at home).

– Nubtacular – 2013-10-02T17:50:33.067

@DnfD, I have some bad news for you, see my edit. – romainl – 2013-10-02T19:59:52.383

Thanks for the detailed response, I updated my initial question with more information. – Nubtacular – 2013-10-02T20:42:35.907

@DnfD, you've got the answer to your question: your vim build just can't do syntax highlighting at all. Don't bother playing with vimrcs, it won't work. Your only chance to get syntax highlighting is to install a proper Vim yourself and that's a different problem, a separate question and a separate answer. I consider this question answered. – romainl – 2013-10-02T20:47:28.703

Alrighty then. I appreciate the input on the matter :) – Nubtacular – 2013-10-02T20:50:43.500