Skip to content

Instantly share code, notes, and snippets.

@kylo252
kylo252 / filetype_gen_missing.lua
Last active May 25, 2022 07:21
generate missing filetypes for neovim
local fmt = string.format
local function write_file(path, txt, flag)
local data = type(txt) == "string" and txt or vim.inspect(txt)
local uv = vim.loop
uv.fs_open(path, flag, 438, function(open_err, fd)
assert(not open_err, open_err)
uv.fs_write(fd, data, -1, function(write_err)
assert(not write_err, write_err)
uv.fs_close(fd, function(close_err)
assert(not close_err, close_err)
-- creates documentation for all functions in a buffer
local function log(...)
local objects = vim.tbl_map(vim.inspect, { ... })
local plenary_log = require("plenary.log").new { level = "debug", plugin = "lsp_scratch", info_level = 3 }
plenary_log.info(unpack(objects))
return ...
end
local function write_file(path, txt, flag)
@kylo252
kylo252 / README.md
Created November 25, 2021 09:58
lspconfig benchmarks

Description

Benchmark for setting up all/multiple servers at startup

Results

  • Baseline
hyperfine "./nv-bench" -r 100 --cleanup "rm -f $HOME/.cache/nvim/{lsp.log,log}" --export-markdown results-baseline.md --command-name 'baseline'
@kylo252
kylo252 / bootstrap_msys2.ps1
Created November 9, 2021 17:13
MSYS2 Bootstrap
<#
.SYNOPSIS
Setup an MSYS2 environment including the minimum tools needed for building neovim on Windows.
.DESCRIPTION
The script will download the latest nightly release of the MSYS2 installer
and install all the packges required for building neovim on Windows.
Requies administrative privilages because the MSYS2 installation must go into `C:\msys64`.
@kylo252
kylo252 / basic-telescope.lua
Created October 6, 2021 06:55
basic telescope finder
local M = {}
local function custom_telescope_finder(opts)
opts = opts or {}
local pickers = require "telescope.pickers"
local finders = require "telescope.finders"
local conf = require("telescope.config").values
local custom_action = function()
local action_state = require "telescope.actions.state"
local entry = action_state.get_selected_entry()
@kylo252
kylo252 / README.md
Created September 15, 2021 14:29
clint-errors parser for neovim core

Error parser for the legacy errors list generated by clint.py in Neovim core.

You can also grep for non-style errors using the following:

curl -LSs https://raw.githubusercontent.com/neovim/doc/gh-pages/reports/clint/errors.json \
  | grep -v 'readability' | grep -v 'whitespace' > errors.json