mirror of
https://github.com/tpope/vim-haml.git
synced 2025-12-08 01:54:45 +08:00
Proper 'define' support
Guessing I'm going to get some push back on the iskeyword tweak, but man is this useful. Press [d on a variable to see its value. Press [<C-D> on a mixin to jump to its definition. Placeholder classes and functions work too.
This commit is contained in:
@@ -9,15 +9,18 @@ if exists("b:did_ftplugin")
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let b:undo_ftplugin = "setl com< cms< def< inc< inex< ofu< sua<"
|
||||
let b:undo_ftplugin = "setl com< cms< def< inc< inex< isk< ofu< sua<"
|
||||
|
||||
setlocal comments=://
|
||||
setlocal commentstring=//\ %s
|
||||
setlocal define=^\\s*\\%(@mixin\\\|=\\)
|
||||
setlocal includeexpr=SassIncludeExpr(v:fname)
|
||||
setlocal iskeyword+=-
|
||||
setlocal iskeyword+=$
|
||||
setlocal iskeyword+=%
|
||||
setlocal omnifunc=csscomplete#CompleteCSS
|
||||
setlocal suffixesadd=.sass,.scss,.css
|
||||
|
||||
let &l:define = '^\C\v\s*%(\@function|\@mixin|\=)|^\s*%(\$[[:alnum:]-]+:|[%.][:alnum:]-]+\s*%(\{|$))@='
|
||||
let &l:include = '^\s*@import\s\+\%(url(\)\=["'']\='
|
||||
|
||||
function! SassIncludeExpr(file) abort
|
||||
|
||||
Reference in New Issue
Block a user