Merge branch 'master' of https://git.roodletoof.org/roodletoof/dotfiles
This commit is contained in:
@@ -10,7 +10,7 @@ dynamic_padding = true
|
|||||||
decorations = "Buttonless"
|
decorations = "Buttonless"
|
||||||
|
|
||||||
[font]
|
[font]
|
||||||
normal.family = "GoMono Nerd Font Mono"
|
normal.family = "Comic Code"
|
||||||
size = 12
|
size = 12
|
||||||
|
|
||||||
# Subtle positional tuning
|
# Subtle positional tuning
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,2 @@
|
|||||||
|
tag:
|
||||||
|
ctags --langmap=c:.c.h --languages=c -R .
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Opens a fuzzy finding window with the given array of strings.
|
||||||
|
// Returns the index of the picked element.
|
||||||
|
// Returns -1 on no selection.
|
||||||
|
int picker(char const *strings, int strings_len, char const *prompt) {
|
||||||
|
}
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
#ifndef PLATFORM
|
||||||
|
#define PLATFORM
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
#include "utf.h"
|
||||||
|
|
||||||
|
typedef struct Color {
|
||||||
|
uint8_t r, g, b;
|
||||||
|
} Color;
|
||||||
|
|
||||||
|
#define WHITE ((Color){255,255,255})
|
||||||
|
#define BLACK ((Color){0,0,0})
|
||||||
|
|
||||||
|
typedef enum Key {
|
||||||
|
Key_backspace,
|
||||||
|
Key_ctrl,
|
||||||
|
Key_enter,
|
||||||
|
Key_h,
|
||||||
|
Key_n,
|
||||||
|
Key_p,
|
||||||
|
Key_y,
|
||||||
|
Count_Key
|
||||||
|
} Key;
|
||||||
|
|
||||||
|
bool KeyPressed(Key key);
|
||||||
|
bool InputGetNextPrintable(CodePoint const *out_key);
|
||||||
|
|
||||||
|
typedef struct Cell {
|
||||||
|
CodePoint character;
|
||||||
|
Color foreground;
|
||||||
|
Color background;
|
||||||
|
} Cell;
|
||||||
|
|
||||||
|
typedef struct Window {
|
||||||
|
int width;
|
||||||
|
int height;
|
||||||
|
Cell *cells;
|
||||||
|
} Window;
|
||||||
|
|
||||||
|
typedef struct PlatformState {
|
||||||
|
Window *prev;
|
||||||
|
Window *curr;
|
||||||
|
} PlatformState;
|
||||||
|
|
||||||
|
// Options for the backend. These options don't necessarily apply for all platforms.
|
||||||
|
typedef struct PlatformOpts {
|
||||||
|
float window_width_fraction; // decide the width of the window as a fraction of the total resolution. for gui backends
|
||||||
|
float window_height_fraction; // decide the height of the window as a fraction of the total resolution. for gui backends
|
||||||
|
} PlatformOpts;
|
||||||
|
|
||||||
|
PlatformOpts WindowCreateOptsDefault();
|
||||||
|
Window *WindowCreate(PlatformOpts opts);
|
||||||
|
void WindowClear(Window *window, Color color);
|
||||||
|
void WindowFlip(Window *window);
|
||||||
|
|
||||||
|
void PlatformInit(PlatformOpts opts);
|
||||||
|
int PlatformGetWidth();
|
||||||
|
int PlatformGetHeight();
|
||||||
|
|
||||||
|
// TODO: the platform layer would really update the keys being pressed, and
|
||||||
|
// receive a diff in the form of actions. print this line from here and change
|
||||||
|
// colors at these points.
|
||||||
|
|
||||||
|
#endif /* PLATFORM */
|
||||||
+43
@@ -0,0 +1,43 @@
|
|||||||
|
#include <stddef.h>
|
||||||
|
|
||||||
|
#include "str.h"
|
||||||
|
|
||||||
|
static bool intToIndex(String string, int i, size_t *out_index) {
|
||||||
|
int val = 0;
|
||||||
|
bool is_ok = true;
|
||||||
|
if (i >= 0) {
|
||||||
|
val = i;
|
||||||
|
} else {
|
||||||
|
val = string.size + 1 + i;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (val < 0) {
|
||||||
|
val = 0;
|
||||||
|
is_ok = false;
|
||||||
|
} else if (val > string.size) {
|
||||||
|
val = string.size;
|
||||||
|
is_ok = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
*out_index = val;
|
||||||
|
return is_ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool StringSub(String string, int start, int end, String *out_substr) {
|
||||||
|
|
||||||
|
size_t start_index = 0;
|
||||||
|
bool start_ok = intToIndex(string, start, &start_index);
|
||||||
|
size_t end_index = 0;
|
||||||
|
bool end_ok = intToIndex(string, end, &end_index);
|
||||||
|
|
||||||
|
if (string.size == 0 || start_index >= end_index) {
|
||||||
|
out_substr->size=0;
|
||||||
|
out_substr->buffer=NULL;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
out_substr->buffer = &string.buffer[start_index];
|
||||||
|
out_substr->size = end_index - start_index;
|
||||||
|
|
||||||
|
return start_ok && end_ok;
|
||||||
|
}
|
||||||
+10
@@ -0,0 +1,10 @@
|
|||||||
|
#include <stddef.h>
|
||||||
|
|
||||||
|
typedef struct String {
|
||||||
|
unsigned char const *buffer;
|
||||||
|
size_t size;
|
||||||
|
} String;
|
||||||
|
|
||||||
|
#define STRING(content) ((String){.buffer=#content, .size=sizeof(#content)-1})
|
||||||
|
|
||||||
|
bool StringSub(String string, int start, int end, String *out_substr);
|
||||||
+65
@@ -0,0 +1,65 @@
|
|||||||
|
#include <stddef.h>
|
||||||
|
|
||||||
|
#include "utf.h"
|
||||||
|
#include "str.h"
|
||||||
|
|
||||||
|
typedef struct Utf8Parser {
|
||||||
|
String str;
|
||||||
|
} Utf8Parser;
|
||||||
|
|
||||||
|
bool Utf8ParserNextCodePoint(Utf8Parser *this, CodePoint *out_codepoint) {
|
||||||
|
uitn8_t const flag_1_bytes = 0;
|
||||||
|
uint8_t const mask_1_bytes = 1 << 7;
|
||||||
|
|
||||||
|
uint8_t const flag_continuation = mask_1_bytes;
|
||||||
|
uint8_t const mask_continuation = (1 << 7) | (1 << 6);
|
||||||
|
|
||||||
|
uint8_t const flag_2_bytes = mask_continuation;
|
||||||
|
uint8_t const mask_2_bytes = (1 << 7) | (1 << 6) | (1 << 5);
|
||||||
|
|
||||||
|
uint8_t const flag_3_bytes = mask_2_bytes;
|
||||||
|
uint8_t const mask_3_bytes = (1 << 7) | (1 << 6) | (1 << 5) | (1 << 4);
|
||||||
|
|
||||||
|
uint8_t const flag_4_bytes = mask_3_bytes;
|
||||||
|
uint8_t const mask_4_bytes = (1 << 7) | (1 << 6) | (1 << 5) | (1 << 4) | (1 << 3);
|
||||||
|
|
||||||
|
if (this->str.size == 0) {
|
||||||
|
*out_codepoint = 0;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((this->str.buffer[0] & mask_1_bytes) == flag_1_bytes) {
|
||||||
|
*out_codepoint = (CodePoint) str[0];
|
||||||
|
bool ok = StringSub(this->str, 1, -1, &this->str);
|
||||||
|
assert(ok && "has to be ok since the size is not 0");
|
||||||
|
return ok;
|
||||||
|
} else
|
||||||
|
}
|
||||||
|
|
||||||
|
// max must be less than or equal to the capacity of target.
|
||||||
|
bool CodePointsFromUtf8String(
|
||||||
|
uint8_t const *str,
|
||||||
|
CodePoint *target,
|
||||||
|
int max
|
||||||
|
) {
|
||||||
|
|
||||||
|
for (size_t i = 0; str[i] != '\0' && max > 0;) {
|
||||||
|
if ((str[i] & mask_1_bytes) == flag_1_bytes) {
|
||||||
|
*target = (CodePoint) str[i];
|
||||||
|
|
||||||
|
target += 1;
|
||||||
|
max -= 1;
|
||||||
|
i += 1;
|
||||||
|
} else
|
||||||
|
if ((str[i] & mask_2_bytes) == flag_2_bytes) {
|
||||||
|
} else
|
||||||
|
if ((str[i] & mask_3_bytes) == flag_3_bytes) {
|
||||||
|
} else
|
||||||
|
if ((str[i] & mask_4_bytes) == flag_4_bytes) {
|
||||||
|
} else {
|
||||||
|
false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
#ifndef UTF
|
||||||
|
#define UTF
|
||||||
|
|
||||||
|
typedef uint32_t CodePoint;
|
||||||
|
|
||||||
|
int CodePointsFromUtf8String(char const *str, CodePoint *target, unsigned int max);
|
||||||
|
|
||||||
|
#endif // UTF
|
||||||
|
|
||||||
@@ -3,7 +3,7 @@ choose-monitor:
|
|||||||
just reset-wallpaper
|
just reset-wallpaper
|
||||||
|
|
||||||
reset-wallpaper:
|
reset-wallpaper:
|
||||||
feh --bg-fill ~/.wallpaper/
|
xsetroot -solid black
|
||||||
|
|
||||||
program-picker:
|
program-picker:
|
||||||
dmenu_run -p 'start program'
|
dmenu_run -p 'start program'
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
)
|
)
|
||||||
|
|
||||||
(defsrc ;;{{{1
|
(defsrc ;;{{{1
|
||||||
|
f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
|
||||||
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
|
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
|
||||||
tab q w e r t y u i o p [ ] \
|
tab q w e r t y u i o p [ ] \
|
||||||
caps a s d f g h j k l ; ' ret
|
caps a s d f g h j k l ; ' ret
|
||||||
@@ -13,6 +14,7 @@
|
|||||||
)
|
)
|
||||||
|
|
||||||
(deflayer default ;;{{{1
|
(deflayer default ;;{{{1
|
||||||
|
brdn brup bldn blup f5 f6 prev pp next mute vold volu
|
||||||
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
|
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
|
||||||
tab q w e r t y u i o p [ ] \
|
tab q w e r t y u i o p [ ] \
|
||||||
@cap a s d f g h j k l ; ' ret
|
@cap a s d f g h j k l ; ' ret
|
||||||
@@ -21,6 +23,7 @@
|
|||||||
)
|
)
|
||||||
|
|
||||||
(deflayer gaming ;;{{{1
|
(deflayer gaming ;;{{{1
|
||||||
|
f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
|
||||||
esc 1 2 3 4 5 6 7 8 9 0 - = bspc
|
esc 1 2 3 4 5 6 7 8 9 0 - = bspc
|
||||||
tab q w e r t y u i o p [ ] \
|
tab q w e r t y u i o p [ ] \
|
||||||
XX a s d f g h j k l ; ' ret
|
XX a s d f g h j k l ; ' ret
|
||||||
@@ -29,6 +32,7 @@
|
|||||||
)
|
)
|
||||||
|
|
||||||
(deflayer symbols ;;{{{1
|
(deflayer symbols ;;{{{1
|
||||||
|
f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
|
||||||
grv @1 @2 @3 @4 @5 @6 @7 @8 @9 @0 _ _ bspc
|
grv @1 @2 @3 @4 @5 @6 @7 @8 @9 @0 _ _ bspc
|
||||||
tab @` @m[ @m] @& @| @^ @_ @m- @+ @m= @nor _ lrld
|
tab @` @m[ @m] @& @| @^ @_ @m- @+ @m= @nor _ lrld
|
||||||
@cap @~ @bl @br @* @m\ bspc ret @? tab @: S-' ret
|
@cap @~ @bl @br @* @m\ bspc ret @? tab @: S-' ret
|
||||||
|
|||||||
@@ -1,118 +0,0 @@
|
|||||||
{
|
|
||||||
"profiles": [
|
|
||||||
{
|
|
||||||
"complex_modifications": {
|
|
||||||
"rules": [
|
|
||||||
{
|
|
||||||
"description": "dual purpose modifiers",
|
|
||||||
"manipulators": [
|
|
||||||
{
|
|
||||||
"from": {
|
|
||||||
"key_code": "spacebar",
|
|
||||||
"modifiers": { "optional": ["any"] }
|
|
||||||
},
|
|
||||||
"to": [
|
|
||||||
{
|
|
||||||
"key_code": "left_shift",
|
|
||||||
"lazy": true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"to_if_alone": [{ "key_code": "spacebar" }],
|
|
||||||
"type": "basic"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"from": {
|
|
||||||
"key_code": "caps_lock",
|
|
||||||
"modifiers": { "optional": ["any"] }
|
|
||||||
},
|
|
||||||
"to": [
|
|
||||||
{
|
|
||||||
"key_code": "left_control",
|
|
||||||
"lazy": true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"to_if_alone": [{ "key_code": "escape" }],
|
|
||||||
"type": "basic"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"description": "swap alt and cmd",
|
|
||||||
"enabled": false,
|
|
||||||
"manipulators": [
|
|
||||||
{
|
|
||||||
"from": { "key_code": "left_option" },
|
|
||||||
"to": [{ "key_code": "left_command" }],
|
|
||||||
"type": "basic"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"from": { "key_code": "left_command" },
|
|
||||||
"to": [{ "key_code": "left_option" }],
|
|
||||||
"type": "basic"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"name": "KarabinerTS",
|
|
||||||
"selected": true,
|
|
||||||
"virtual_hid_keyboard": { "keyboard_type_v2": "iso" }
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Default profile",
|
|
||||||
"virtual_hid_keyboard": {
|
|
||||||
"country_code": 0,
|
|
||||||
"keyboard_type_v2": "ansi"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"complex_modifications": {
|
|
||||||
"rules": [
|
|
||||||
{
|
|
||||||
"description": "Caps Lock to ESC on tap/Left control on hold",
|
|
||||||
"manipulators": [
|
|
||||||
{
|
|
||||||
"from": {
|
|
||||||
"key_code": "caps_lock",
|
|
||||||
"modifiers": { "optional": ["any"] }
|
|
||||||
},
|
|
||||||
"to": [
|
|
||||||
{
|
|
||||||
"key_code": "left_control",
|
|
||||||
"lazy": true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"to_if_alone": [{ "key_code": "escape" }],
|
|
||||||
"type": "basic"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"description": "Space to shift on hold",
|
|
||||||
"manipulators": [
|
|
||||||
{
|
|
||||||
"from": {
|
|
||||||
"key_code": "spacebar",
|
|
||||||
"modifiers": { "optional": ["any"] }
|
|
||||||
},
|
|
||||||
"to": [
|
|
||||||
{
|
|
||||||
"key_code": "left_shift",
|
|
||||||
"lazy": true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"to_if_alone": [{ "key_code": "spacebar" }],
|
|
||||||
"type": "basic"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"name": "Modified profile",
|
|
||||||
"virtual_hid_keyboard": {
|
|
||||||
"country_code": 0,
|
|
||||||
"keyboard_type_v2": "iso"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
+15
-15
@@ -35,24 +35,24 @@
|
|||||||
"type": "basic"
|
"type": "basic"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
|
||||||
{
|
|
||||||
"description": "swap alt and cmd",
|
|
||||||
"manipulators": [
|
|
||||||
{
|
|
||||||
"from": { "key_code": "left_option" },
|
|
||||||
"to": [{ "key_code": "left_command" }],
|
|
||||||
"type": "basic"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"from": { "key_code": "left_command" },
|
|
||||||
"to": [{ "key_code": "left_option" }],
|
|
||||||
"type": "basic"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"devices": [
|
||||||
|
{
|
||||||
|
"identifiers": {
|
||||||
|
"is_keyboard": true,
|
||||||
|
"product_id": 21042,
|
||||||
|
"vendor_id": 1155
|
||||||
|
},
|
||||||
|
"simple_modifications": [
|
||||||
|
{
|
||||||
|
"from": { "key_code": "grave_accent_and_tilde" },
|
||||||
|
"to": [{ "key_code": "non_us_backslash" }]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"name": "KarabinerTS",
|
"name": "KarabinerTS",
|
||||||
"selected": true,
|
"selected": true,
|
||||||
"virtual_hid_keyboard": { "keyboard_type_v2": "iso" }
|
"virtual_hid_keyboard": { "keyboard_type_v2": "iso" }
|
||||||
+16
-16
@@ -35,26 +35,25 @@
|
|||||||
"type": "basic"
|
"type": "basic"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
|
||||||
{
|
|
||||||
"description": "swap alt and cmd",
|
|
||||||
"manipulators": [
|
|
||||||
{
|
|
||||||
"from": { "key_code": "left_option" },
|
|
||||||
"to": [{ "key_code": "left_command" }],
|
|
||||||
"type": "basic"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"from": { "key_code": "left_command" },
|
|
||||||
"to": [{ "key_code": "left_option" }],
|
|
||||||
"type": "basic"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"devices": [
|
||||||
|
{
|
||||||
|
"identifiers": {
|
||||||
|
"is_keyboard": true,
|
||||||
|
"product_id": 21042,
|
||||||
|
"vendor_id": 1155
|
||||||
|
},
|
||||||
|
"simple_modifications": [
|
||||||
|
{
|
||||||
|
"from": { "key_code": "grave_accent_and_tilde" },
|
||||||
|
"to": [{ "key_code": "non_us_backslash" }]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"name": "KarabinerTS",
|
"name": "KarabinerTS",
|
||||||
"selected": true,
|
|
||||||
"virtual_hid_keyboard": { "keyboard_type_v2": "iso" }
|
"virtual_hid_keyboard": { "keyboard_type_v2": "iso" }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -108,6 +107,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"name": "Modified profile",
|
"name": "Modified profile",
|
||||||
|
"selected": true,
|
||||||
"virtual_hid_keyboard": {
|
"virtual_hid_keyboard": {
|
||||||
"country_code": 0,
|
"country_code": 0,
|
||||||
"keyboard_type_v2": "iso"
|
"keyboard_type_v2": "iso"
|
||||||
+15
-16
@@ -35,25 +35,24 @@
|
|||||||
"type": "basic"
|
"type": "basic"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
|
||||||
{
|
|
||||||
"description": "swap alt and cmd",
|
|
||||||
"enabled": false,
|
|
||||||
"manipulators": [
|
|
||||||
{
|
|
||||||
"from": { "key_code": "left_option" },
|
|
||||||
"to": [{ "key_code": "left_command" }],
|
|
||||||
"type": "basic"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"from": { "key_code": "left_command" },
|
|
||||||
"to": [{ "key_code": "left_option" }],
|
|
||||||
"type": "basic"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"devices": [
|
||||||
|
{
|
||||||
|
"identifiers": {
|
||||||
|
"is_keyboard": true,
|
||||||
|
"product_id": 21042,
|
||||||
|
"vendor_id": 1155
|
||||||
|
},
|
||||||
|
"simple_modifications": [
|
||||||
|
{
|
||||||
|
"from": { "key_code": "grave_accent_and_tilde" },
|
||||||
|
"to": [{ "key_code": "non_us_backslash" }]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"name": "KarabinerTS",
|
"name": "KarabinerTS",
|
||||||
"selected": true,
|
"selected": true,
|
||||||
"virtual_hid_keyboard": { "keyboard_type_v2": "iso" }
|
"virtual_hid_keyboard": { "keyboard_type_v2": "iso" }
|
||||||
+15
-16
@@ -35,25 +35,24 @@
|
|||||||
"type": "basic"
|
"type": "basic"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
|
||||||
{
|
|
||||||
"description": "swap alt and cmd",
|
|
||||||
"enabled": false,
|
|
||||||
"manipulators": [
|
|
||||||
{
|
|
||||||
"from": { "key_code": "left_option" },
|
|
||||||
"to": [{ "key_code": "left_command" }],
|
|
||||||
"type": "basic"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"from": { "key_code": "left_command" },
|
|
||||||
"to": [{ "key_code": "left_option" }],
|
|
||||||
"type": "basic"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"devices": [
|
||||||
|
{
|
||||||
|
"identifiers": {
|
||||||
|
"is_keyboard": true,
|
||||||
|
"product_id": 21042,
|
||||||
|
"vendor_id": 1155
|
||||||
|
},
|
||||||
|
"simple_modifications": [
|
||||||
|
{
|
||||||
|
"from": { "key_code": "grave_accent_and_tilde" },
|
||||||
|
"to": [{ "key_code": "non_us_backslash" }]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"name": "KarabinerTS",
|
"name": "KarabinerTS",
|
||||||
"selected": true,
|
"selected": true,
|
||||||
"virtual_hid_keyboard": { "keyboard_type_v2": "iso" }
|
"virtual_hid_keyboard": { "keyboard_type_v2": "iso" }
|
||||||
@@ -0,0 +1,117 @@
|
|||||||
|
{
|
||||||
|
"profiles": [
|
||||||
|
{
|
||||||
|
"complex_modifications": {
|
||||||
|
"rules": [
|
||||||
|
{
|
||||||
|
"description": "dual purpose modifiers",
|
||||||
|
"manipulators": [
|
||||||
|
{
|
||||||
|
"from": {
|
||||||
|
"key_code": "spacebar",
|
||||||
|
"modifiers": { "optional": ["any"] }
|
||||||
|
},
|
||||||
|
"to": [
|
||||||
|
{
|
||||||
|
"key_code": "left_shift",
|
||||||
|
"lazy": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"to_if_alone": [{ "key_code": "spacebar" }],
|
||||||
|
"type": "basic"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"from": {
|
||||||
|
"key_code": "caps_lock",
|
||||||
|
"modifiers": { "optional": ["any"] }
|
||||||
|
},
|
||||||
|
"to": [
|
||||||
|
{
|
||||||
|
"key_code": "left_control",
|
||||||
|
"lazy": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"to_if_alone": [{ "key_code": "escape" }],
|
||||||
|
"type": "basic"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"devices": [
|
||||||
|
{
|
||||||
|
"identifiers": {
|
||||||
|
"is_keyboard": true,
|
||||||
|
"product_id": 21042,
|
||||||
|
"vendor_id": 1155
|
||||||
|
},
|
||||||
|
"simple_modifications": [
|
||||||
|
{
|
||||||
|
"from": { "key_code": "grave_accent_and_tilde" },
|
||||||
|
"to": [{ "key_code": "non_us_backslash" }]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name": "KarabinerTS",
|
||||||
|
"selected": true,
|
||||||
|
"virtual_hid_keyboard": { "keyboard_type_v2": "iso" }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Default profile",
|
||||||
|
"virtual_hid_keyboard": {
|
||||||
|
"country_code": 0,
|
||||||
|
"keyboard_type_v2": "ansi"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"complex_modifications": {
|
||||||
|
"rules": [
|
||||||
|
{
|
||||||
|
"description": "Caps Lock to ESC on tap/Left control on hold",
|
||||||
|
"manipulators": [
|
||||||
|
{
|
||||||
|
"from": {
|
||||||
|
"key_code": "caps_lock",
|
||||||
|
"modifiers": { "optional": ["any"] }
|
||||||
|
},
|
||||||
|
"to": [
|
||||||
|
{
|
||||||
|
"key_code": "left_control",
|
||||||
|
"lazy": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"to_if_alone": [{ "key_code": "escape" }],
|
||||||
|
"type": "basic"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "Space to shift on hold",
|
||||||
|
"manipulators": [
|
||||||
|
{
|
||||||
|
"from": {
|
||||||
|
"key_code": "spacebar",
|
||||||
|
"modifiers": { "optional": ["any"] }
|
||||||
|
},
|
||||||
|
"to": [
|
||||||
|
{
|
||||||
|
"key_code": "left_shift",
|
||||||
|
"lazy": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"to_if_alone": [{ "key_code": "spacebar" }],
|
||||||
|
"type": "basic"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"name": "Modified profile",
|
||||||
|
"virtual_hid_keyboard": {
|
||||||
|
"country_code": 0,
|
||||||
|
"keyboard_type_v2": "iso"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -47,6 +47,7 @@ vim.cmd [=[
|
|||||||
nnoremap ,x <C-x>
|
nnoremap ,x <C-x>
|
||||||
nnoremap ,rl :checktime<CR>
|
nnoremap ,rl :checktime<CR>
|
||||||
nnoremap ,m :wa<CR>:make<CR>
|
nnoremap ,m :wa<CR>:make<CR>
|
||||||
|
inoremap <c-k> <c-x>
|
||||||
|
|
||||||
nnoremap ,cD :call setqflist(filter(getqflist(), 'v:val != getqflist()[getqflist({"idx": 0}).idx - 1]'))<CR>
|
nnoremap ,cD :call setqflist(filter(getqflist(), 'v:val != getqflist()[getqflist({"idx": 0}).idx - 1]'))<CR>
|
||||||
|
|
||||||
@@ -303,6 +304,7 @@ do
|
|||||||
gcc={'*.c'},
|
gcc={'*.c'},
|
||||||
['g++']={'*.cpp'},
|
['g++']={'*.cpp'},
|
||||||
cargo={'Cargo.toml'},
|
cargo={'Cargo.toml'},
|
||||||
|
zig={'*.zig'}
|
||||||
}
|
}
|
||||||
|
|
||||||
---@param dir string?
|
---@param dir string?
|
||||||
@@ -402,7 +404,6 @@ require'lazy'.setup{ --{{{1
|
|||||||
---@module 'oil'
|
---@module 'oil'
|
||||||
---@type oil.SetupOpts
|
---@type oil.SetupOpts
|
||||||
opts = {},
|
opts = {},
|
||||||
dependencies = { { 'echasnovski/mini.icons', opts = {} } },
|
|
||||||
lazy = false,
|
lazy = false,
|
||||||
config = function ()
|
config = function ()
|
||||||
require('oil').setup({
|
require('oil').setup({
|
||||||
@@ -574,12 +575,13 @@ require'lazy'.setup{ --{{{1
|
|||||||
require'mini.align'.setup()
|
require'mini.align'.setup()
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{ 'miikanissi/modus-themes.nvim', --{{{2
|
{ 'sainnhe/everforest', --{{{2
|
||||||
lazy = false,
|
lazy = false,
|
||||||
priority = 1000,
|
priority = 1000,
|
||||||
config = function()
|
config = function()
|
||||||
vim.o.termguicolors = true
|
vim.o.termguicolors = true
|
||||||
vim.cmd.colorscheme('modus_vivendi')
|
vim.g.everforest_enable_italic = true
|
||||||
|
vim.cmd.colorscheme('everforest')
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{ 'folke/lazydev.nvim', --{{{2
|
{ 'folke/lazydev.nvim', --{{{2
|
||||||
@@ -674,6 +676,18 @@ require'lazy'.setup{ --{{{1
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
do -- turtle config
|
||||||
|
local turtle_server = vim.fn.exepath("turtle-language-server")
|
||||||
|
local node = vim.fn.exepath("node")
|
||||||
|
if turtle_server ~= "" and node ~= "" then
|
||||||
|
vim.lsp.config['turtle-language-server'] = {
|
||||||
|
cmd={ node, turtle_server, '--stdio' },
|
||||||
|
filetypes = { 'turtle', 'ttl' },
|
||||||
|
}
|
||||||
|
vim.lsp.enable('turtle-language-server')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
vim.lsp.enable('gdscript')
|
vim.lsp.enable('gdscript')
|
||||||
vim.lsp.config('hls', {
|
vim.lsp.config('hls', {
|
||||||
filetypes = { 'haskell', 'lhaskell', 'cabal' },
|
filetypes = { 'haskell', 'lhaskell', 'cabal' },
|
||||||
@@ -854,7 +868,6 @@ require'lazy'.setup{ --{{{1
|
|||||||
dependencies = {
|
dependencies = {
|
||||||
'nvim-lua/plenary.nvim',
|
'nvim-lua/plenary.nvim',
|
||||||
'nvim-telescope/telescope-ui-select.nvim',
|
'nvim-telescope/telescope-ui-select.nvim',
|
||||||
'kyazdani42/nvim-web-devicons',
|
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
local actions = require'telescope.actions'
|
local actions = require'telescope.actions'
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ func Picker(options []string, pickerOptions ...PickerOption) (choiceIdx int, ok
|
|||||||
func initialize(nOptions int) {
|
func initialize(nOptions int) {
|
||||||
rl.SetTraceLogLevel(rl.LogError)
|
rl.SetTraceLogLevel(rl.LogError)
|
||||||
rl.InitWindow(0, 0, "raymenu")
|
rl.InitWindow(0, 0, "raymenu")
|
||||||
rl.SetWindowState(rl.FlagWindowUndecorated)
|
rl.SetWindowState(rl.FlagWindowUndecorated | rl.FlagWindowTopmost)
|
||||||
rl.SetTargetFPS(
|
rl.SetTargetFPS(
|
||||||
int32(
|
int32(
|
||||||
rl.GetMonitorRefreshRate(
|
rl.GetMonitorRefreshRate(
|
||||||
|
|||||||
@@ -92,6 +92,12 @@ func main() {
|
|||||||
}
|
}
|
||||||
slices.Sort(seshNames)
|
slices.Sort(seshNames)
|
||||||
|
|
||||||
|
printSeshContents := func(name string) (content string, ok bool) {
|
||||||
|
cmd := exec.Command(tmux, "capture-pane", "-epN", "-t", name)
|
||||||
|
stdout, err := cmd.Output()
|
||||||
|
return string(stdout), err == nil
|
||||||
|
}
|
||||||
|
|
||||||
options := []fuzzyfinder.Option{
|
options := []fuzzyfinder.Option{
|
||||||
fuzzyfinder.WithPreviewWindow(
|
fuzzyfinder.WithPreviewWindow(
|
||||||
func(i, width, height int) string {
|
func(i, width, height int) string {
|
||||||
@@ -100,6 +106,10 @@ func main() {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
seshName := seshNames[i]
|
seshName := seshNames[i]
|
||||||
|
content, ok := printSeshContents(seshName)
|
||||||
|
if ok {
|
||||||
|
return content
|
||||||
|
}
|
||||||
windows, _ := config[seshName]
|
windows, _ := config[seshName]
|
||||||
builder := strings.Builder{}
|
builder := strings.Builder{}
|
||||||
for _, window := range windows {
|
for _, window := range windows {
|
||||||
|
|||||||
+2
-1
@@ -30,6 +30,7 @@ bind b break-pane
|
|||||||
|
|
||||||
set -g default-terminal "tmux-256color"
|
set -g default-terminal "tmux-256color"
|
||||||
set -as terminal-overrides ",xterm-256color:Tc"
|
set -as terminal-overrides ",xterm-256color:Tc"
|
||||||
|
set -as terminal-features ',xterm-256color:sync'
|
||||||
set -g base-index 1
|
set -g base-index 1
|
||||||
setw -g pane-base-index 1
|
setw -g pane-base-index 1
|
||||||
set -g renumber-windows on
|
set -g renumber-windows on
|
||||||
@@ -46,7 +47,7 @@ set -g status-position top
|
|||||||
set -g status-left-length 100
|
set -g status-left-length 100
|
||||||
set -g status-style "fg=${gray_light},bg=default"
|
set -g status-style "fg=${gray_light},bg=default"
|
||||||
set -g status-left "#[fg=${green_soft},bold] #S #[fg=${gray_light},nobold] | "
|
set -g status-left "#[fg=${green_soft},bold] #S #[fg=${gray_light},nobold] | "
|
||||||
set -g status-right "#[fg=${gray_dark}]%H:%M"
|
set -g status-right ""
|
||||||
set -g window-status-current-format " #[fg=${white},bold]#I.#W "
|
set -g window-status-current-format " #[fg=${white},bold]#I.#W "
|
||||||
set -g window-status-format " #I.#W "
|
set -g window-status-format " #I.#W "
|
||||||
set -g message-style "fg=${gray_medium},bg=default"
|
set -g message-style "fg=${gray_medium},bg=default"
|
||||||
|
|||||||
Reference in New Issue
Block a user