From 2e4ed8f86762a889c626432832c837c23dfb72dd Mon Sep 17 00:00:00 2001 From: Gokcehan Date: Mon, 11 Jan 2021 00:40:14 +0300 Subject: [PATCH] fix default promptfmt to use %d instead of %w cc #545 --- doc.go | 6 +++--- docstring.go | 6 +++--- lf.1 | 6 +++--- opts.go | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/doc.go b/doc.go index 7c76495..a77cdf5 100644 --- a/doc.go +++ b/doc.go @@ -119,7 +119,7 @@ The following options can be used to customize the behavior of lf: preview bool (default on) previewer string (default '') cleaner string (default '') - promptfmt string (default "\033[32;1m%u@%h\033[0m:\033[34;1m%w\033[0m\033[1m%f\033[0m") + promptfmt string (default "\033[32;1m%u@%h\033[0m:\033[34;1m%d\033[0m\033[1m%f\033[0m") ratios []int (default '1:2:3') relativenumber bool (default off) reverse bool (default off) @@ -604,7 +604,7 @@ The file should be executable. One argument is passed to the file; the path to the file whose preview should be cleaned. Preview clearing is disabled when the value of this option is left empty. - promptfmt string (default "\033[32;1m%u@%h\033[0m:\033[34;1m%w/\033[0m\033[1m%f\033[0m") + promptfmt string (default "\033[32;1m%u@%h\033[0m:\033[34;1m%d/\033[0m\033[1m%f\033[0m") Format string of the prompt shown in the top line. Special expansions are provided, '%u' as the user name, '%h' as the host name, '%w' as the working directory, and '%f' as the file name. @@ -1172,7 +1172,7 @@ You can define it just as you would define any other command: GIT_PS1_SHOWUNTRACKEDFILES=auto GIT_PS1_SHOWUPSTREAM=auto git=$(__git_ps1 " (%s)") || true - fmt="\033[32;1m%u@%h\033[0m:\033[34;1m%w\033[0m\033[1m%f$git\033[0m" + fmt="\033[32;1m%u@%h\033[0m:\033[34;1m%d\033[0m\033[1m%f$git\033[0m" lf -remote "send $id set promptfmt \"$fmt\"" }} diff --git a/docstring.go b/docstring.go index 0e88127..b61915e 100644 --- a/docstring.go +++ b/docstring.go @@ -122,7 +122,7 @@ The following options can be used to customize the behavior of lf: preview bool (default on) previewer string (default '') cleaner string (default '') - promptfmt string (default "\033[32;1m%u@%h\033[0m:\033[34;1m%w\033[0m\033[1m%f\033[0m") + promptfmt string (default "\033[32;1m%u@%h\033[0m:\033[34;1m%d\033[0m\033[1m%f\033[0m") ratios []int (default '1:2:3') relativenumber bool (default off) reverse bool (default off) @@ -642,7 +642,7 @@ preview cache disabled. The file should be executable. One argument is passed to the file; the path to the file whose preview should be cleaned. Preview clearing is disabled when the value of this option is left empty. - promptfmt string (default "\033[32;1m%u@%h\033[0m:\033[34;1m%w/\033[0m\033[1m%f\033[0m") + promptfmt string (default "\033[32;1m%u@%h\033[0m:\033[34;1m%d/\033[0m\033[1m%f\033[0m") Format string of the prompt shown in the top line. Special expansions are provided, '%u' as the user name, '%h' as the host name, '%w' as the working @@ -1314,7 +1314,7 @@ define any other command: GIT_PS1_SHOWUNTRACKEDFILES=auto GIT_PS1_SHOWUPSTREAM=auto git=$(__git_ps1 " (%s)") || true - fmt="\033[32;1m%u@%h\033[0m:\033[34;1m%w\033[0m\033[1m%f$git\033[0m" + fmt="\033[32;1m%u@%h\033[0m:\033[34;1m%d\033[0m\033[1m%f$git\033[0m" lf -remote "send $id set promptfmt \"$fmt\"" }} diff --git a/lf.1 b/lf.1 index 2d036ad..04442d9 100644 --- a/lf.1 +++ b/lf.1 @@ -133,7 +133,7 @@ The following options can be used to customize the behavior of lf: preview bool (default on) previewer string (default '') cleaner string (default '') - promptfmt string (default "\e033[32;1m%u@%h\e033[0m:\e033[34;1m%w\e033[0m\e033[1m%f\e033[0m") + promptfmt string (default "\e033[32;1m%u@%h\e033[0m:\e033[34;1m%d\e033[0m\e033[1m%f\e033[0m") ratios []int (default '1:2:3') relativenumber bool (default off) reverse bool (default off) @@ -722,7 +722,7 @@ Set the path of a previewer file to filter the content of regular files for prev Set the path of a cleaner file. This file will be called if previewing is enabled, the previewer is set, and the previously selected file had its preview cache disabled. The file should be executable. One argument is passed to the file; the path to the file whose preview should be cleaned. Preview clearing is disabled when the value of this option is left empty. .PP .EX - promptfmt string (default "\e033[32;1m%u@%h\e033[0m:\e033[34;1m%w/\e033[0m\e033[1m%f\e033[0m") + promptfmt string (default "\e033[32;1m%u@%h\e033[0m:\e033[34;1m%d/\e033[0m\e033[1m%f\e033[0m") .EE .PP Format string of the prompt shown in the top line. Special expansions are provided, '%u' as the user name, '%h' as the host name, '%w' as the working directory, and '%f' as the file name. Home folder is shown as '~' in the working directory expansion. Directory names are automatically shortened to a single character starting from the left most parent when the prompt does not fit to the screen. @@ -1284,7 +1284,7 @@ There is a special command 'on-cd' that runs a shell command when it is defined GIT_PS1_SHOWUNTRACKEDFILES=auto GIT_PS1_SHOWUPSTREAM=auto git=$(__git_ps1 " (%s)") || true - fmt="\e033[32;1m%u@%h\e033[0m:\e033[34;1m%w\e033[0m\e033[1m%f$git\e033[0m" + fmt="\e033[32;1m%u@%h\e033[0m:\e033[34;1m%d\e033[0m\e033[1m%f$git\e033[0m" lf -remote "send $id set promptfmt \e"$fmt\e"" }} .EE diff --git a/opts.go b/opts.go index bdda51f..ce3ace0 100644 --- a/opts.go +++ b/opts.go @@ -91,7 +91,7 @@ func init() { gOpts.ifs = "" gOpts.previewer = "" gOpts.cleaner = "" - gOpts.promptfmt = "\033[32;1m%u@%h\033[0m:\033[34;1m%w\033[0m\033[1m%f\033[0m" + gOpts.promptfmt = "\033[32;1m%u@%h\033[0m:\033[34;1m%d\033[0m\033[1m%f\033[0m" gOpts.shell = gDefaultShell gOpts.timefmt = time.ANSIC gOpts.truncatechar = "~"