question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No highlight on Vim script

See original GitHub issue

Repro

  • Code
var hljs = require('highlight.js');

var code =
`
let found = 0
for a in args
    if filereadable(a)
        found = 1
    endif
endfor
if !found
    echoerr 'No file included!'
endif
let conf = {'command': 'redpen'}
let redpen_conf = unite#sources#redpen#detect_config(expand('%:p'))
if redpen_conf !=# ''
    let conf.cmdopt = '-c ' . redpen_conf . ' 2>/dev/null'
endif
call quickrun#run(conf)
`;

var result = hljs.highlight('vim', code);
console.log(result.value);
  • Output

let found = 0
for a in args
    if filereadable(a)
        found = 1
    endif
endfor
if !found
    echoerr 'No file included!'
endif
let conf = {'command': 'redpen'}
let redpen_conf = unite#sources#redpen#detect_config(expand('%:p'))
if redpen_conf !=# ''
    let conf.cmdopt = '-c ' . redpen_conf . ' 2>/dev/null'
endif
call quickrun#run(conf)

Nothing looks highlighted 😢

Environment

  • Highlight.js 9.2.0
  • OS X 10.11.4
  • Node.js 5.6.0

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
isagalaevcommented, Mar 22, 2016

Merged. Thanks a lot! I also just pushed one more fix to a different language (Gauss) that was causing mis-detection of your particular snippet. Pretty good improvement overall 😃

0reactions
rhysdcommented, Mar 22, 2016

I fixed again 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

Vim clear last search highlighting - Stack Overflow
After doing a search in Vim, I get all the occurrences highlighted. How can I disable that? I now do another search for...
Read more >
Turn On or Off Color Syntax Highlighting In vim Editor - nixCraft
The following instructions show you how to enable or disable syntax colors for VI/VIM text editor running on a Linux or Unix-like system....
Read more >
How can I clear word highlighting in the current document ...
To cause vim to highlight some text without jumping to it, you can :let @/="some text". In these expressions, @ lets you refer...
Read more >
How to Disable VIM Syntax Highlighting - Linux Hint
In this article we show how to configure your .vimrc file to disable syntax highlighting automatically when opening files.
Read more >
Basic Syntax Highlighting - Learn Vimscript the Hard Way
Opening a new Vim window causes Vim to reload all your bundled files for that window, whereas using a split does not. The...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found