Nvim recognizes the following events. Names are case-insensitive.
BufAdd
Just after creating a new buffer which is
added to the buffer list, or adding a buffer
# Install Bash 4 using homebrew | |
brew install bash | |
# Or build it from source... | |
curl -O http://ftp.gnu.org/gnu/bash/bash-4.2.tar.gz | |
tar xzf bash-4.2.tar.gz | |
cd bash-4.2 | |
./configure --prefix=/usr/local/bin && make && sudo make install | |
# Add the new shell to the list of legit shells |
#!/bin/bash | |
# Useful bash functions. This is sourced by the environment file. | |
# These are available to scripts, but you shouldn't use them in scripts if you | |
# want them to be portable. | |
# Usage: pathremove /path/to/bin [PATH] | |
# Eg, to remove ~/bin from $PATH | |
# pathremove ~/bin PATH | |
function pathremove { | |
local IFS=':' |
# Source: https://gist.github.com/vfarcic/02bbfaf6cf8f5b03f4267b50f3f3233b | |
######################################################### | |
# How To Create A "Proper" CLI With Shell And Charm Gum # | |
# https://youtu.be/U8zCHA-9VLA # | |
######################################################### | |
# Additional Info: | |
# - Charm Gum: https://github.com/charmbracelet/gum |
#!/usr/bin/env bash | |
# | |
# RFC standard of the email address could be found in rfc5322, rfc6854, etc. | |
# | |
# however, it is hard to escape all the special characters in the bash | |
# so, in this script, it will only check for the address syntax only | |
# having some valid/invalid inputs to test its result | |
# | |
# please be noted that, it is not design to detect mailbox deliverability |
// ts 3.6x | |
function debounce<T extends Function>(cb: T, wait = 20) { | |
let h = 0; | |
let callable = (...args: any) => { | |
clearTimeout(h); | |
h = setTimeout(() => cb(...args), wait); | |
}; | |
return <T>(<any>callable); | |
} |
{ | |
// Config for IDE to reload | |
"compileOnSave": true, | |
"exclude": [ | |
// Specifies an array of filenames or patterns that should be skipped when resolving include. | |
// Default: | |
// ["node_modules", "bower_components", "jspm_packages"], plus the value of outDir if one is specified. | |
"**/*.spec.ts", | |
"node_modules" | |
], |
yarn create vite
const transformer = options => ({ | |
apply: 'post', | |
transform({ code, isBuild }) { | |
if (!isBuild) return code | |
return code.replace('</body>', `<script defer type="module"> | |
const KEY = 'ga:user' | |
const UID = (localStorage[KEY] = localStorage[KEY] || Math.random() + '.' + Math.random()) | |
const onError = err => console.error('[vite vitals] ', err) | |
const onDebug = (label, payload) => console.log(label, payload) |
# Reference: https://www.exclamationlabs.com/blog/continuous-deployment-to-npm-using-gitlab-ci/ | |
# GitLab uses docker in the background, so we need to specify the | |
# image versions. This is useful because we're freely to use | |
# multiple node versions to work with it. They come from the docker | |
# repo. | |
# Uses NodeJS V 9.4.0 | |
image: node:9.4.0 | |
# And to cache them as well. |