Tag Info

Hot answers tagged

11

When you have the file open, you can run: :set filetype=messages To automate this for all files called messages, put the following into ~/.vim/ftdetect/messages.vim: autocmd BufNewFile,BufReadPost *messages* :set filetype=messages


10

First things first, sit back, relax, and take a few deep breaths. Okay, relaxed now? For the first error, you need: set backspace=2 The second one I can only assume occurred becaue you're not using the standard vim that ships with Ubuntu, or your environment has become broken somehow. What you probably need to do is actually find the syntax file with ...


9

vim (on most systems these days vi is actually a symlink for vim) uses syntax files to define the coloring schemes for the various languages it can deal with. You have not specified which OS you use but on my LMDE system, these are found in /usr/share/vim/vim74/syntax/. When you open a file using vim, it will first try and figure out what type of file it ...


8

less doesn't support syntax highlighting. vim, like all vi clones has a read-only mode called view which you can use to just view files. it supports all features of vim including syntax highlighting. e.g. view filename.py the main difference between view and vi is that view doesn't "lock" the file you're viewing by creating a .swp file.


7

Please see: http://kde-look.org/content/show.php/darK+-+A+Kate+Syntax+Highlighting+Theme?content=53388 http://kde-look.org/content/show.php/DarkOxygen?content=140718 They might help. Also, http://askubuntu.com/questions/19005/using-oblivion-color-scheme-from-gedit-in-kate There are three dead links at the bottom of this email ...


6

less cannot be taught to highlight syntax elements, but Vim can be used as a pager, i.e. a replacement for less. There are more advanced plugins, but the basic script actually ships with Vim ($VIMRUNTIME/macros/less.sh). For the full information, see Using vim as a syntax-highlighting pager on the Vim Tips Wiki.


5

I tend to disagree with Ingo, less can be taught to highlight syntax. Check out this answer on SuperUser. Basically, you have to install GNU's source-highlight (available in all major distro package repos), and then add the following to your .bashrc (or .bash_profile or what have you): export LESSOPEN="| /path/to/src-hilite-lesspipe.sh %s" export LESS=" -R ...


4

