rxi / lite-plugins Goto Github PK
View Code? Open in Web Editor NEWPlugins for the lite text editor
Plugins for the lite text editor
The shell-language plugin only works on files with the .sh
suffix by default. At least on Linux a file doesn't need this suffix in order to be a valid shell file.
What I rather suggest is allowing to check the first line to be either !/bin/sh
or !/usr/bin/env sh
(or bash).
It would be great if plugin only work on the working directory exclude dependencies (eg: node_modules, vendor, etc)
When using a lite.exe shortcut to open lite in the project directory, the git status plugin doesn't stop starting and stopping cmd.exe. It is probably trying to connect to git or start a git instance and it cant because its a shortcut ?
Issue doesn't happen when starting lite by clicking the exe directly.
An error occurs that shows up in the logs that fp is a nil value when using the lastproject.lua plugin, this has occured no matter whether if i open the progrom with an argument or not, here is a snippet:
i run Manjaro linux, 64 bit, kindly do review this, it would be such a handy feature to use, at the moment i have resulted to deleting the plugin entirely, sorry but i don't quite have sufficient knowledge in Lua nor C for that matter, kindly do resolve this, it would be such a handy feature to have, and also great text editor u've made here, i'm definitely looking forward to maining it
From VSCode documentation:
A Minimap (code outline) gives you a high-level overview of your source code, which is useful for quick navigation and code understanding. A file's minimap is shown on the right side of the editor. You can click or drag the shaded area to quickly jump to different sections of your file.
To further improve location awareness, it can highlight which line you are on and what is selected.
If methods were exposed to lua side, then workspace could save and restore window position and size.
Maybe also state (maximised) flags.
On my dual-screen station, lite keeps opening on second screen instead of on main screen, it is annoying me somewhat.
It would be very useful that when creating a new document, it automatically creates the folder(s) specified in the path if the folders don't already exist.
Hello,
I assume this is licensed under the MIT like lite, but a license file/license headers would be required to actually make that clear
~
https://github.com/monolifed/theme16
(I decided not to do a PR because of the number of files and their different licenses)
There's no 'x' Cross for closing the open tabs can someone add them.
Thanks.
Hello,
I have tried to make my own syntax but always failed, with syntaxing something from CSS in JS code or HTML code in JS code.
I would need to differ the syntax in <script> JS code </script>, <style> CSS code </style>code and in any other area of the code to have HTML syntax.
Or can it be done only with the syntax function that exists?
thanks
Lumir
lite is crashing when I have indentguide plugin installed together with eofnewline.
When I save a file:
Error: .../lite/data/plugins/indentguide.lua:15: attempt to perform arithmetic on local 'dir' (a nil value)
stack traceback:
.../lite/data/plugins/indentguide.lua:15: in function <.../lite/data/plugins/indentguide.lua:8>
Hello,
with the full plugin pack installed lite 1.03 crashes with the following error message:
Error: /usr/share/lite-editor/data/plugins/drawwhitespace.lua:14: attempt to call method 'get_cached_line' (a nil value)
stack traceback:
/usr/share/lite-editor/data/plugins/drawwhitespace.lua:14: in function 'draw_line_text'
/usr/share/lite-editor/data/plugins/indentguide.lua:44: in function 'draw_line_text'
/usr/share/lite-editor/data/plugins/spellcheck.lua:58: in function 'draw_line_text'
/usr/share/lite-editor/data/core/docview.lua:305: in function 'draw_line_body'
/usr/share/lite-editor/data/plugins/selectionhighlight.lua:35: in function 'draw_line_body'
/usr/share/lite-editor/data/core/docview.lua:351: in function </usr/share/lite-editor/data/core/docview.lua:330>
(...tail calls...)
/usr/share/lite-editor/data/plugins/lineguide.lua:8: in function 'draw'
/usr/share/lite-editor/data/core/commandview.lua:251: in function 'draw'
/usr/share/lite-editor/data/core/rootview.lua:353: in function '?'
/usr/share/lite-editor/data/core/rootview.lua:47: in function 'propagate'
/usr/share/lite-editor/data/core/rootview.lua:358: in function '?'
/usr/share/lite-editor/data/core/rootview.lua:48: in function 'propagate'
/usr/share/lite-editor/data/core/rootview.lua:358: in function 'draw'
/usr/share/lite-editor/data/core/rootview.lua:479: in function 'draw'
/usr/share/lite-editor/data/plugins/autocomplete.lua:195: in function 'draw'
/usr/share/lite-editor/data/core/init.lua:374: in function 'step'
/usr/share/lite-editor/data/core/init.lua:414: in function 'run'
[string "local core..."]:9: in function <[string "local core..."]:2>
[C]: in function 'xpcall'
Hi,
I recently used the workspace plugin. I currently created the file .lite_workspace.lua
manually to make it work. Didn't noticed any command to save the workspace.
Isn't that helpful to have a command to save workspace / open workspace?
Thank you.
I'm trying to create a plugin that changes the behavior of home command. Pressing it you move the caret to the end of the line, ignoring whitespaces at the beginning. Then if you press it again the caret moves to the real end of line, like in VS Code. How do I do it? I attempted to replace the "move-to-start-of-line" command but I got a "the 'new' method is nil" error.
My current code:
local core = require('core')
local keymap = require('core.keymap')
local command = require ('core.command')
local function better_home(doc, line, col)
local text = doc():get_text(doc():get_selection())
core.log('[' ..text .. ']') -- just debugging to see if it would be called
return line, 1
end
command.add("core.docview", {
["bttr_home"] = function()
core.active_view.doc():move_to(better_home, core.active_view())
end
})
keymap.add({
["home"] = "bttr_home"
})
It would be great if someone creates simple, easy to use snippet plugin.
Many editors (eg. Sublime, Visual Studio) have a useful feature that if you press ctrl-x, the whole line is cut. It makes code editing easier. It would be nice to have that feature in Lite also, if possible.
Hi, I haven't seen any other editor as light with this function. I think it could be very wanted for those editing simple css :)
Question: (Just curious) is there anything that would preclude a plugin from providing a vi/vim keybindings? I know this may not be popular with a lot of folks, but my finger memory after 30 years of using vi is hard to erase. I really like how lightweight this is so far and I don’t want ask the question with the intent of making this a vi clone.
Porting the issue from rxi/lite#142
.editorconfig
is a nice "standardised" way of specifying some configurations across all editors that support it. This is a neat tool to use in big projects with lots of contributorsa and it would be cool to have in lite too, if not on the core, at least as a plugin.You can read more about
.editorconfig
at https://editorconfig.org
I do not know Lua nor this project so at the moment I'm not able to write such plugin. I'd be really thankful if someone with more experience would do it, but if that doens't happen I'll eventually write it :)
I like how drawwhitespace.lua
works, but I would like to enable it via toggle option when I need to.
I'm sure many more plugins need this feature.
Is it something it could be added easily?
Shell has the case statement. So "case" and "esac" should be added to the language plugin.
I copied language_jennel to language_janet to make a Janet language plugin.
but I cant resolve the symbol regexp.
A symbol can be:
:symbol
:my-symbol
:just/another
thanks!!!
Hi there, It would be really nice if someone can create a Integrated Terminal like VS Code.
Lite version:
1.03
OS:
windows 10
Issue description:
workspace-plugin doesn't save and load .lite_workspace file outside C:\lite folder. Even if file precreated in root folder of project.
Steps to reproduce:
create new folder anywhere in system, make a new file with with preffered (go, lua, py...) extension, close lite.
Please add ruby formater/color
I really don't know what's happening but if inanimate is in my plugins folder it makes startup take up to 10 seconds. There's no log file that appears in case of an error or anything, and because it's such a small plugin I don't really know what could be happening. I've removed literally every other plugin except inanimate and the slowness persists.
A code folding plugin would be really helpful. Ideally it could automatically detect fold points at {}
and indentation, and could allow you to define fold points like so
-- Something {{{
code here!
-- }}}
-- folded up looks like:
+-- 1 line: Something
This is how Vim handles it, other syntax or behavior would be fine too. Ive been trying to write this myself but I don't know enough Lua or enough about the lite api to make it work.
It will be really useful if Lite had a caching plugin, saving some documents users are working on in an internal directory with a pre-configured time interval: it might save hours of coding for someone later. Many times, probably. :-)
is there any plugins which can run Python script in current editor?
Then what if the plugin has an update?
Changing the font size when there is only one line of text in a file generates an error:
data/core/common.lua:11 attempt to index local 'text' (a nil value)
Workaround:
Add a check to make sure that (n - view.size.y) isn't zero before line 51 in function set_scale to prevent a division by zero error.
Change:
if n ~= math.huge and not view:is(CommandView) then
scrolls[view] = view.scroll.y / (n - view.size.y)
end
To:
if n ~= math.huge and not view:is(CommandView) then
if (n - view.size.y) ~= 0 then
scrolls[view] = view.scroll.y / (n - view.size.y)
end
end
Hi,
Please someone make plugin language for Typescript. Thanks.
Best regards,
babaiyu
Sometimes I need to copy the file location and share to someone in the team.
So I wrote a small plugin looking at some of the lua files. I am learning lua via lite. So thought of sharing it as gist for this currently doesn't have copy clipboard in Windows.
-- data/plugins/copyfilelocation.lua
local core = require "core"
local command = require "core.command"
local config = require "core.config"
command.add("core.docview", {
["copy-file-location:copy-file-location"] = function()
local doc = core.active_view.doc
if not doc.filename then
core.error "Cannot copy location of unsaved doc"
return
end
local filename = doc.filename
core.log("Copying \"%s\"", filename:gsub(".lua$", ""))
if PLATFORM == "Windows" then
-- os.execute(string.format("start %s %s", config.filemanager, folder_name))
else
os.execute(string.format("echo %s | xclip -selection clipboard", filename:gsub(".lua$", "")))
end
end
})
If this can be improved or need a PR I am happy to send it.
Thank you.
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.