1
0
mirror of https://github.com/amix/vimrc synced 2025-07-08 18:04:59 +08:00

Use sources_non_forked folder for pathogen path, with sources_non_forked_fallback folder as fallback.

This commit is contained in:
Wu Tingfeng
2022-11-21 22:56:20 +08:00
parent dddd2e4152
commit d9555d618c
1756 changed files with 4 additions and 250 deletions

View File

@ -0,0 +1 @@
*.swp

View File

@ -0,0 +1,55 @@
# VIM-LESS
This vim bundle adds syntax highlighting, indenting and autocompletion for the dynamic stylesheet language [LESS](http://lesscss.org).
This bundle is compatible with [vim-css-color](https://github.com/skammer/vim-css-color),
[vim-css3-syntax](https://github.com/hail2u/vim-css3-syntax) and possibly other plugins that place code
in `after/syntax/css.vim` or `after/syntax/css/*.vim`.
![vim-less with vim-css-color and vim-css3-syntax (colorscheme solarized)](https://github.com/lenniboy/vim-less/raw/master/screenshot.png)
## Installing and Using
- Install [pathogen](http://www.vim.org/scripts/script.php?script_id=2332) into `~/.vim/autoload/` and add the
following line to your `~/.vimrc`:
call pathogen#infect()
- Make a clone of the `vim-less` repository:
$ mkdir -p ~/.vim/bundle
$ cd ~/.vim/bundle
$ git clone https://github.com/groenewege/vim-less
- OR use [vundle](https://github.com/gmarik/vundle), adding this line to your `~/.vimrc`:
Plugin 'groenewege/vim-less'
- OR use [neobundle](https://github.com/Shougo/neobundle.vim), adding this line to your `~/.vimrc`:
NeoBundle 'groenewege/vim-less'
- OR use git submodules:
$ git submodule add https://github.com/groenewege/vim-less.git bundle/vim-less
$ git submodule init
### Map
.less to .css , lessc is required.
nnoremap <Leader>m :w <BAR> !lessc % > %:t:r.css<CR><space>
## Credits
Inspiration from [vim-haml](https://github.com/tpope/vim-haml),
[scss-syntax.vim](https://github.com/cakebaker/scss-syntax.vim) and
[vim-less](https://github.com/lunaru/vim-less)
## License ##
MIT : [groenewege.mit-license.org](http://groenewege.mit-license.org/)

View File

@ -0,0 +1,26 @@
if !exists("g:less_html_style_tags")
let g:less_html_style_tags = 1
endif
if !g:less_html_style_tags
finish
endif
" Unset (but preserve) so that less will run.
if exists("b:current_syntax")
let s:pre_less_cur_syn = b:current_syntax
unlet b:current_syntax
endif
" Inspired by code from github.com/kchmck/vim-coffee-script
" and the html syntax file included with vim 7.4.
syn include @htmlLess syntax/less.vim
" We have to explicitly add to htmlHead (containedin) as that region specifies 'contains'.
syn region lessStyle start=+<style [^>]*type *=[^>]*text/less[^>]*>+ keepend end=+</style>+ contains=@htmlLess,htmlTag,htmlEndTag,htmlCssStyleComment,@htmlPreproc containedin=htmlHead
" Reset since 'less' isn't really the current_syntax.
if exists("s:pre_less_cur_syn")
let b:current_syntax = s:pre_less_cur_syn
endif

View File

@ -0,0 +1 @@
autocmd BufNewFile,BufRead *.less setf less

View File

@ -0,0 +1,26 @@
" Vim filetype plugin
" Language: LessCSS
" Author: Tim Pope <vimNOSPAM@tpope.org>
" Maintainer: Leonard Ehrenfried <leonard.ehrenfried@web.de>
" Last Change: 2011 Sep 30
" Only do this when not done yet for this buffer
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
let b:undo_ftplugin = "setl cms< def< inc< inex< ofu< sua<"
setlocal iskeyword+=-
setlocal commentstring=//%s
setlocal define=^\\s*\\%(@mixin\\\|=\\)
setlocal includeexpr=substitute(v:fname,'\\%(.*/\\\|^\\)\\zs','_','')
setlocal omnifunc=csscomplete#CompleteCSS
setlocal suffixesadd=.less
setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,://
setlocal fo=croql
let &l:include = '^\s*@import\s\+\%(url(\)\=["'']\='
" vim:set sw=2:

View File

@ -0,0 +1,10 @@
" Vim indent file
" Language: LessCSS
" Maintainer: Leonard Ehrenfried <leonard.ehrenfried@web.de>
" Last Change: 2011 Sep 26
if exists("b:did_indent")
finish
endif
runtime! indent/css.vim

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

View File

@ -0,0 +1,64 @@
if exists("b:current_syntax")
finish
endif
runtime! syntax/css.vim
runtime! after/syntax/css.vim
" load files from vim-css3-syntax plugin (https://github.com/hail2u/vim-css3-syntax)
runtime! after/syntax/css/*.vim
syn case ignore
syn region 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,lessNestedSelector,@cssColors fold
syn match lessVariable "@[[:alnum:]_-]\+" contained
syn match lessVariable "@[[:alnum:]_-]\+" nextgroup=lessVariableAssignment skipwhite
syn match lessVariableAssignment ":" contained nextgroup=lessVariableValue skipwhite
syn match 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
syn match lessOperator "+" contained
syn match lessOperator "-" contained
syn match lessOperator "/" contained
syn match lessOperator "*" contained
syn match lessNestedSelector "[^/]* {"me=e-1 contained contains=cssTagName,cssAttributeSelector,lessAmpersandChar,lessVariable,lessMixinChar,lessFunction,lessNestedProperty
syn match lessNestedProperty "[[:alnum:]]\+:"me=e-1 contained
syn match lessDefault "!default" contained
syn match lessMixinChar "\.[[:alnum:]_-]\@=" contained nextgroup=lessClass
syn match lessAmpersandChar "&" contained nextgroup=lessClass,cssPseudoClass
syn match lessClass "[[:alnum:]_-]\+" contained
" functions {{{
" string functions
syn keyword lessFunction escape e % containedin=cssDefinition contained
" misc functions
syn keyword lessFunction unit containedin=cssDefinition contained
" math functions
syn keyword lessFunction ceil floor percentage round containedin=cssDefinition contained
" color definition
syn keyword lessFunction rgb rgba argb hsl hsla hsv hsva containedin=cssDefinition contained
" color channel information
syn keyword lessFunction hue saturation lightness red green blue alpha luma containedin=cssDefinition contained
" color operations
syn keyword lessFunction saturate desaturate lighten darken fadein fadeout fade spin mix greyscale contrast containedin=cssDefinition contained
" color blending
syn keyword lessFunction multiply screen overlay softlight hardlight difference exclusion average negation containedin=cssDefinition contained
" }}}
syn match lessComment "//.*$" contains=@Spell
hi def link lessVariable Special
hi def link lessVariableValue Constant
hi def link lessDefault Special
hi def link lessComment Comment
hi def link lessFunction Function
hi def link lessMixinChar Special
hi def link lessAmpersandChar Special
hi def link lessNestedProperty Type
hi def link lessClass PreProc
let b:current_syntax = "less"