Put the line syntax on in your ~/.vimrc (assuming you're talking about vim), same as on any other installation of vim.


4

Real time syntax coloring is a lot of work, especially with shells whose syntax is trickier than fish's. Only fish has it out of the box. Zsh has syntax coloring if you install the zsh-syntax-highlighting add-on. I'm not aware of any effort to do this with bash.


4

This is wrong: if [[ ${lostsongs[a+1]}<${lostsongs[a]} ]]; then because there are no spaces around "<", [[ only sees one, non-empty, argument, and returns true every time. You want if [[ ${lostsongs[a+1]} -lt ${lostsongs[a]} ]]; then or if (( lostsongs[a+1] < lostsongs[a] )); then


3

Colours are provided by the font-lock minor mode. To disable colouring in your current buffer, toggle font-lock-mode off with this command: M-x font-lock-mode To disable font-lock-mode permanently, add to your init file (~/.emacs): (global-font-lock-mode 0) More info is available under Font-Lock in the Gnu Emacs Manual


3

This is not a direct answer but despite i hope it helps you. If you want to use vim to write your latex documents latex-suite isn't recommended anylonger, at least from my perspective. There are several more comprehensive vim-scripts which handle this task a lot better. It is worth to take a look at http://atp-vim.sourceforge.net/ and ...


3

Have a look into this plugin, it's likely what you want: AnsiEsc.vim : ansi escape sequences concealed, but highlighted as specified


3

You have to define highlight colors. From :h :match :mat[ch] {group} /{pattern}/ Define a pattern to highlight in the current window. It will be highlighted with {group}. Example: > :highlight MyGroup ctermbg=green guibg=green :match MyGroup /TODO/ So, something like this: :hi OpenTag guibg=green ...


2

For the first error, you're setting an option. That uses the set command, and that's all there is to it. set backspace=2 For the second error, you're missing the system file /usr/share/vim/syntax/syntax.vim. That means you need to install the package that provides this file. There is a generic method to find out what that package is, for any file provided ...


2

Syntax highlighting of less, works just fine on most *nix systems. Even on Cygwin you can do it with the minor adjustment of the shell script path and installing with apt-cyg. apt-cyg install source-highlight export LESSOPEN="| /usr/bin/src-hilite-lesspipe.sh %s" export LESS=' -R ' However, using this drastically slows down browsing of large files. I ...


2

For syntaxhighlighting in Ikiwiki there is a plugin called highlight. You can use it like [[!format tex """ \documentclass{scrartcl} … """]] This will give you nice syntax highlighting. It uses Perl bindings. The library itself has a longer documentation.


2

xterm-color is probably not a supported terminfo description on your work computers. You can verify this is the case by running infocmp. You'll likely get an error of infocmp: couldn't open terminfo file. The fix for this is to set your TERM variable to something more common, for example just 'xterm' (in fact on my own system, the xterm terminfo description ...


2

Vim's evaluation rules are not like those found in common programming languages. Most Ex commands do not take variables, but expect literal values. This makes it more convenient for interactively issuing the commands: no string quoting is necessary. In Vimscript, as you've already correctly discovered, you need to use :execute to get Vimscript variables ...


2

As of Emacs 24.3, this functionality is not available in Show Paren mode. Here's some completely untested code (typed directly in my browser) that tweaks Show Paren mode to match a closing parenthesis before the cursor instead of after. (defadvice show-paren-function (around show-paren-closing-before activate compile) (if (eq (syntax-class ...


1

In Vim, syntax highlighting is a two-stage process: a syntax script (for a particular language) defines the parsing rules and with that determines what can be distinctly highlighted. There's usually an abstraction layer where individual elements are linked to logical highlight groups. your colorscheme (or the default one) assigns certain colors (depending ...


1

You can provide your own function as the value of show-paren-data-function: ,---- | show-paren-data-function is a variable defined in `paren.el'. | Its value is show-paren--default | | This variable can be risky when used as a file-local variable. | | Documentation: | Function to find the opener/closer at point and its match. | The function is called ...


1

Turns out I can't define the style in the .lang file. In the <style> tag there I can only refer to a style that is defined in the files in /usr/share/gtksourceview-3.0/styles. E.g. to the style used for keywords in programming languages: <style id="chord" _name="Chord" map-to="def:keyword"/>


1

My Vim already does this. It actually bothers me, because it causes comments inside of the subshells not to get the proper highlight applied. This is Vim 7.3 patch 874 compiled from source.


1

I don't think this exists. It would be useful, but hard to implement by standard means of syntax parsing used in editors. From the parsing point of view, there are many keywords and special symbols that would have to be analysed to determine a block of code that belongs to a subshell. But I'd be happy to see I'm wrong and someone has put the effort needed ...


1

Adding to Gilles' line of thought, I'd suggest using Cygwin's MinTTY terminal instead of the Windows console-based one. It uses PuTTY's engine and offers a much, much better experience.


1

So, I've discovered that the WP.com [sourcecode language="xxx"] tags work with markdown/VimRepress with a caveat - Dont have any empty lines in the code. It may work properly with 4 spaces on the line - but haven't tried that yet.


1

I finally found the answer myself. The two pathogen calls at the top of my .vimrc file do something that is not sufficient to take coloration into account. Using this call did the trick: call pathogen#infect()


1

First. When editing one of your .hbs, or .handlebars files, issue :set ft? in vim, and see if your filetype is being detected. If you don't see filetype=handlebars, try setting :filetype on in your .vimrc file and test again. If that doesn't work, you may need to put a filetype.vim file in your .vim directory. if exists("did_load_filetypes") finish ...



Only top voted, non community-wiki answers of a minimum length are eligible