Credits to @TheOnlyAnil-@Firelord[^stackoverflow]
-
Requirements: a) stock recovery + rooted phone b) custom recovery
-
Files changed:
local M = {} | |
M._cbs = {} | |
--- Saves a Lua function as a callback and returns a string that can be used to | |
--- run that function. | |
--- | |
---@param fn Callback | |
---@return string | |
function M.lua_callback(fn) | |
assert(type(fn) == 'function', tb('fn must be a function')) |
[[ -f "$HOME/.profile" ]] && source "$HOME/.profile" | |
[[ $- == *i* && -f "$HOME/.bashrc" ]] && source "$HOME/.bashrc" |
-- 1. Clone https://github.com/neovim/neovim/pull/12720 | |
-- 2. Run with `nvim -u NONE fix-floating-preview.lua '+luafile %'` | |
-- 3. press F7 twice. | |
-- 4. Does it echo your current line (including line numbers!) to the :messages | |
-- pane before switching into the floating window? | |
function __beep() return vim.lsp.util.open_floating_preview({'foo', 'boo'}, 'lua', {focus_id='beep'}) end | |
vim.api.nvim_buf_set_keymap(0, '', '<f7>', '<cmd>lua __beep()<cr>', {silent = true, noremap = true}) | |
vim.wo.number = true |
local counter = 1 | |
local M = {} | |
--- Creates a function to insert customized numbered print statements. | |
--- | |
--@param context (string, default "print('%d')") The format string for the debug | |
--- statement. Should contain a single `%d`, which will be the insertion point | |
--- of the current counter value. | |
function M.debug_statement_factory(context) | |
local context = context or [[print('%d')]] |
๐.lua
cd $(dirname path/to/๐.lua)
nvim ๐.lua
:luafile %
F5
to ๐The F5
bit is just for demonstration. In an actual statusline, you'll want to uncomment line 65 so it actually checks for LSP messages.