summaryrefslogtreecommitdiffstats
path: root/tv/2configs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2016-06-09 00:53:41 +0200
committertv <tv@krebsco.de>2016-06-09 04:28:02 +0200
commitf9ebab44e454a436541962790f27d686583cfe30 (patch)
tree36d6a384ca4bbcc905540ba9bdf525e6e7a90d91 /tv/2configs
parent276bbe725f5d0321b8f4557917a6913b5945df7a (diff)
tv vim: let {hs,nix}.vim
Diffstat (limited to 'tv/2configs')
-rw-r--r--tv/2configs/vim.nix68
1 files changed, 36 insertions, 32 deletions
diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix
index 10e5aab52..21fb6cd44 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