This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local api, fn = vim.api, vim.fn | |
local function find_prev(bufnr) | |
local bufs = api.nvim_list_bufs() | |
local idx = nil | |
for i, buf in ipairs(bufs) do | |
if buf == bufnr then | |
idx = i | |
break |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/binutils/ltversion.m4 | |
/binutils/ChangeLog | |
/binutils/intl | |
/binutils/gprofng | |
/binutils/config-ml.in | |
/binutils/setup.com | |
/binutils/intl/localename.c | |
/binutils/COPYING | |
/binutils/gprofng/libcollector | |
/binutils/intl/intl-compat.c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name ci logs monke | |
// @namespace https://github.com/neovim/neovim | |
// @version 0.1.0 | |
// @description Interpret (or strip) terminal control sequences in Github CI logs | |
// @author neovim chat | |
// @match https://pipelines.actions.githubusercontent.com/serviceHosts/*/_apis/pipelines/*/runs/*/signedlogcontent/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=githubusercontent.com | |
// @grant none | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vim.api.nvim_create_user_command('Redir', function(ctx) | |
local lines = vim.split(vim.api.nvim_exec(ctx.args, true), '\n', { plain = true }) | |
if #lines > 0 then | |
vim.cmd('new') | |
vim.api.nvim_buf_set_lines(0, 0, -1, false, lines) | |
vim.opt_local.modified = false | |
else | |
vim.api.nvim_echo({{'No output', 'WarningMsg'}}, false, {}) | |
end | |
end, { nargs = '+', complete = 'command' }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Execute selected vim script lines | |
function! s:__execute__(line1, line2, arg) abort | |
let l:src = substitute(join(getline(a:line1, a:line2), "\n"), '\n\s*\\', ' ', 'g') | |
if a:arg ==# '' | |
try | |
call execute(l:src, '') | |
catch | |
echohl ErrorMsg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- :! replacement that supports char-wise selection | |
-- from visual mode :Pipe <command> | |
vim.api.nvim_create_user_command('Pipe', function(ctx) | |
local ms = vim.api.nvim_buf_get_mark(0, '<') | |
local me = vim.api.nvim_buf_get_mark(0, '>') | |
local mt = vim.fn.visualmode() | |
if mt == '\22' then | |
error 'blockwise selection not supported' | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdbool.h> | |
#include <assert.h> | |
const char *braille[256] = { | |
"⠀", "⢀", "⠠", "⢠", "⠐", "⢐", "⠰", "⢰", "⠈", "⢈", "⠨", "⢨", "⠘", "⢘", "⠸", "⢸", | |
"⡀", "⣀", "⡠", "⣠", "⡐", "⣐", "⡰", "⣰", "⡈", "⣈", "⡨", "⣨", "⡘", "⣘", "⡸", "⣸", | |
"⠄", "⢄", "⠤", "⢤", "⠔", "⢔", "⠴", "⢴", "⠌", "⢌", "⠬", "⢬", "⠜", "⢜", "⠼", "⢼", | |
"⡄", "⣄", "⡤", "⣤", "⡔", "⣔", "⡴", "⣴", "⡌", "⣌", "⡬", "⣬", "⡜", "⣜", "⡼", "⣼", | |
"⠂", "⢂", "⠢", "⢢", "⠒", "⢒", "⠲", "⢲", "⠊", "⢊", "⠪", "⢪", "⠚", "⢚", "⠺", "⢺", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- OUTDATED: it got merged to neovim: https://github.com/neovim/neovim/commit/2c739431e8e5a2aacc39ef429401f5e4427d027a | |
-- nvim --cmd 'so startuptime.lua' --startuptime nvim.log | |
local ffi = require('ffi') | |
local C = ffi.C | |
ffi.cdef([[ | |
typedef void FILE; | |
typedef uint64_t proftime_T; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- for this to be complete, we'd also need to patch | |
-- luv metatables, patch async callbacks and keep | |
-- track of file descriptors | |
local uv = vim.loop | |
local handles = setmetatable({}, { __mode = 'k' }) | |
local function install() | |
local function pack(...) | |
return {...}, select('#', ...) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function _G.make(command) | |
command = command or 'make' | |
local running = true | |
vim.api.nvim_chan_send(vim.v.stderr, '\r\n') | |
local job = vim.fn.jobstart(command, { | |
env = { TERM = vim.env.TERM }, | |
pty = true, | |
width = vim.api.nvim_get_option('columns'), |
NewerOlder