Skip to content

Instantly share code, notes, and snippets.

Avatar
🏈

Thore Weilbier weilbith

🏈
View GitHub Profile
@weilbith
weilbith / tap_dance_simulations.c
Created Dec 20, 2019
QMK keyboard firmware - simulate MT with tap dance
View tap_dance_simulations.c
#include QMK_KEYBOARD_H
#include "tap_dance_simulations.h"
typedef enum {
SINGLE_TAP,
SINGLE_HOLD,
MULTI_TAP,
// TODO: Think about tap-hold case
} td_state_t;
@weilbith
weilbith / keymap.c
Created Nov 1, 2019
QMK firmware Mod-Tab simulation with Tab-Dance for One-Shot-Modifier feature
View keymap.c
typedef enum {
SINGLE_TAP,
SINGLE_HOLD,
} td_state_t;
static td_state_t td_state;
int cur_dance (qk_tap_dance_state_t *state);
void gui_control_finished (qk_tap_dance_state_t * state, void *user_data);
void gui_control_reset (qk_tap_dance_state_t* state, void *user_data);
@weilbith
weilbith / python.snippets
Created Mar 22, 2019
Secure empty lines before and after completed snippets with UltiSnips
View python.snippets
global !p
def on_jump(snippet, positions, function, arguments=None):
if not isinstance(positions, list):
positions = [positions]
for position in positions:
if position == "last":
position = len(snippet.tabstops) - 1
if position == snippet.tabstop:
@weilbith
weilbith / autoload_utils_layout.vim
Last active Mar 12, 2019
Dark Powered Vim - Fix The Broken Window Layout (file names are using '_' to simulate a '/', leveraging Vim's autload functionalities)
View autoload_utils_layout.vim
" Standard shape values when fail to retrieve a global variable.
let s:standard_width = 30
let s:standard_height = 10
" List of all windows, which should have a fixed size and/or position.
let g:layout_fixed_windows = [
\ {
\ 'buffer_name': 'Scratch',
@weilbith
weilbith / autoload_utils_location.vim
Last active Jul 26, 2019
Vim - Dynamic Location Lists
View autoload_utils_location.vim
" Cache a possibly filled location list for a hiding buffer.
" Check if there is a non-empty list for the current buffer.
" Stores the list to the cache and empty the original one.
" The location window will be closed.
"
" Arguments:
" buffer - buffer to create the cache for
"
function! utils#location#cache_location_list(buffer) abort
if get(g:, 'dynamic_location_list_disable', v:false) | return | endif
You can’t perform that action at this time.