groenewege / vim-less Goto Github PK
View Code? Open in Web Editor NEWvim syntax for LESS (dynamic CSS)
vim syntax for LESS (dynamic CSS)
At least in pathogen 2.0, to install it you have to add to .vimrc:
call pathogen#infect()
no matter before or after filetype plugin indent on
Is there any reason that my VIM doesn't indent anything even a simple code with an unformated line like :
h2 {
text-align:center;
font-size:11px;
margin:0;
text-transform:none;
letter-spacing:0;
}
I can't do anything (gg=G or select text then =) to indent it.
I use gVim 7.4 and it worked before upgrading with vundle.
I tried to disable every other plugins with no luck.
Edit : this is a real issue due to 874a48d
All versions before this commit work for me
value with quotation will fail to analysis ;eg: font-family:"Microsoft YaHei";
hi there. thanks for this awesome plugin. i'm a less noob so i hope this isn't just a dumb less mistake. for some reason vim-less doesn't seem to be indenting mixins. for example the following:
.my-mixin {
background:#fff;
}
when mixed in doesn't indent inside the parent:
.some-class {
.my-mixin;
}
is this intentional? thanks again and keep up the good work! :)
Hi,
When I source the .vimrc, I have some error ?
source ~/.vimrc
/Users/xartot/.vimrc:1: command not found: syn
/Users/xartot/.vimrc:4: command not found: filetype
/Users/xartot/.vimrc:6: command not found: filetype
/Users/xartot/.vimrc:8: parse error near `<'
here my config:
1 syn on
2 execute pathogen#infect()
3 set syntax=on
4 filetype indent plugin on
5
6 filetype on
7
8 nnoremap m :w !lessc % > %:t:r.css
Thanks
For some reason vim-css-color does not seem to highlight colors in my LESS files when using vim-less. I installed both vim-less and vim-css-color (and other plugins) using Pathogen.
Aside from the vim-css-color issue, vim-less appears to be working as expected.
-- Update --
Oddly this only seems to happen with certain named colors. For instance, red, blue, and green do not get highlighted but purple, orange, and yellow do. If I copy the exact same code to a CSS file instead of a LESS file all of the colors (red, blue, green, purple, orange, and yellow) are highlighted as expected. Hex colors seem to be working fine though.
Apparently having the following rule structure, causes the code folding to break.
ul {
li { display: block; padding: .5em; a { color: red; } }
h4 { color: red; }
}
folded looks like:
+ul {...li { display: block; padding: .5em; a { color: red; } }
h4 { color: red; }
}
the only way to grant the code-folding will be correct is to split nested rules into different lines such as:
ul {
li { display: block; padding: .5em;
a { color: red; }
}
h4 { color: red; }
}
which properly folds to
+ul {...}
tags like h1, h2 etc. have the numbers highlighted like numeric literals (cssValueNumber highlighting group) instead of being the same color as the rest of the tag name (cssTagName highlighting group).
Is there any reason, why this plugin may not work? I'm using MacVim 7.3.315 with Solarized theme, plugin is installed using pathogen.
Here is a list of plugins I'm having installed:
delimitMate
vim-coffee-script
vim-haskell
vim-ragtag
vimroom
nerdtree
vim-colors-solarized
vim-indexed-search
vim-rails
syntastic
vim-endwise
vim-less
vim-surround
tabular
vim-fugitive
vim-markdown
vim-unimpaired
Thanks.
Alex
nnoremap ,m :w <BAR> !lessc % > %:t:r.css<CR><space>
it is incorrect for open fullpath less, such as vim static/css/base.less
And press ,m
, the base.css file vim ouput in static directory
so, you should use: nnoremap ,m :w <BAR> !lessc % > %:p:r.css<CR><space>
Hi,
I just installed vim-less via vundle, but the syntax highlighting doesn't work automatically.
I've read the issue #6 and tried to do the same thing, but still doesn't work.
When I set the filetype manually it works.
After opening a .less file, the output for :scriptnames
is:
1: /usr/share/vim/vimrc
2: /usr/share/vim/vim74/debian.vim
3: /usr/share/vim/vim74/syntax/syntax.vim
4: /usr/share/vim/vim74/syntax/synload.vim
5: /usr/share/vim/vim74/syntax/syncolor.vim
6: /usr/share/vim/vim74/filetype.vim
7: ~/.vimrc
8: ~/.vim/myconfs.vim
9: /usr/share/vim/vim74/syntax/nosyntax.vim
10: ~/.vim/vundle.vim
11: ~/.vim/bundle/vundle/autoload/vundle.vim
12: ~/.vim/bundle/vundle/autoload/vundle/config.vim
13: ~/.vim/bundle/YouCompleteMe/plugin/youcompleteme.vim
14: ~/.vim/bundle/emmet-vim/plugin/emmet.vim
15: ~/.vim/bundle/syntastic/plugin/syntastic/autoloclist.vim
16: ~/.vim/bundle/syntastic/plugin/syntastic/balloons.vim
17: ~/.vim/bundle/syntastic/plugin/syntastic/checker.vim
18: ~/.vim/bundle/syntastic/plugin/syntastic/cursor.vim
19: ~/.vim/bundle/syntastic/plugin/syntastic/highlighting.vim
20: ~/.vim/bundle/syntastic/plugin/syntastic/loclist.vim
21: ~/.vim/bundle/syntastic/plugin/syntastic/modemap.vim
22: ~/.vim/bundle/syntastic/plugin/syntastic/notifiers.vim
23: ~/.vim/bundle/syntastic/plugin/syntastic/registry.vim
24: ~/.vim/bundle/syntastic/plugin/syntastic/signs.vim
25: ~/.vim/bundle/syntastic/plugin/syntastic.vim
26: ~/.vim/bundle/syntastic/autoload/syntastic/log.vim
27: ~/.vim/bundle/syntastic/autoload/syntastic/util.vim
28: /usr/share/vim/vim74/plugin/getscriptPlugin.vim
29: /usr/share/vim/vim74/plugin/gzip.vim
30: /usr/share/vim/vim74/plugin/matchparen.vim
31: /usr/share/vim/vim74/plugin/netrwPlugin.vim
32: /usr/share/vim/vim74/plugin/rrhelper.vim
33: /usr/share/vim/vim74/plugin/spellfile.vim
34: /usr/share/vim/vim74/plugin/tarPlugin.vim
35: /usr/share/vim/vim74/plugin/tohtml.vim
36: /usr/share/vim/vim74/plugin/vimballPlugin.vim
37: /usr/share/vim/vim74/plugin/zipPlugin.vim
38: ~/.vim/bundle/powerline/powerline/bindings/vim/plugin/powerline.vim
39: /usr/share/vim/vim74/scripts.vim
40: ~/.vim/bundle/YouCompleteMe/autoload/youcompleteme.vim
After setting ft=less
, the output for :scriptnames
is:
1: /usr/share/vim/vimrc
2: /usr/share/vim/vim74/debian.vim
3: /usr/share/vim/vim74/syntax/syntax.vim
4: /usr/share/vim/vim74/syntax/synload.vim
5: /usr/share/vim/vim74/syntax/syncolor.vim
6: /usr/share/vim/vim74/filetype.vim
7: ~/.vimrc
8: ~/.vim/myconfs.vim
9: /usr/share/vim/vim74/syntax/nosyntax.vim
10: ~/.vim/vundle.vim
11: ~/.vim/bundle/vundle/autoload/vundle.vim
12: ~/.vim/bundle/vundle/autoload/vundle/config.vim
13: ~/.vim/bundle/YouCompleteMe/plugin/youcompleteme.vim
14: ~/.vim/bundle/emmet-vim/plugin/emmet.vim
15: ~/.vim/bundle/syntastic/plugin/syntastic/autoloclist.vim
16: ~/.vim/bundle/syntastic/plugin/syntastic/balloons.vim
17: ~/.vim/bundle/syntastic/plugin/syntastic/checker.vim
18: ~/.vim/bundle/syntastic/plugin/syntastic/cursor.vim
19: ~/.vim/bundle/syntastic/plugin/syntastic/highlighting.vim
20: ~/.vim/bundle/syntastic/plugin/syntastic/loclist.vim
21: ~/.vim/bundle/syntastic/plugin/syntastic/modemap.vim
22: ~/.vim/bundle/syntastic/plugin/syntastic/notifiers.vim
23: ~/.vim/bundle/syntastic/plugin/syntastic/registry.vim
24: ~/.vim/bundle/syntastic/plugin/syntastic/signs.vim
25: ~/.vim/bundle/syntastic/plugin/syntastic.vim
26: ~/.vim/bundle/syntastic/autoload/syntastic/log.vim
27: ~/.vim/bundle/syntastic/autoload/syntastic/util.vim
28: /usr/share/vim/vim74/plugin/getscriptPlugin.vim
29: /usr/share/vim/vim74/plugin/gzip.vim
30: /usr/share/vim/vim74/plugin/matchparen.vim
31: /usr/share/vim/vim74/plugin/netrwPlugin.vim
32: /usr/share/vim/vim74/plugin/rrhelper.vim
33: /usr/share/vim/vim74/plugin/spellfile.vim
34: /usr/share/vim/vim74/plugin/tarPlugin.vim
35: /usr/share/vim/vim74/plugin/tohtml.vim
36: /usr/share/vim/vim74/plugin/vimballPlugin.vim
37: /usr/share/vim/vim74/plugin/zipPlugin.vim
38: ~/.vim/bundle/powerline/powerline/bindings/vim/plugin/powerline.vim
39: /usr/share/vim/vim74/scripts.vim
40: ~/.vim/bundle/YouCompleteMe/autoload/youcompleteme.vim
41: /usr/share/vim/vim74/syntax/vim.vim
42: /usr/share/vim/vim74/syntax/python.vim
43: ~/.vim/bundle/vim-less/syntax/less.vim
44: /usr/share/vim/vim74/syntax/css.vim
Looking at it I noticed the only vim-less file loaded is vim-less/syntax/less.vim
, and only after the filetype is set manually.
Getting wrong colors on 'font-size', 'border', 'color', etc.
Using vim-less, vim-css3-syntax, vim-css-color, MacVim 72, OS X Mavericks.
https://www.dropbox.com/s/5ikoeclnq5ixy9b/Screenshot%202013-10-31%2010.47.58.png
Fresh start Vim, opening any .less
file. It doesn't have any colors. But if I run :so $MYVIMRC
. It will have colors.
Any idea what's going on?
How does autocomplete work? Is there a key combo? I'm unsure if its working or not.
There seems to be an issue with indention. This is the simplest example I could come up with. I have this formatted LESS:
td > table.sub {
width: 100%;
* {
padding: 0;
}
}
Formatting with =
causes:
td > table.sub {
width: 100%;
* {
padding: 0;
}
}
I have just install the vim-less without any config.
But when I open a empty or not .less
file.
it will alway show some error at the bottom, and disappear after a while.
and the plugin will work.
this is the error:
and this is the code that has error in less.vim. But I dont know the syntax
setlocal omnifunc=csscomplete#CompleteCSS
setlocal suffixesadd=.less
setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,://
setlocal fo=jcroql // this is where error happens
let &l:include = '^\s*@import\s\+\%(url(\)\=["'']\='
My System is OSX 10.10.4
and the version of vim is: 7.3
I'm using vim-less vim bundle to autoindent my .less files in vim. The problem is that it doesn't work properly on nested properties:
When I autoindent my code I get this:
#header{
margin: 0;
div{
display: inline;
a{
text-decoration: none;
}
}
span{
color: #ffffff;
}
}
instead of :
#header{
margin: 0;
div{
display: inline;
a{
text-decoration: none;
}
}
span{
color: #ffffff;
}
}
Here is my ~/.vimrc :
set nocompatible
" 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
"Highlight Tabs and Spaces
set expandtab
set smarttab
set nocompatible
set hlsearch
" autoindent
filetype on
filetype plugin on
filetype indent on
" Show line number
:set number
syntax enable
set shiftwidth=2
set expandtab
set softtabstop=2
" https://github.com/tpope/vim-pathogen
execute pathogen#infect()
The only vim bundle that I'm using is the vim-less bundle.
Hi,
where's the correct place to override settings such as shiftwidth
, tabstop
and noexpandtab
according to my customs?
Thanks!
Bohdan
.rule {
a:hover {
color:#fff;
}
}
have different hightlighting then:
.rule {
a:hover
{
color:#fff;
}
}
I've got the plugin loaded via pathogen and the syntax highlight looks fine. When I open a less file I get this:
Error detected while processing /mnt/ebs/home/dbeardsley/.vim/bundle/vim-less/syntax/less.vim:
line 12:
E409: Unknown group name: cssValue.*,cssColor,cssTagName,cssPseudoClass,cssUrl,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,lessDefinition,lessComment,lessClassChar,lessVariable,lessMixinChar,lessAmpersandChar,lessFunction,@cssColors fold
E475: Invalid argument: lessDefinition transparent matchgroup=cssBraces start='{' end='}' contains=css.*Attr,css.*Prop,cssComment,cssValue.*,cssColor,cssTagName,cssPseudoClass,cssUrl,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,lessDefinition,lessComment,lessClassChar,lessVariable,lessMixinChar,lessAmpersandChar,lessFunction,@cssColors fold
line 17:
E409: Unknown group name: cssValue.*,@cssColors "me=e-1 means that the last char of the pattern is not highlighted
E475: Invalid argument: lessVariableValue ".*;"me=e-1 contained contains=lessVariable,lessOperator,lessDefault,cssValue.*,@cssColors "me=e-1 means that the last char of the pattern is not highlighted
Note: I'm using VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Jul 24 2012 11:16:47)
x {
table {
color: red;
} /* here always wrong indent */
}
Whenever I install this plugin (using pathogen, just adding as a submodule), opening any file becomes super slow (5 seconds).
Is there any way I could debug this and see whats going on?
I'm on OSX 10.9.1 / using VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Aug 26 2013 09:51:25)
EDIT: The problem disappears when I set syntax: off
in my .vimrc
but of course that's not really a solution.
If I have multiple Less or CSS rules on the same line, it breaks highlighting. For instance:
#container {
background: #000; color: #fff;
}
Will cause background to be highlighted correctly, as well as #000
but everything else on the line appears in blue.
IDs nested within other selectors aren't highlighted. For instance
ul {
#special-item {
color: red;
}
}
This happen only when I'm editing c source files.
Error detected while processing function 28_UpdateErrors..28_CacheErrors..SyntaxCheckers_c_GetLocList:
line 16:
E117: Unknown function: syntastic#c#GetIncludeDirs
E15: Invalid expression: ' '.shellescape(expand('%')). ' '.syntastic#c#GetIncludeDirs('c')
line 55:
E117: Unknown function: syntastic#c#ReadConfig
I believe Vim74 introduced some new syntax definitions, which is causing properties like "padding", "left", and "border" to be interpreted as cssUIAttr and not cssBoxProp. In my color scheme "padding-left" shows up green, but "padding" shows up purple. I'm not sure exactly how to fix it.
Could you please specify a free software license for vim-less? For instance you could use GPL, MIT, BSD, Apache or what ever you like, but please specify a license.
After minutes typing less files, vim get super slow. Up/Down movement take too much time. (1 second to move cursor 1 line up/down)
I have to :set syntax=
and then again :set syntax=less
to reset and all get normal again.
Any ideias what it could be? I'm having problem to track what is the cause.
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Sep 12 2016 13:38:39)
MacOS X (unix) version
Compiled by [email protected]
Huge version without GUI. Features included (+) or not (-):
+acl +file_in_path +mouse_sgr +tag_old_static
+arabic +find_in_path -mouse_sysmouse -tag_any_white
+autocmd +float +mouse_urxvt -tcl
-balloon_eval +folding +mouse_xterm +termguicolors
-browse -footer +multi_byte +terminfo
++builtin_terms +fork() +multi_lang +termresponse
+byte_offset -gettext -mzscheme +textobjects
+channel -hangul_input +netbeans_intg +timers
+cindent +iconv +num64 +title
-clientserver +insert_expand +packages -toolbar
+clipboard +job +path_extra +user_commands
+cmdline_compl +jumplist -perl +vertsplit
+cmdline_hist +keymap +persistent_undo +virtualedit
+cmdline_info +lambda +postscript +visual
+comments +langmap +printer +visualextra
+conceal +libcall +profile +viminfo
+cryptv +linebreak -python +vreplace
-cscope +lispindent -python3 +wildignore
+cursorbind +listcmds +quickfix +wildmenu
+cursorshape +localmap +reltime +windows
+dialog_con -lua +rightleft +writebackup
+diff +menu -ruby -X11
+digraphs +mksession +scrollbind -xfontset
-dnd +modify_fname +signs -xim
-ebcdic +mouse +smartindent -xpm
+emacs_tags -mouseshape +startuptime -xsmp
+eval +mouse_dec +statusline -xterm_clipboard
+ex_extra -mouse_gpm -sun_workshop -xterm_save
+extra_search -mouse_jsbterm +syntax
+farsi +mouse_netterm +tag_binary
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
defaults file: "$VIMRUNTIME/defaults.vim"
fall-back for $VIM: "/usr/local/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DMACOS_X_UNIX -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -L/usr/local/lib -o vim -lm -lncurses -liconv -framework Cocoa
vim-less raises a NameError when a variable is undefined. However, it ignores the fact that a variable might be defined somewhere else in an imported file.
.less are not being automatically recognised as less files. I'm not sure if something on my vim setup may be screwing up :\
This is my vimrc: https://github.com/fuadsaud/J.A.R.V.I.S/blob/master/vim/vimrc
Anything I could look at?
I have installed syntastic plugin.
When I install vim-less and open *.less file I get
"lib/bootstrap.less" 26L, 602C
Error detected while processing function <SNR>28_UpdateErrors..<SNR>28_CacheErrors..SyntaxCheckers_less_
GetLocList:
line 3:
E720: Missing colon in Dictionary: {'bufnr': bufnr(""), 'text': "Syntax error"} })
E116: Invalid arguments for function SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat, 'de
faults' {'bufnr': bufnr(""), 'text': "Syntax error"} })
E15: Invalid expression: SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat, 'defaults' {'bu
fnr': bufnr(""), 'text': "Syntax error"} })
Error detected while processing function <SNR>28_UpdateErrors..<SNR>28_CacheErrors:
line 6:
E712: Argument of extend() must be a List or Dictionary
E706: Variable type mismatch for: b:syntastic_loclist
If I re-indent a file containing nested rules such as the one below (using a command like gg=G
), the closing brace of the innermost nested rule is not properly indented.
ul.article {
width: 500px;
ul {
margin-left: 0;
li {
list-style-type: round;
}
}
}
ul.article {
width: 500px;
ul {
margin-left: 0;
li {
list-style-type: round;
}
}
}
Hi,
I made this plugin doing some copy / paste when I tried out VIM a while ago.
I no longer use VIM or LESS and I have very little experience doing VIM script.
Unfortunately, I am not qualified to fix the current problems with this plugin.
I hope someone more skilled can help or take over the repo.
Please contact me if you can help !
Gunther Groenewege
info (at) g-design.net
http://www.g-design.net
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.