vim_configurable: replace default ftNix patch with sources from vim-nix

+7 -77
+6
pkgs/applications/editors/vim/configurable.nix
··· 4 , composableDerivation, writeText, lib, config, glib, gtk2, gtk3, python, perl, tcl, ruby 5 , libX11, libXext, libSM, libXpm, libXt, libXaw, libXau, libXmu 6 , libICE 7 8 # apple frameworks 9 , CoreServices, CoreData, Cocoa, Foundation, libobjc, cf-private ··· 80 flags = { 81 ftNix = { 82 patches = [ ./ft-nix-support.patch ]; 83 }; 84 } 85 // edf {
··· 4 , composableDerivation, writeText, lib, config, glib, gtk2, gtk3, python, perl, tcl, ruby 5 , libX11, libXext, libSM, libXpm, libXt, libXaw, libXau, libXmu 6 , libICE 7 + , vimPlugins 8 9 # apple frameworks 10 , CoreServices, CoreData, Cocoa, Foundation, libobjc, cf-private ··· 81 flags = { 82 ftNix = { 83 patches = [ ./ft-nix-support.patch ]; 84 + preConfigure = '' 85 + cp ${vimPlugins.vim-nix.src}/ftplugin/nix.vim runtime/ftplugin/nix.vim 86 + cp ${vimPlugins.vim-nix.src}/indent/nix.vim runtime/indent/nix.vim 87 + cp ${vimPlugins.vim-nix.src}/syntax/nix.vim runtime/syntax/nix.vim 88 + ''; 89 }; 90 } 91 // edf {
+1 -77
pkgs/applications/editors/vim/ft-nix-support.patch
··· 6 " Z80 assembler asz80 7 au BufNewFile,BufRead *.z8a setf z8a 8 9 - +" NIX 10 +au BufNewFile,BufRead *.nix setf nix 11 + 12 augroup END ··· 18 unlet s:cpo_save 19 + 20 + 21 - diff --git a/runtime/syntax/nix.vim b/runtime/syntax/nix.vim 22 - new file mode 100644 23 - index 0000000..a2f9918 24 - --- /dev/null 25 - +++ b/runtime/syntax/nix.vim 26 - @@ -0,0 +1,56 @@ 27 - +" Vim syntax file 28 - +" Language: nix 29 - +" Maintainer: Marc Weber <marco-oweber@gmx.de> 30 - +" Modify and commit if you feel that way 31 - +" Last Change: 2011 Jun 32 - +" 33 - +" this syntax file can be still be enhanced very much.. 34 - +" Don't ask, do it :-) 35 - +" This file (github.com/MarcWeber/vim-addon-nix) is periodically synced with 36 - +" the patch found in vim_configurable (nixpkgs) 37 - + 38 - +" Quit when a (custom) syntax file was already loaded 39 - +if exists("b:current_syntax") 40 - + finish 41 - +endif 42 - + 43 - + 44 - +sy cluster nixStrings contains=nixStringParam,nixStringIndented 45 - + 46 - +syn keyword nixKeyword let throw inherit import true false null with 47 - +syn keyword nixConditional if else then 48 - +syn keyword nixBrace ( ) { } = 49 - +syn keyword nixBuiltin __currentSystem __currentTime __isFunction __getEnv __trace __toPath __pathExists 50 - + \ __readFile __toXML __toFile __filterSource __attrNames __getAttr __hasAttr __isAttrs __listToAttrs __isList 51 - + \ __head __tail __add __sub __lessThan __substring __stringLength 52 - + 53 - +syn region nixStringIndented start=+''+ skip=+'''\|''${\|"+ end=+''+ contains=nixStringParam 54 - +" syn region nixString start=+"+ skip=+\\"+ end=+"+ 55 - +syn match nixAttr "\w\+\ze\s*=" 56 - +syn match nixFuncArg "\zs\w\+\ze\s*:" 57 - +syn region nixStringParam start=+\${+ end=+}+ contains=@nixStrings 58 - +syn region nixMultiLineComment start=+/\*+ skip=+\\"+ end=+\*/+ 59 - +syn match nixEndOfLineComment "#.*$" 60 - + 61 - +hi def link nixKeyword Keyword 62 - +hi def link nixConditional Conditional 63 - +hi def link nixBrace Special 64 - +hi def link nixString String 65 - +hi def link nixStringIndented String 66 - +hi def link nixBuiltin Special 67 - +hi def link nixStringParam Macro 68 - +hi def link nixMultiLineComment Comment 69 - +hi def link nixEndOfLineComment Comment 70 - +hi def link nixAttr Identifier 71 - +hi def link nixFuncArg Identifier 72 - + 73 - +syn sync maxlines=20000 74 - +syn sync minlines=50000 75 - + 76 - +let b:current_syntax = "nix" 77 - + 78 - +" thanks to domenkozar 79 - +" scan backwards to find begining of multiline statements 80 - +syn sync ccomment nixMultiLineComment minlines=10 maxlines=500 81 - +syn sync ccomment nixStringIndented minlines=10 maxlines=500 82 - +syn sync ccomment nixString maxlines=10 83 - diff --git a/runtime/ftplugin/nix.vim b/runtime/ftplugin/nix.vim 84 - new file mode 100644 85 - --- /dev/null 86 - +++ b/runtime/ftplugin/nix.vim 87 - @@ -0,0 +1,2 @@ 88 - +" Only do this when not done yet for this buffer 89 - +if exists("b:did_ftplugin") 90 - + finish 91 - +endif 92 - +let b:did_ftplugin = 1 93 - + 94 - +" coding conventions 95 - +setlocal shiftwidth=2 expandtab softtabstop=2 96 - +let b:undo_ftplugin = "setlocal sw< et< sts<"
··· 6 " Z80 assembler asz80 7 au BufNewFile,BufRead *.z8a setf z8a 8 9 + +" Nix 10 +au BufNewFile,BufRead *.nix setf nix 11 + 12 augroup END ··· 18 unlet s:cpo_save 19 + 20 +