Skip to content

Instantly share code, notes, and snippets.

View lewis6991's full-sized avatar

Lewis Russell lewis6991

  • ARM
  • United Kingdom
  • 03:12 (UTC +01:00)
View GitHub Profile

Problem

  • Plugins cannot inspect folds
  • Custom folds require foldexpr which is inefficient as it requires evaluating this expression on every buffer line.

Solution

API for plugins to set, inspect folds and get fold events.

@lewis6991
lewis6991 / ASAN and UBSAN.md
Last active January 10, 2022 11:03
Neovim dev notes

Clang sanitizers (ASAN and UBSAN)

ASAN/UBSAN can be used to detect memory errors and other common forms of undefined behavior at runtime in debug builds.

  • To build Neovim with sanitizers enabled, use
    rm -rf build && CMAKE_EXTRA_FLAGS="-DCMAKE_C_COMPILER=clang -DCLANG_ASAN_UBSAN=1" make
  • When running Neovim, use
@lewis6991
lewis6991 / setup_linuxbrew_on_rhel7.sh
Last active September 1, 2023 08:57
Setup linuxbrew on Redhat 7
# This script assumes you have modern versions of gcc, git and curl on your path.
HOMEBREW_PREFIX="$1"
# From https://github.com/Homebrew/discussions/discussions/254
export HOMEBREW_DEVELOPER=1
export HOMEBREW_CURL_PATH="$(which curl)"
export HOMEBREW_GIT_PATH="$(which git)"
# From https://docs.brew.sh/Homebrew-on-Linux#alternative-installation
#! /usr/bin/env bash
set -e
EXTRA_OPTS="--ignore-submodules"
mapfile -t status < <(git -c color.status=always status --short $EXTRA_OPTS)
if [ ${#status[@]} -eq 0 ]; then
printf "\033[93mNothing to commit, working tree clean\033[0m\n"