Closed ryan-caesar-ramos closed 7 months ago
The linter plugin is already installed by default so you wouldn't need to download it to ~/.config/micro/plug/linter, I don't know if this could be causing an error.
One thing to test is to remove the ~/.config/micro/plug/linter folder.
Or something that could be happening is that the command is not installed.
How are you adding the linter?
I added the linter by downloading the lua file to the directory ~/.config/micro/plug/linter
. I'll try removing ~/.config/micro/plug/linter
, but what should I expect to happen?
To add a linter you need to create the file ~/.config/micro/init.lua
.
This is a plugin that you create to write your configurations in lua.
In it you create an init()
function globally, the micro will call this callback when it starts. Within this callback you could define your linters.
Example:
-- ~/.config/micro/init.lua
function init()
linter.makeLinter('tsc', 'typescript', 'tsc', {'--noEmit', '--pretty', 'false'}, '%f%(%l,%c%): %m')
end
Enter the command bar with Ctrl-e
and type help linter
to see more plugin help.
Thanks for your help so far; I deleted the folder I made, ran micro -plugin list
, and indeed linter still shows up.
The biggest issue here is that I didn't realize that I needed to configure the linter inside the init function.
Thanks again!
Description of the problem or steps to reproduce
How do I get the linter plugin to work? I made the directory
~/.config/micro/plug/linter
then downloaded this file into it. According to the repo, if the plugin is enabled, then saving the file should start the linting, but unless my machine is insanely slow, I don't think anything's happening. Is there a chance that the plugin is not enabled? How would I do that?Specifications
Commit hash: 68d88b57 OS: Ubuntu 20.04.5 LTS Terminal: iTerm 3.4.15