diff options
| -rw-r--r-- | README.md | 4 | ||||
| -rw-r--r-- | sam.c | 6 | ||||
| -rw-r--r-- | vis-cmds.c | 11 |
3 files changed, 21 insertions, 0 deletions
@@ -404,6 +404,10 @@ Operators can be forced to work line wise by specifying `V`. :wq write changes then close window :w write current buffer content to file + shell path default $SHELL, /etc/passwd, /bin/sh + + set shell to use for external commands (e.g. <, >, |) + tabwidth [1-8] default 8 set display width of a tab and number of spaces to use if @@ -197,6 +197,7 @@ typedef struct { } OptionDef; enum { + OPTION_SHELL, OPTION_AUTOINDENT, OPTION_EXPANDTAB, OPTION_TABWIDTH, @@ -213,6 +214,11 @@ enum { }; static const OptionDef options[] = { + [OPTION_SHELL] = { + { "shell" }, + OPTION_TYPE_STRING, OPTION_FLAG_NONE, + "Shell to use for external commands (default: $SHELL, /etc/passwd, /bin/sh)", + }, [OPTION_AUTOINDENT] = { { "autoindent", "ai" }, OPTION_TYPE_BOOL, OPTION_FLAG_NONE, @@ -150,6 +150,17 @@ static bool cmd_set(Vis *vis, Win *win, Command *cmd, const char *argv[], Cursor size_t opt_index = opt - options; switch (opt_index) { + case OPTION_SHELL: + { + char *shell = strdup(arg.s); + if (!shell) { + vis_info_show(vis, "Failed to change shell"); + return false; + } + free(vis->shell); + vis->shell = shell; + break; + } case OPTION_EXPANDTAB: vis->expandtab = arg.b; break; |
