icedman / nvim-textmate Goto Github PK
View Code? Open in Web Editor NEWA textmate-based syntax highlighter for neovim - compatible with VScode
License: GNU General Public License v2.0
A textmate-based syntax highlighter for neovim - compatible with VScode
License: GNU General Public License v2.0
When i select the theme with TxMtTheme
and try to enable it with TxMtEnable
i get no colors at all, it's all white.
When i try to disable it with TxMtDisable
i get this error:
Error executing Lua callback: ...ck/packer/start/nvim-textmate/lua/nvim-textmate/init.lua:430: attempt to concatenate field 'colors_name' (a nil value)
stack traceback:
...ck/packer/start/nvim-textmate/lua/nvim-textmate/init.lua:430: in function <...ck/packer/start/nvim-textmate/lua/nvim-textmate/init.lua:421>
Even though the plugin has been loaded, as evidenced by the "Compiling textmate module..." message, the user commands (TxMtEnable
, TxMtDisable
, etc) are not defined.
I haven't written any plugins myself, but judging by what I've seen in other plugins I think you ought to export a module with the required functions from the lua
directory and define the commands from the plugin
directory -- I'm not sure what the usual way to refer to this is, but where those instructions are placed affects when and how they are loaded by (neo)vim.
P.S.: The README says that the plugin is loaded with require('textmate')
, but that won't work because the module is called nvim-textmate
(the name coincides with the directory containing the init file under lua
). I attempted loading the plugin with both require('nvim-textmate')
and require('nvim-textmate').setup()
, but only the latter appeared to have any effect.
syntect is absolutely faster and powerful than original TextMate syntax highlighter.
I use NeoVim on Windows, but I do have WSL Ubuntu. Make doesn't really work well on Windows, so I ended up using WSL, and changed up some files to make it work somehow
diff --git a/libs/Onigmo/configure.ac b/libs/Onigmo/configure.ac
index f6841b1..a550396 100644
--- a/libs/Onigmo/configure.ac
+++ b/libs/Onigmo/configure.ac
@@ -1,7 +1,7 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT(onigmo, 6.2.0)
-AC_CONFIG_MACRO_DIR([m4])
+# AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([foreign subdir-objects])
AC_CONFIG_HEADER(config.h)
diff --git a/libs/tm-parser/textmate/extensions/extension.cpp b/libs/tm-parser/textmate/extensions/extension.cpp
index b7723d1..e766a43 100644
--- a/libs/tm-parser/textmate/extensions/extension.cpp
+++ b/libs/tm-parser/textmate/extensions/extension.cpp
@@ -132,21 +132,27 @@ void load_extensions(const std::string _path,
for (const auto& extensionPath : enumerate_dir(path)) {
std::string package = extensionPath + "/package.json";
std::string packageNLS = extensionPath + "/package.nls.json";
+ Json::Value p = parse::loadJson(package);
// log("extension: %s\n", package.c_str());
struct extension_t ex = { .id = "",
.publisher = "",
+ .name = "",
.path = extensionPath,
+ .base_path = "",
+ .nlsPath = packageNLS,
+ .package=p,
+ .nls=p,
.hasThemes = false,
.hasIcons = false,
.hasGrammars = false,
.hasCommands = false,
- .addToHistory = false };
+ .addToHistory = false,
+ .nlsLoaded = false,
+ .grammars={}
+ };
- ex.nlsPath = packageNLS;
- ex.nlsLoaded = false;
- ex.package = parse::loadJson(package);
if (!ex.package.isObject()) {
continue;
}
diff --git a/libs/tm-parser/textmate/textmate.cpp b/libs/tm-parser/textmate/textmate.cpp
index 6a9ec73..97a8c56 100644
--- a/libs/tm-parser/textmate/textmate.cpp
+++ b/libs/tm-parser/textmate/textmate.cpp
@@ -160,6 +160,7 @@ std::vector<list_item_t> Textmate::theme_extensions()
list_item_t item = {
.name = ext.package["id"].asString(),
.description = ext.package["description"].asString(),
+ .icon="",
.value = ext.path + "/" + themes[i]["path"].asString()
};
@@ -212,6 +213,7 @@ std::vector<list_item_t> Textmate::grammar_extensions()
list_item_t item = {
.name = lang["id"].asString(),
.description = ext.package["description"].asString(),
+ .icon="",
.value = ex.asString()
};
res.push_back(item);
But transferring the ./lua/nvim-textmate
to my AppData/Local/nvim/lua
doesn't work. As it says Done. Restart NeoVim
, and I'm unable to use any of the commands.
Every time i open NeoVim i get the message "Done. Restart NeoVim.". In order to find out why it didn't work i decided to build from ~/.local/share/nvim/lazy/nvim-textmate
and got the next error message when running make
...
config.status: executing libtool commands
config.status: executing default commands
mkdir -p build
cd build && cmake ../cmake && make
-- Configuring done (0.0s)
CMake Error at CMakeLists.txt:82 (add_library):
Cannot find source file:
../libs/jsoncpp/dist/jsoncpp.cpp
Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .ixx .cppm
.ccm .cxxm .c++m .h .hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90
.f95 .f03 .hip .
CMake Error at CMakeLists.txt:82 (add_library):
No SOURCES given to target:
CMake Generate step failed. Build files cannot be regenerated correctly.
make: *** [Makefile:10: build] Error 1
Printing the output from vim.fn.system({ "make", "build", "-C", target_path })
in ~/.local/share/nvim/lazy/nvim-textmate/lua/nvim-textmate/init.lua
gives the same error message. The error comes from ../cmake/CMakeList.txt
in the
add_library( textmate
SHARED
...
section.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.