From 40204421d2285c9c56fcb258f37b7d414c2daad1 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 9 Jun 2016 00:53:41 +0200 Subject: tv vim: let {hs,nix}.vim --- tv/2configs/vim.nix | 68 ++++++++++++++++++++++++++++------------------------- 1 file changed, 36 insertions(+), 32 deletions(-) diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix index 10e5aab..21fb6cd 100644 --- a/tv/2configs/vim.nix +++ b/tv/2configs/vim.nix @@ -88,38 +88,9 @@ let \ | hi TrailingSpace ctermbg=88 \ | hi Normal ctermfg=White - au BufRead,BufNewFile *.hs so ${pkgs.writeText "hs.vim" '' - syn region String start=+\[[[:alnum:]]*|+ end=+|]+ - ''} - - au BufRead,BufNewFile *.nix so ${pkgs.writeText "nix.vim" '' - setf nix - set isk=@,48-57,_,192-255,-,' - - " Ref - syn match INT /\<[0-9]\+\>/ - syn match PATH /[a-zA-Z0-9\.\_\-\+]*\(\/[a-zA-Z0-9\.\_\-\+]\+\)\+/ - syn match HPATH /\~\(\/[a-zA-Z0-9\.\_\-\+]\+\)\+/ - syn match SPATH /<[a-zA-Z0-9\.\_\-\+]\+\(\/[a-zA-Z0-9\.\_\-\+]\+\)*>/ - syn match URI /[a-zA-Z][a-zA-Z0-9\+\-\.]*:[a-zA-Z0-9\%\/\?\:\@\&\=\+\$\,\-\_\.\!\~\*\']\+/ - hi link INT Constant - hi link PATH Constant - hi link HPATH Constant - hi link SPATH Constant - hi link URI Constant - - syn match String /"\([^\\"]\|\\.\)*"/ - syn match Comment /\(^\|\s\)#.*/ - - " Haskell comments - syn region Comment start=/\(^\|\s\){-#/ end=/#-}/ - syn match Comment /\(^\|\s\)--.*/ - - " Vim comments - syn match Comment /\(^\|\s\)"[^"]*$/ - - let b:current_syntax = "nix" - ''} + au BufRead,BufNewFile *.hs so ${hs.vim} + + au BufRead,BufNewFile *.nix so ${nix.vim} au BufRead,BufNewFile /dev/shm/* set nobackup nowritebackup noswapfile @@ -152,5 +123,38 @@ let noremap [d | noremap! [d vnoremap u ''; + + hs.vim = pkgs.writeText "hs.vim" '' + syn region String start=+\[[[:alnum:]]*|+ end=+|]+ + ''; + + nix.vim = pkgs.writeText "nix.vim" '' + setf nix + set isk=@,48-57,_,192-255,-,' + + " Ref + syn match INT /\<[0-9]\+\>/ + syn match PATH /[a-zA-Z0-9\.\_\-\+]*\(\/[a-zA-Z0-9\.\_\-\+]\+\)\+/ + syn match HPATH /\~\(\/[a-zA-Z0-9\.\_\-\+]\+\)\+/ + syn match SPATH /<[a-zA-Z0-9\.\_\-\+]\+\(\/[a-zA-Z0-9\.\_\-\+]\+\)*>/ + syn match URI /[a-zA-Z][a-zA-Z0-9\+\-\.]*:[a-zA-Z0-9\%\/\?\:\@\&\=\+\$\,\-\_\.\!\~\*\']\+/ + hi link INT Constant + hi link PATH Constant + hi link HPATH Constant + hi link SPATH Constant + hi link URI Constant + + syn match String /"\([^\\"]\|\\.\)*"/ + syn match Comment /\(^\|\s\)#.*/ + + " Haskell comments + syn region Comment start=/\(^\|\s\){-#/ end=/#-}/ + syn match Comment /\(^\|\s\)--.*/ + + " Vim comments + syn match Comment /\(^\|\s\)"[^"]*$/ + + let b:current_syntax = "nix" + ''; in out -- cgit v1.2.3