nvim-web-devicons not working in nvim-tree.lua - neovim

I am using MesloLGL Nerd Font Mono in PowerShell. Although nvim-web-devicons works in telescope and other plugins it doesn't seem to work in nvim-tree
use({
"kyazdani42/nvim-tree.lua",
config = [[require('config.nvim-tree')]],
requires = {
"kyazdani42/nvim-web-devicons", -- optional, for file icons
},
})
nvim-config

Related

Can I show an image in a HoverProvider?

I am new to vscode extension development so not sure best places to look for help. I want to hover over a word, and if that word matches the name in our icon directory, show a hover with that image. My first try was to use markdown to show the svg image from the web, but I believe that is not allowed for security that code could be executed. Can I show an svg in the markdown in a vscode.Hover? I can either include the svgs in the extension, or expect that the developer has already installed the npm package with the files into the workspace.
There is actually quite rich support for content and styling in MarkdownString in hovers.
You can use svg's directly this way:
const icon = new vscode.MarkdownString('<img src="icon.svg"/>');
icon.baseUri = vscode.Uri.file(path.join(context.extensionPath, 'images', path.sep));
The baseUri property is crucial. Here it gets the svgs from an images folder.
In the below I added the png images to an extension images folder. You can detect what word is hovered and load the corresponding icon.
Below is testing in a plaintext file:
// with this require/import
const path = require('path');
// ...
let disposable4 = vscode.languages.registerHoverProvider('plaintext', {
provideHover(document, position) {
// one way to find the current hovered word
// note that what is a 'word' is languaged-defined and typically does not include hyphens
// const word = document.getText(document.getWordRangeAtPosition(position));
// first check if there is an icon for the hovered word, if not return undefined
// glob the images folder and find 'icon'.svg
// const icon = new vscode.MarkdownString(`<img src="${word}.svg"/>`);
// dimensions not necessary if you aren't changing them
const content = new vscode.MarkdownString(`<img src="favicon144.png" width=144 height=144/>`);
content.appendMarkdown(`$(zap)`); // notice the little "zap" icon in the hover
content.supportHtml = true;
content.isTrusted = true;
content.supportThemeIcons = true; // to supports codicons
// baseUri was necessary, full path in the img src did not work
// with your icons stroed in the 'images' directory
content.baseUri = vscode.Uri.file(path.join(context.extensionPath, 'images', path.sep));
return new vscode.Hover(content, new vscode.Range(position, position));
}
});
There's only very limited Markdown support in hover items and images are not supported there at all, as far as I know.

How do I open a game compiled for WebGL in Unity in Blazor?

I have created a Blazor Server project. In it, I wanted to put my WebGL game created in Unity3d on a separate page. In the end, after doing everything according to the example, I still can't get it to work. Although, I think, all things considered, but I see that the code markup index.html from WebGL game is different from other examples and there I haven't found a line of code:
unityInstance = UnityLoader.instantiate("unityContainer", "unity/WebGL/Build/WebGL.loader.js", { onProgress: UnityProgress });
I think I hooked it up right:
<script src="~/unity/WebGL/Build/WebGL.loader.js"></script>
#*<script src="~/unity/WebGL/Build/WebGL.framework.js.gz"></script>*#
<script src="~/unity/WebGL/run.js"></script>
I believe I wrote the mime type correctly:
var provider = new FileExtensionContentTypeProvider();
provider.Mappings.Remove(".data.gz");
provider.Mappings[".data.gz"] = "application/octet-stream";
provider.Mappings.Remove(".wasm.gz");
provider.Mappings[".wasm.gz"] = "application/wasm";
provider.Mappings.Remove(".js.gz");
provider.Mappings[".js.gz"] = "application/javascript";
provider.Mappings.Remove(".symbols.json.gz");
provider.Mappings[".symbols.json.gz"] = "application/octet-stream";
app.UseStaticFiles(new StaticFileOptions
{
FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "unity", "WebGL", "Build")),
RequestPath = "/Build",
ContentTypeProvider = provider
});
app.UseStaticFiles();
The error in the JavaScript console reads:
UnityLoader is not defined
If interested, here is my entire project:
https://github.com/EgorPavlovich/FPS.Servers.Test
I had to use the index.html file from the game build

Mentions with a Custom Build

I have a custom CKEditor 5 build (which includes the Mention plugin). The Custom editor loads and works great. But I cannot get the mention plugin to work. The '#' symbol does not trigger the autocomplete. If I enable the plugins line of the config the editor will not load.
I am using anulgar.
import * as CustomEditor from '../libs/ckeditor5-build-custom/build/ckeditor';
import Mention from '../libs/ckeditor5-build-custom/build/ckeditor';
...
editorConfig = {
//plugins : [Mention],
mention: {
feeds: [
{
marker: '#',
feed: ['#Barney', '#Lily', '#Marshall', '#Robin', '#Ted'],
minimumCharacters: 1
}
]
}

Avoid making .babelrc file to use for testing with Jest

I realize that it is recommended to make a .babelrc file to run tests with Jest according to their docs. But is there any way I could load the babelrc config programmatically and therefore not have to create this file for every React project that I have? Also, I realize I could put something in my package.json file, but I don't want to have to do that either.
You can take advantage of Jest's scriptPreprocessor config setting. I created a file that looked like this and it worked:
const babel = require('babel-core')
const jestPreset = require('babel-preset-jest')
module.exports = {
process: function (src) {
const transformCfg = {
presets: ['es2015', 'react', 'stage-0', jestPreset],
retainLines: true
}
return babel.transform(src, transformCfg).code
}
}

CKEditor, Plugin Conflict

I recently started to use CKEditor, i have come across to somewhat a weird problem, i have downloaded two plugins ,the "texttransform" and "autogrow",my config file looks like this ,,,
****CKEDITOR.editorConfig = function( config ) {
// Define changes to default configuration here. For example:
// config.language = 'fr';
// config.uiColor = '#AADC6E';
CKEDITOR.config.extraPlugins = 'texttransform'
config.extraPlugins = 'autogrow';
};****
The problem is, at one time only one plugin is active and functionality of other plugin disappears, for example,when i added autogrow, the control buttons of texttransform disappears,and they only work when i remove the line "config.extraPlugins = 'autogrow';" from my config file, any thoughts?
You are setting the configuration incorrectly. You must set config.extraPlugins only once, with two plugin names:
CKEDITOR.editorConfig = function( config ) {
config.extraPlugins = 'autogrow,texttransform';
};
See also the documentation.