diff options
author | tv <tv@krebsco.de> | 2019-05-21 21:57:24 +0200 |
---|---|---|
committer | tv <tv@krebsco.de> | 2019-05-21 22:03:00 +0200 |
commit | d1fb692813a8d114c98e22e05bf8c8ba826bc023 (patch) | |
tree | 237ad00814caea84360240bac452e6271b2b4748 /tv | |
parent | 52a58bc149146140413e5299609759a589681e8a (diff) |
tv vim: move showsyntax to overlay
Diffstat (limited to 'tv')
-rw-r--r-- | tv/2configs/vim.nix | 25 | ||||
-rw-r--r-- | tv/5pkgs/vim/showsyntax.nix | 26 |
2 files changed, 27 insertions, 24 deletions
diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix index 18b6931..8195786 100644 --- a/tv/2configs/vim.nix +++ b/tv/2configs/vim.nix @@ -19,33 +19,10 @@ let { pkgs.tv.vimPlugins.fzf pkgs.tv.vimPlugins.hack pkgs.tv.vimPlugins.jq + pkgs.tv.vimPlugins.showsyntax pkgs.tv.vimPlugins.vim pkgs.vimPlugins.fzfWrapper pkgs.vimPlugins.undotree - ((rtp: rtp // { inherit rtp; }) (pkgs.writeTextFile (let - name = "showsyntax"; - in { - name = "vim-plugin-${name}-1.0.0"; - destination = "/plugin/${name}.vim"; - text = /* vim */ '' - if exists('g:loaded_showsyntax') - finish - endif - let g:loaded_showsyntax = 0 - - fu! ShowSyntax() - let id = synID(line("."), col("."), 1) - let name = synIDattr(id, "name") - let transName = synIDattr(synIDtrans(id),"name") - if name != transName - let name .= " (" . transName . ")" - endif - echo "Syntax: " . name - endfu - - command! -n=0 -bar ShowSyntax :call ShowSyntax() - ''; - }))) ((rtp: rtp // { inherit rtp; }) (pkgs.write "vim-tv" { # # Haskell diff --git a/tv/5pkgs/vim/showsyntax.nix b/tv/5pkgs/vim/showsyntax.nix new file mode 100644 index 0000000..a5547e4 --- /dev/null +++ b/tv/5pkgs/vim/showsyntax.nix @@ -0,0 +1,26 @@ +{ pkgs }: + +(rtp: rtp // { inherit rtp; }) (pkgs.writeTextFile (let + name = "showsyntax"; +in { + name = "vim-plugin-${name}-1.0.0"; + destination = "/plugin/${name}.vim"; + text = /* vim */ '' + if exists('g:loaded_showsyntax') + finish + endif + let g:loaded_showsyntax = 0 + + fu! ShowSyntax() + let id = synID(line("."), col("."), 1) + let name = synIDattr(id, "name") + let transName = synIDattr(synIDtrans(id),"name") + if name != transName + let name .= " (" . transName . ")" + endif + echo "Syntax: " . name + endfu + + command! -n=0 -bar ShowSyntax :call ShowSyntax() + ''; +})) |