Adds syntax highlighting for links and link numbers

This commit is contained in:
sloum 2023-07-06 13:55:42 -07:00
parent 4e2cbc0187
commit 40f286ec30
2 changed files with 24 additions and 0 deletions

View File

@ -4,6 +4,7 @@ LANGNAME := netclient
DOC := /doc
PLUG := /plugin
FT := /ftplugin
SYNTAX := /syntax
ifeq ($(OS), Windows_NT)
ROOT := $(HOME)/vimfiles
@ -19,9 +20,11 @@ install: .${PLUG}/${LANGNAME}.vim .${DOC}/${LANGNAME}.txt
install -d ${ROOT}${DOC}
install -d ${ROOT}${PLUG}
install -d ${ROOT}${FT}
install -d ${ROOT}${SYNTAX}
install -m 0644 .${DOC}/${LANGNAME}.txt ${ROOT}${DOC}
install -m 0644 .${PLUG}/${LANGNAME}.vim ${ROOT}${PLUG}
install -m 0644 .${FT}/${LANGNAME}.vim ${ROOT}${FT}
install -m 0644 .${SYNTAX}/${LANGNAME}.vim ${ROOT}${SYNTAX}
vim -c 'execute ":helptags ~/.vim/doc"|q'
.PHONY: remove
@ -29,4 +32,5 @@ remove:
rm -rf ${ROOT}${DOC}/${LANGNAME}.txt
rm -rf ${ROOT}${PLUG}/${LANGNAME}.vim
rm -rf ${ROOT}${FT}/${LANGNAME}.vim
rm -rf ${ROOT}${SYNTAX}/${LANGNAME}.vim
vim -c 'execute ":helptags ~/.vim/doc"|q'

20
syntax/netclient.vim Normal file
View File

@ -0,0 +1,20 @@
" Vim syntax file
" Language: netclient
" Maintainer: sloum <sloum@rawtext.club>,
" Last Change: Thu Jul 06 2023
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish
endif
let b:current_syntax = "netclient"
syn match ncLinkNum "\[\d\+\]"
syn match ncURL "\S\+:\/\/\S\+\(\t\S\+\)\?" contains=ncLinkNum
hi link ncLinkNum Identifier
hi link ncURL Statement