From 1a87b2f580bb5ab22691c79702368fd8a5539090 Mon Sep 17 00:00:00 2001 From: Jonas 'Sortie' Termansen Date: Sat, 24 Sep 2016 00:26:07 +0200 Subject: [PATCH] Add suggestion to use vim(1) if installed. --- build-aux/ports.conf | 2 +- utils/command-not-found.c | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/build-aux/ports.conf b/build-aux/ports.conf index 63f80272..4790087a 100644 --- a/build-aux/ports.conf +++ b/build-aux/ports.conf @@ -1,3 +1,3 @@ set_minimal="cut dash e2fsprogs grep grub mdocml sed xargs" -set_basic="$set_minimal binutils bison bzip2 diffutils flex gawk gcc git gzip libstdc++ make patch pkg-config tar xz xorriso" +set_basic="$set_minimal binutils bison bzip2 diffutils flex gawk gcc git gzip libcurses libstdc++ make patch pkg-config tar vim xz xorriso" sets="basic minimal" diff --git a/utils/command-not-found.c b/utils/command-not-found.c index 0a29e5cc..ce716a1f 100644 --- a/utils/command-not-found.c +++ b/utils/command-not-found.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015 Jonas 'Sortie' Termansen. + * Copyright (c) 2013, 2015, 2016 Jonas 'Sortie' Termansen. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -22,11 +22,14 @@ #include #include #include +#include void suggest_editor(const char* filename) { fprintf(stderr, "No command '%s' found, did you mean:\n", filename); - fprintf(stderr, " Command 'editor' from package 'utils'\n"); + fprintf(stderr, " Command 'editor' from package 'editor'\n"); + if ( access("/bin/vim", X_OK) == 0 ) + fprintf(stderr, " Command 'vim' from package 'vim'\n"); } void suggest_pager(const char* filename)