Skip to content

Instantly share code, notes, and snippets.

View flatcap's full-sized avatar
🥾
Hiking in Scotland

Richard Russon flatcap

🥾
Hiking in Scotland
View GitHub Profile
unset record
set postpone = no
set editor="lorem-ipsum-generator -p1 | fmt >> %s"
macro index,pager <F1> "[email protected]<enter>test<enter>"
@flatcap
flatcap / README.txt
Last active March 2, 2023 14:29
NeoMutt desktop icon
Put neomutt.desktop in /usr/share/applications/
Put mimeapps.list in ~/.local/share/applications/mimeapps.list
Check association with: xdg-mime query default 'x-scheme-handler/mailto'
---
# set the association by command
xdg-mime default neomutt.desktop x-scheme-handler/mailto
@flatcap
flatcap / aliases.sh
Created December 20, 2019 13:47
NeoMutt test reply/group-reply/compose-to-sender
alias m='/usr/bin/mutt -n -F test.rc -f test.mbox'
alias n='/usr/bin/neomutt -n -F test.rc -f test.mbox'
@flatcap
flatcap / nftw1.c
Last active October 17, 2022 21:48
Directory Traversal
/* We want POSIX.1-2008 + XSI, i.e. SuSv4, features */
#define _XOPEN_SOURCE 700
/* Added on 2017-06-25:
If the C library can support 64-bit file sizes
and offsets, using the standard names,
these defines tell the C library to do so. */
#define _LARGEFILE64_SOURCE
#define _FILE_OFFSET_BITS 64
OK, I've got it (I'm not sure I entirely understand, but...) I have individually coloured tags
it's all to do with the tag transforms -- it's a little complicated...
have a look at the 'tag-transforms' and 'tag-formats' in the config file: https://www.neomutt.org/feature/custom-tags#neomuttrc
imagine you have emails notmuch-tagged/labelled with 'inbox', 'invites', 'replied'
this command allows you to abbreviate/iconise the tags: tag-transforms inbox i invites CAL replied ↻
this command allows you to create expandos (%-things) for *individual* tags: tag-formats inbox GI invites Gi replied GR
you can now use %GI %Gi %GR in your index_format string
finally, you can colour *these* expandos using: color index_tag, e.g.
color index_tag red default inbox
color index_tag cyan default invites
@flatcap
flatcap / buffy.md
Created August 4, 2018 08:56
Killing Buffy
Before After
MUTT_BUFFY MUTT_MAILBOX
MUTT_BUFFY_CHECK_FORCE MUTT_MAILBOX_CHECK_FORCE
MUTT_BUFFY_CHECK_FORCE_STATS MUTT_MAILBOX_CHECK_FORCE_STATS
MUTT_SEL_BUFFY MUTT_SEL_MAILBOX
OP_BUFFY_LIST OP_BUFFY_LIST
OP_EDITOR_BUFFY_CYCLE OP_EDITOR_BUFFY_CYCLE
buffy_check mailbox_check
@flatcap
flatcap / context.cocci
Created July 2, 2018 20:59
Transform struct Context members
@@
struct Context *c;
@@
- c->tagged
+ c->nr_tagged
@flatcap
flatcap / apple.c
Last active September 17, 2018 20:54
STAILQ objects
#include <stdio.h>
#include "mutt/queue.h"
struct Apple
{
int payload;
};
struct AppleNode
{
@flatcap
flatcap / test-dirname.c
Created May 3, 2018 11:28
Test dirname wrapper
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <libgen.h>
#define mutt_array_size(x) (sizeof(x) / sizeof((x)[0]))
void *mutt_mem_malloc(size_t size)
{
void *p = NULL;
@flatcap
flatcap / dirname.c
Last active September 17, 2018 20:55
dirname
char *mutt_file_dirname(const char *path)
{
char *copy = mutt_str_strdup(path);
char *dir = dirname(copy);
if (dir != copy)
{
FREE(&copy);
dir = strdup(dir);
}
return dir;