add keybind to run nvim
This commit is contained in:
parent
6f3a3a393a
commit
210b781c57
|
@ -15,7 +15,8 @@ static Shortcut shortcuts[] = {
|
||||||
{ ControlMask, XK_y, clipcopy, {.i = 0} },
|
{ ControlMask, XK_y, clipcopy, {.i = 0} },
|
||||||
{ ControlMask, XK_p, clippaste, {.i = 0} },
|
{ ControlMask, XK_p, clippaste, {.i = 0} },
|
||||||
{ TERMMOD, XK_Num_Lock, numlock, {.i = 0} },
|
{ TERMMOD, XK_Num_Lock, numlock, {.i = 0} },
|
||||||
{ ControlMask|ShiftMask, XK_k, kscrollup, {.i = +1} },
|
{ ControlMask|ShiftMask, XK_E, kexec, {.ca = "nvim" } },
|
||||||
{ ControlMask|ShiftMask, XK_j, kscrolldown, {.i = +1} },
|
{ ControlMask|ShiftMask, XK_K, kscrollup, {.i = +1} },
|
||||||
{ ControlMask|ShiftMask, XK_U, externalpipe, { .v = listurl } },
|
{ ControlMask|ShiftMask, XK_J, kscrolldown, {.i = +1} },
|
||||||
|
{ ControlMask|ShiftMask, XK_U, externalpipe, {.v = listurl } },
|
||||||
};
|
};
|
||||||
|
|
17
st.c
17
st.c
|
@ -834,6 +834,23 @@ execsh(char *cmd, char **args)
|
||||||
_exit(1);
|
_exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
kexec(const Arg *a)
|
||||||
|
{
|
||||||
|
char buf[strlen(a->ca) + 2];
|
||||||
|
snprintf(buf, sizeof buf, "%s%s", a->ca, "\n");
|
||||||
|
ttywrite(buf, sizeof buf, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
kwrite(const Arg *a)
|
||||||
|
{
|
||||||
|
char buf[strlen(a->ca) + 1];
|
||||||
|
snprintf(buf, sizeof buf, "%s", a->ca);
|
||||||
|
ttywrite(buf, sizeof buf, 0);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
sigusr1(int unused)
|
sigusr1(int unused)
|
||||||
{
|
{
|
||||||
|
|
3
st.h
3
st.h
|
@ -83,6 +83,7 @@ typedef union {
|
||||||
int i;
|
int i;
|
||||||
uint ui;
|
uint ui;
|
||||||
float f;
|
float f;
|
||||||
|
char *ca;
|
||||||
const void *v;
|
const void *v;
|
||||||
const char *s;
|
const char *s;
|
||||||
} Arg;
|
} Arg;
|
||||||
|
@ -95,6 +96,8 @@ void kscrolldown(const Arg *);
|
||||||
void kscrollup(const Arg *);
|
void kscrollup(const Arg *);
|
||||||
void externalpipe(const Arg *);
|
void externalpipe(const Arg *);
|
||||||
void externalpipein(const Arg *);
|
void externalpipein(const Arg *);
|
||||||
|
void kexec(const Arg *);
|
||||||
|
void kwrite(const Arg *);
|
||||||
void printscreen(const Arg *);
|
void printscreen(const Arg *);
|
||||||
void printsel(const Arg *);
|
void printsel(const Arg *);
|
||||||
void sendbreak(const Arg *);
|
void sendbreak(const Arg *);
|
||||||
|
|
Loading…
Reference in a new issue