matkarlg / nvim-textmate

A textmate-based syntax highlighter for neovim - compatible with VScode

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

nvim-textmate

A textmate-based syntax highlighter to nvim, compatible with VScode themes and grammars

Screen Shot

install

git clone http://github.com/icedman/nvim-textmate
cd nvim-textmate
make

packer.nvim

use "icedman/nvim-textmate"

setup

-- init.lua
require('nvim-textmate')


or with setup options
require('nvim-textmate').setup({
    quick_load = true,
    theme_name = 'Dracula',
    override_colorscheme = false
})

setup options

  • quick_load - defers loading of grammar and theme at the opening of a buffer
  • theme_name - select a textmate format or vscode compatible theme
  • override_colorscheme - apply colorscheme from textmate theme
  • custom_scope_map - add more scope to namespace mapping (see colormap.lua)
  • extension_paths - set vscode extension search path
  • debug_scopes - print scope name under cursor

extensions

Copy vscode theme and grammar extensions to any of these directories: Copy from /usr/lib/code/extensions on Arch Linux. For Ubuntu it's another directory

~/.config/nvim/lua/nvim-textmate/
~/.editor/extensions/
~/.vscode/extensions/

commands

  • TxMtEnable
  • TxMtDisable
  • TxMtToggle
  • TxMtTheme
  • TxMtDebugScopes

known issues

  • a colorscheme must be loaded prior to running nvim-textmate
  • cpp - Some grammars take a bit of time to load. cpp, the largest grammar file causes a visible lag on first load; hence the quick_load option is available.
  • markdown - Other grammars - like markdown will load other grammar languages for inline code and will re-render after the other languages are loaded.
  • scrolling and text editing - syntax highlighting is currently done at these events as a debounced (defer_fn) function.

warning

  • This plugin is just a proof of concept - from a novice lua coder, and much worse - from a non neovim user (not yet at least)

About

A textmate-based syntax highlighter for neovim - compatible with VScode

License:GNU General Public License v2.0


Languages

Language:C 56.9%Language:JavaScript 33.0%Language:C++ 7.9%Language:Python 1.0%Language:Ruby 0.4%Language:CMake 0.2%Language:Makefile 0.1%Language:SCSS 0.1%Language:Lua 0.1%Language:Shell 0.1%Language:Meson 0.0%Language:HTML 0.0%Language:TypeScript 0.0%Language:Groovy 0.0%Language:CSS 0.0%Language:Perl 0.0%Language:M4 0.0%Language:PowerShell 0.0%Language:Objective-C 0.0%Language:Go 0.0%Language:Clojure 0.0%Language:PHP 0.0%Language:Handlebars 0.0%Language:Less 0.0%Language:Starlark 0.0%Language:Visual Basic .NET 0.0%Language:F# 0.0%Language:CoffeeScript 0.0%Language:Java 0.0%Language:Batchfile 0.0%Language:Rust 0.0%Language:C# 0.0%Language:Dockerfile 0.0%Language:R 0.0%Language:ShaderLab 0.0%Language:Swift 0.0%Language:Pug 0.0%