recentpopularlog in

kme : syntaxhighlighting   125

« earlier  
Wirble: Tab-Completion and Syntax Coloring for irb | http://www.rubyinside.com/
If you haven't got tab-completion and syntax coloring in your irb, you owe it to yourself to follow these instructions right away (should work for Linux, OS X, and Cygwin users). First, install the Wirble gem:
<code class="language-bash">sudo gem install -y wirble</code>

Next, create or edit a file called .irbrc in your home folder (~/.irbrc), and make sure these lines are included there:
<code class="language-ruby">require 'rubygems'
require 'wirble'
Wirble.init
Wirble.colorize</code>
ruby  repl  irb  syntaxhighlighting  fuckina  solution 
may 2018 by kme
python - Does PyCharm support Jinja2? - Stack Overflow | https://stackoverflow.com/
Yeah, you need the "pro" version for full support, but to some extent, you can just add the keywords for a new file type (Preferences -> General -> File Types) by yourself.
pycharm  intellij  idea  jinja  jinja2  syntaxhighlighting  sortof  workaround  solution 
february 2018 by kme
jinja2 code formatting – IDEs Support (IntelliJ Platform) | JetBrains | https://intellij-support.jetbrains.com/
Hi Ivan, formatting of jinja2 templates works in PyCharm. Do you have jinja2 selected as template language on the Template Languages settings page (http://www.jetbrains.com/pycharm/webhelp/template-languages.html)?


Seems to be supported only in the "pro" version.
pycharm  intellij  idea  jinja  syntaxhighlighting  sortof  solution 
february 2018 by kme
Suggestion: set synmaxcol to sane levels · Issue #142 · tpope/vim-sensible
Hey, just wanted to suggest setting synmaxcol to a sensible level, it's 3000 by default!, and this makes no sense.

I learned of it while talking on #vim how editing an HTML with minified CSS line completely slowed everything down. As it's not sane to have human content reach this limit, I think bringing this value down to 300 or something is better than having it at 3000.
vim  tipsandtricks  configfile  syntaxhighlighting 
december 2017 by kme
Toolbar ▲ Prism plugins | http://prismjs.com/
<code class="language-javascript">
function setUpToolbar() {
// there's a bug in the example at http://prismjs.com/plugins/toolbar/
// (you need to pass 'env' to the second argument of registerButton)
Prism.plugins.toolbar.registerButton('select-code', function(env) {
var button = document.createElement('button');
button.innerHTML = 'Select Code';

button.addEventListener('click', function() {
// Source: http://stackoverflow.com/a/11128179/2757940
if (document.body.createTextRange) { // ms
var range = document.body.createTextRange();
range.moveToElementText(env.element);
range.select();
} else if (window.getSelection) { // moz, opera, webkit
var selection = window.getSelection();
var range = document.createRange();
range.selectNodeContents(env.element);
selection.removeAllRanges();
selection.addRange(range);
}
});

return button;
});
}
</code>
prismjs  javascript  library  syntaxhighlighting  webdevel  samplecode  bug  solution 
october 2017 by kme
GitHub - vim-scripts/csv.vim: A Filetype plugin for csv files. | https://github.com/
Check out :ArrangeColumn and :UnArrangeColumn. These allow you to use vertical selections to prepend/append to individual columns. Pretty handy!

vim.org link: http://www.vim.org/scripts/script.php?script_id=2830

<code class="language-vim">
" create this as ~/.vim/filetype.vim
if exists("did_load_csvfiletype")
finish
endif
let did_load_csvfiletype=1

augroup filetypedetect
au! BufRead,BufNewFile *.csv,*.dat,*.tab,*.bed setfiletype csv
augroup END
</code>
Syntax error when opening a CSV file

If you see this error:

<code>CSV Syntax:Invalid column pattern, using default pattern \%([^,]*,\|$\)</code>

This happens usually, when the syntax script is read before the filetype plugin, so the plugin did not have a chance to setup the column delimiter correctly.

The easy way to fix it, is to make sure the :syntax on (:syn-on) statement comes after the :filetype plugin (:filetype-plugin-on) statement in your .vimrc

Alternatively, you can simply call InitCSV and ignore the error.
Autocommand on opening/closing files

Alternatively, you can restrict this setting to files below a certain size. For example, if you only want to enable this feature for files smaller than 1 MB, put this into your .vimrc

let g:csv_autocmd_arrange = 1
let g:csv_autocmd_arrange_size = 1024*1024
vim  script  csv  syntaxhighlighting  programming  plugin  delimitedtext  textprocessing  errormessage  essential  movein  solution 
october 2017 by kme
posva/vim-vue: Syntax Highlight for Vue.js components
This one works better than darthmall/vim-vue, which is no longer supported.
vim  vuejs  syntaxhighlighting  javascript  webdevel  solution 
september 2017 by kme
vim - Why does ""Here strings" in bash changes the syntax color of whatever follows it? - Stack Overflow
Turns out my problem was a shebang that was just '#!/bin/sh'. Changing that to '#!/bin/bash' fixed the problem with highlighting here strings.

The bash (really sh) highlight mode in Vim is multipurpose; it tries to cover POSIX sh, bash, and ksh. You have to tell it you specifically want bash.
<code class="language-viml">:let b:is_bash=1
:set ft=sh</code>

It should highlight properly after that.

If you only ever care about bash, you could just make this your default in .vimrc:
<code class="language-viml">let g:is_bash=1</code>

EDIT: As pointed out by Charles Duffy in comments, if you use a #! line, e.g.
<code class="language-bash">#!/bin/bash
#!/usr/bin/env bash
</code>

Then vim should do the right thing on its own. That is probably easier, unless you have some reason you prefer not use #! lines.

(Even though that's likely easier, I am leaving my answer here because in this case you do not have a #! line, and that is not uncommon, especially in library code or files expected to be sourced, not executed.)
bash  solution  syntaxhighlighting  vim 
september 2017 by kme
Notepad++ syntax highlighting - Ask for Help - AutoHotkey Community
In notepad++ click Languages -> select 'Autoit' or select 'AHK Autohotkey' if you have installed the syntax plugin.
autohotkey  syntaxhighlighting  notepad++  windows  solution 
may 2017 by kme
xenoterracide: Making re.pl usable
Update 2017-10-25: Finally found out how to keep Ctrl+C from terminating the REPL--add the "Interrupt" plugin.

You will probably need to install Sys::SigAction, because that doesn't seem to be pulled in as a dependency of Devel::REPL.

# put this in $HOME/.re.pl/repl.rc
use 5.012;
use warnings;

load_plugin qw(
Colors
Completion
CompletionDriver::INC
CompletionDriver::LexEnv
CompletionDriver::Keywords
CompletionDriver::Methods
DumpHistory
History
LexEnv
ReadLineHistory
Interrupt
);
perl  repl  config  configfile  movein  syntaxhighlighting  history  completion  solution  fuckina  essential 
december 2016 by kme
GitHub - gregsexton/MatchTag: Vim's MatchParen for HTML tags
To get this to work for file types other than html that use a similar tag structure (e.g Twig templates) you can do something similar to this.

echo 'runtime! ftplugin/html.vim' > ~/.vim/ftplugin/twig.vim
vim  plugin  webdevel  syntaxhighlighting  solution  essential  movein 
june 2016 by kme
vim syntax coloring for git commit messages in submodules - Stack Overflow


First, check whether the filetype has been properly detected:

:setlocal filetype?

It should be gitcommit, set probably by this rule in $VIMRUNTIME/filetype.vim:

au BufNewFile,BufRead *.git/modules/**/COMMIT_EDITMSG setf gitcommit

Now, check whether you have this rule and whether the patch matches your environment. You may need to adapt this to catch your module's commit messages.
git  syntaxhighlighting  vim  solution 
march 2016 by kme
How do I enable syntax highlighting in nano? - Ask Ubuntu
<code class="language-bash">find /usr/share/nano/ -iname "*.nanorc" -exec echo include {} \; >> ~/.nanorc</code>
nano  syntaxhighlighting  newbie  configfile  solution 
october 2015 by kme
How do I make vim automatically apply c++ syntax highlight on Arduino files (.ino/.pde)? - Super User - http://superuser.com/
Add something like this to ~/.vimrc:

autocmd BufNewFile,BufReadPost *.ino,*.pde set filetype=cpp
Or more correctly, to ~/.vim/ftdetect/cpp.vim.
vim  colorscheme  filetype  syntaxhighlighting  solution  cuda 
october 2015 by kme
lunaru/vim-twig · GitHub
Doesn't seem to do HTML syntax highlighting, unfortunately. Try https://github.com/evidens/vim-twig, which works great even though it's "discontinued" by its author.
twig  vim  syntaxhighlighting 
august 2015 by kme
Syntax Highlighting for Template Toolkit (.tt files) in VIM - Stack Overflow
Create a file at ~/.vim/ftdetect/tt.vim that contains the following.

autocmd BufNewFile,BufRead *.tt setf tt2

This should associate all *.tt files with tt2 filetype.
vim  perl  templatetoolkit  webdevel  syntaxhighlighting  solution 
january 2015 by kme
Notepad++ syntax highlighting - Support - AutoHotkey Community
That exists officially. It's bundled with the AutoHotkey installer. Check the following folder on your PC:
C:\Program Files\AutoHotkey\Extras\Editors\Notepad++
autohotkey  syntaxhighlighting  vim  solution 
december 2014 by kme
« earlier      
per page:    204080120160

Copy this bookmark:





to read