Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Source code files viewed using Quick Look on Snow Leopard had syntax highlighting. Unfortunately the syntax highlighting has disappeared on OS X Lion. Is there a way to get it back?

share|improve this question
add comment

4 Answers 4

up vote 6 down vote accepted

I don't think Snow Leopard did that by default, you most likely had a QuickLook plugin installed, such as qlcolorcode or colorqc2. You can simply install this again in Lion.

share|improve this answer
    
Can anybody with Snow Leopard confirm this? I honestly don't remember installing a Quick Look plugin to get syntax highlighting. –  John Topley Aug 24 '11 at 20:30
2  
I can confirm that there is no syntax highlighting done on Obj-C or python code viewed via Quick Look on Snow Leopard. You must have had a plugin installed. –  Ian C. Aug 24 '11 at 21:04
    
tx, qlcolorcode is still working for me in 10.9 –  memeLab Jun 1 at 13:10
add comment

Actually, Xcode 3.x included a Quicklook plugin for source codes. With the intruduction of Xcode 4.x, such plugin has disappeared.

I have personallly tried to use qlcolorcode and colorqc2 on Lion, but both are not stable/reliable enough (slow response, sometimes missing quicklook). An updated version of the plugins would be welcome.

share|improve this answer
add comment

The Xcode 3 plugin was found at /Developer/Applications/Xcode.app/Contents/Library/QuickLook/SourceCode.qlgenerator Unfortunately I don't think this can be made to work now. :(

share|improve this answer
add comment

Guys you can do this procedure bellow:

To fix this, open a new Terminal window and enter these commands to open vim’s configuration file:

$ cd /usr/share/vim
$ sudo vim vimrc

Press the i key to switch vim to Insertion Mode, then enter these lines below the set backspace=2 line:

set ai                  " auto indenting
set history=100         " keep 100 lines of history
set ruler               " show the cursor position
syntax on               " syntax highlighting
set hlsearch            " highlight the last searched term
filetype plugin on      " use the file type plugins

" When editing a file, always jump to the last cursor position
autocmd BufReadPost *
\ if ! exists("g:leave_my_cursor_position_alone") |
\ if line("'\"") > 0 && line ("'\"") <= line("$") |
\ exe "normal g'\"" |
\ endif |
\ endif

Press the ⎋ esc key to take vim out of Insertion Mode, then press : (colon) followed by x to save the file and exit.

It worked for me thanks.

share|improve this answer
    
Sadly this has nothing to do with QuickLook, just Vim. –  koiyu Oct 16 '11 at 8:10
    
I'll second that! –  myhd Nov 10 '12 at 10:42
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.