| 
									
										
										
										
											2008-07-13 17:41:49 +00:00
										 |  |  | " Vim filetype plugin | 
					
						
							| 
									
										
										
										
											2010-07-26 22:21:27 +02:00
										 |  |  | " Language:	Sass | 
					
						
							|  |  |  | " Maintainer:	Tim Pope <vimNOSPAM@tpope.org> | 
					
						
							| 
									
										
										
										
											2019-12-05 22:47:25 +01:00
										 |  |  | " Last Change:	2019 Dec 05 | 
					
						
							| 
									
										
										
										
											2008-07-13 17:41:49 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Only do this when not done yet for this buffer | 
					
						
							|  |  |  | if exists("b:did_ftplugin") | 
					
						
							|  |  |  |   finish | 
					
						
							|  |  |  | endif | 
					
						
							|  |  |  | let b:did_ftplugin = 1 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  | let b:undo_ftplugin = "setl com< cms< def< inc< inex< ofu< sua<" | 
					
						
							| 
									
										
										
										
											2008-07-13 17:41:49 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  | setlocal comments=:// | 
					
						
							| 
									
										
										
										
											2008-07-13 17:41:49 +00:00
										 |  |  | setlocal commentstring=//\ %s | 
					
						
							| 
									
										
										
										
											2019-12-05 22:47:25 +01:00
										 |  |  | setlocal includeexpr=SassIncludeExpr(v:fname) | 
					
						
							| 
									
										
										
										
											2008-07-13 17:41:49 +00:00
										 |  |  | setlocal omnifunc=csscomplete#CompleteCSS | 
					
						
							| 
									
										
										
										
											2010-07-26 22:21:27 +02:00
										 |  |  | setlocal suffixesadd=.sass,.scss,.css | 
					
						
							| 
									
										
										
										
											2019-12-05 22:47:25 +01:00
										 |  |  | if &filetype =~# '\<s[ac]ss]\>' | 
					
						
							|  |  |  |   setlocal iskeyword+=- | 
					
						
							|  |  |  |   setlocal iskeyword+=$ | 
					
						
							|  |  |  |   setlocal iskeyword+=% | 
					
						
							|  |  |  |   let b:undo_ftplugin .= ' isk<' | 
					
						
							|  |  |  | endif | 
					
						
							| 
									
										
										
										
											2008-07-13 17:41:49 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-12-05 22:47:25 +01:00
										 |  |  | let &l:define = '^\C\v\s*%(\@function|\@mixin|\=)|^\s*%(\$[[:alnum:]-]+:|[%.][:alnum:]-]+\s*%(\{|$))@=' | 
					
						
							| 
									
										
										
										
											2010-07-26 22:21:27 +02:00
										 |  |  | let &l:include = '^\s*@import\s\+\%(url(\)\=["'']\=' | 
					
						
							| 
									
										
										
										
											2008-07-13 17:41:49 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-12-05 22:47:25 +01:00
										 |  |  | function! SassIncludeExpr(file) abort | 
					
						
							|  |  |  |   let partial = substitute(a:file, '\%(.*/\|^\)\zs', '_', '') | 
					
						
							|  |  |  |   if !empty(findfile(partial)) | 
					
						
							|  |  |  |     return partial | 
					
						
							|  |  |  |   endif | 
					
						
							|  |  |  |   return a:file | 
					
						
							|  |  |  | endfunction | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-07-13 17:41:49 +00:00
										 |  |  | " vim:set sw=2: |