Since the old ports I was using are now no longer accessible from work,
I had to change to the following:
- 143/imap for SSH logins and tunneling
- 587/smtp for access to git repos over SSH
Hopefully these ports will stay open because they are common services.
The default value is:
let g:ctrlp_working_path_mode = 'ra'
which means:
a - like "c", but only applies when the current working directory outside of
CtrlP isn't a direct ancestor of the directory of the current file.
r - the nearest ancestor that contains one of these directories or files:
.git .hg .svn .bzr _darcs
So this makes it more convenient to work within repositories, which is
what I mostly do anyway.
Previously we only checked if the new directory was already in the PATH
and, if yes, didn't prepend it. This can cause the new directory to be
in an unexpected position.
Now we first remove any occurrences of the new directory (to prevent
duplication) and prepend it so it's in the position we expect.
Two main changes:
- avoid 2 additional fork() calls by evaluating \j instead of using
$(jobs | wc -l) -> one fork for subshell and another for `wc`.
- make the build up of the prompt a bit more modular by using an
array to collect the pieces and "sort of" join them in the end.
Avoiding starting many processes during creation of the PS1 string makes
the shell much more responsive, especially under Cygwin, which has
problems with fork().
The previous solution worked fine for coloring the man pages but the
display in bash's job control was a disaster:
$ man sshd_config # followed by CTRL-z
$ jobs
[1]+ Stopped env LESS_TERMCAP_so=$(echo
-ne"\033[${standout}m") LESS_TERMCAP_md=$(echo -ne "\033[${bold}m")
LESS_TERMCAP_us=$(echo -ne "\033[${underline}m") LESS_TERMCAP_se=''
LESS_TERMCAP_me='' LESS_TERMCAP_ue='' GROFF_NO_SGR=1 man sshd_config
The new solution behaves identically regarding coloring the man pages
but the job control information is much more useful:
$ man sshd_config # followed by CTRL-z
$ jobs
[1]+ Stopped man sshd_config
Most of these variables are used only within the shell and don't need to
clutter the environment. The notable exception is MANPATH, which we
explicitly want to export.
We could use ``done<<-EOS'' with tabs to also indent the final EOS but
that would introduce mixed indents in our file. The indentation added by
this commit makes the file readable enough.