diff options
author | tv <tv@krebsco.de> | 2016-06-09 00:53:41 +0200 |
---|---|---|
committer | tv <tv@krebsco.de> | 2016-06-09 04:28:02 +0200 |
commit | 40204421d2285c9c56fcb258f37b7d414c2daad1 (patch) | |
tree | 06dcd6ec13a02f6383f1a620e7ffa088ad91f426 | |
parent | 1b8cf55078c65a1d37b1d3d9aa01a63e8467b514 (diff) |
tv vim: let {hs,nix}.vim
-rw-r--r-- | tv/2configs/vim.nix | 68 |
1 files 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 <nix/src/libexpr/lexer.l> - 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 <esc>[d <nop> | noremap! <esc>[d <nop> vnoremap u <nop> ''; + + 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 <nix/src/libexpr/lexer.l> + 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 |