Standard escape codes are prefixed with Escape:
- Ctrl-Key:
^[ - Octal:
\033 - Unicode:
\u001b - Hexadecimal:
\x1B - Decimal:
27
| -- | |
| -- Move this file to your neovim lua runtime path ie. ~/.config/nvim/lua/au.lua | |
| -- | |
| local cmd = vim.api.nvim_command | |
| local function autocmd(this, event, spec) | |
| local is_table = type(spec) == 'table' | |
| local pattern = is_table and spec[1] or '*' | |
| local action = is_table and spec[2] or spec | |
| if type(action) == 'function' then |
| DOMAIN ?= mydomain.com | |
| COUNTRY := IT | |
| STATE := IT | |
| COMPANY := Evil Corp. | |
| # credits to: https://gist.github.com/fntlnz/cf14feb5a46b2eda428e000157447309 | |
| # usage: |
| " :[range]SortGroup[!] [n|f|o|b|x] /{pattern}/ | |
| " e.g. :SortGroup /^header/ | |
| " e.g. :SortGroup n /^header/ | |
| " See :h :sort for details | |
| function! s:sort_by_header(bang, pat) range | |
| let pat = a:pat | |
| let opts = "" | |
| if pat =~ '^\s*[nfxbo]\s' | |
| let opts = matchstr(pat, '^\s*\zs[nfxbo]') |
Suppose you have weird taste and you absolutely want:
Searching can be an efficient way to navigate the current buffer.
The first search commands we learn are usually / and ?. These are seriously cool, especially with the incsearch option enabled which lets us keep typing to refine our search pattern. / and ? really shine when all we want is to jump to something we already have our eyeballs on but they are not fit for every situation:
| __module_name__ = 'Filter' | |
| __module_version__ = '1.0.custom' | |
| __module_description__ = 'Filters join/part/voice messages' | |
| import hexchat | |
| import collections | |
| from time import time | |
| last_seen = {} # For each entry: the key is the user's nickname, the entry | |
| # is a list: element 0: last seen time |
| // ==UserScript== | |
| // @name Monster Minigame Auto-script | |
| // @namespace https://github.com/wchill/steamSummerMinigame | |
| // @description A script that runs the Steam Monster Minigame for you. Modified from mouseas's original version to include autoclick. | |
| // @version 1.0 | |
| // @match http://steamcommunity.com/minigame/towerattack* | |
| // @updateURL https://raw.githubusercontent.com/wchill/steamSummerMinigame/master/autoPlay.js | |
| // @downloadURL https://raw.githubusercontent.com/wchill/steamSummerMinigame/master/autoPlay.js | |
| // ==/UserScript== |
Use case: You have repository A with remote location rA, and repository B (which may or may not have remote location rB). You want to do one of two things:
NB: Check out git subtree/git submodule and this Stack Overflow question before going through the steps below. This gist is just a record of how I solved this problem on my own one day.
Before starting, make sure your local and remote repositories are up-to-date with all changes you need. The following steps use the general idea of changing the remote origin and renaming the local master branch of one of the repos in order to combine the two master branches.