tv vim: move showsyntax to overlay
This commit is contained in:
parent
9b573a35f2
commit
35dcd45cd5
@ -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
|
||||
|
26
tv/5pkgs/vim/showsyntax.nix
Normal file
26
tv/5pkgs/vim/showsyntax.nix
Normal file
@ -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()
|
||||
'';
|
||||
}))
|
Loading…
Reference in New Issue
Block a user