Commit graph

373 commits

Author SHA1 Message Date
ff1562506d Add vim role 2019-11-15 19:08:53 +00:00
5be5f80179 Add bash role 2019-11-15 17:11:24 +00:00
f65c4858ab Add support for per-user bash completion files 2019-11-13 14:42:07 +01:00
4e9c8e8470 Ensure PATH directories are in correct order
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.
2019-11-11 13:04:25 +01:00
10ad8282e2 Fix glob for bash completions 2019-11-11 11:43:53 +01:00
b8c257ff9b Shorten unnecessarily long parts 2019-11-11 11:37:11 +01:00
d5245eab46 Keep installation prefix in the environment 2019-11-11 11:20:24 +01:00
a49fe75566 Refactor bash PROMPT_COMMAND function
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.
2019-11-08 13:38:28 +01:00
a9e50f2ba8 Call __git_ps1 as function instead of command substitution
This results in a slightly faster prompt because it saves us one fork()
call for the subshell that now doesn't have to be instantiated.
2019-11-08 10:44:59 +01:00
7243dc02b3 Minor refactoring
Just renaming last_status to exit because the latter is a more common
term.
2019-11-08 10:33:17 +01:00
f178b0c3cf Fix sourcing of local bash configuration 2019-11-08 10:03:22 +01:00
907eb892de Improve bash prompt speed
Avoiding starting many processes during creation of the PS1 string makes
the shell much more responsive, especially under Cygwin, which has
problems with fork().
2019-11-08 09:22:42 +01:00
c5baba5f5f Another useful alias for getting IP information
Also use -s flag in curl so we don't get progress bars.
2019-11-03 03:27:14 +01:00
d053c5c82c bashrc aliases for better head & tail 2019-11-03 03:22:12 +01:00
5bbbfb0632 Replace ~/.python_history with $XDG_CACHE_HOME/python/history 2019-11-03 02:52:18 +01:00
a3c3bcf1d6 Add a python startup file for interactive sessions
This is a preparation to move the .python_history file into an XDG
directory -> $XDG_CACHE_HOME/python/history
2019-11-03 02:27:29 +01:00
f7a498dbb7 Use XDG Base Directory Specification
SSH is an exception because there seems to be no good way of supporting
XDG. Patience, I guess...
2019-11-03 01:53:27 +01:00
16cd08905e Improve readability of if statements in bashrc 2019-11-01 01:58:53 +01:00
3a90bdad1f Fixes based on shellcheck output 2019-11-01 01:53:14 +01:00
2d468f2070 Better python virtual env in bash prompt 2019-11-01 00:45:59 +01:00
c69f179c88 Better job reporting in bash prompt 2019-11-01 00:34:49 +01:00
11c60060db Further bash prompt improvements 2019-11-01 00:29:38 +01:00
8908b16f72 Improvements to mintty options 2019-10-31 19:53:27 +01:00
d8e97c7c2c Fix setting the terminal palette under tmux 2019-10-31 19:52:22 +01:00
ca131bb775 Formatting tweaks to bashrc 2019-10-31 19:51:53 +01:00
ea55d530cf Fix display of background jobs in bash prompt 2019-10-31 03:15:56 +01:00
3b3e080335 Fix exit code of last command in bash prompt 2019-10-31 03:15:14 +01:00
ea58023c79 Fix colorized man to use tput 2019-10-31 03:08:07 +01:00
c04175aa85 Use tput to set terminal colors 2019-10-31 02:36:02 +01:00
5319e2de68 Remove bashrc prefix from functions 2019-10-31 01:44:07 +01:00
616b026f4a Fix terminal palette customization 2019-10-31 01:39:30 +01:00
0ed0677dc8 Minor tweaks to setting bash prompt 2019-10-30 20:19:02 +01:00
7384c7730b Clean up bash variables after use
Plus some minor visual tweaks on .bashrc
2019-10-30 20:07:18 +01:00
3c6d6c695b Improve colorized man
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
2019-10-30 19:54:29 +01:00
2c37d63937 Simplify tree improvements 2019-10-30 19:50:45 +01:00
4d1f7305ee Refactor terminal customization for readability 2019-10-30 18:43:49 +01:00
cce6134b94 Refactor .bashrc so we don't define so many functions 2019-10-30 17:30:36 +01:00
51ff9f8fdd Add background jobs to bash prompt 2019-10-29 23:40:18 +01:00
5af3c5ac0d Remove unnecessary loop when setting bash shopt 2019-10-29 23:07:31 +01:00
b06ab834a5 Make bash output redirection safer 2019-10-29 22:51:27 +01:00
afa328fc06 Remove bashrc support for Apple Terminal
I find myself never really using it...
2019-10-29 20:31:35 +01:00
58ea4980d0 Simplify sending terminal OSC in bashrc 2019-10-29 20:30:20 +01:00
172146a66e Remove unnecessary bash exports
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.
2019-10-29 20:13:24 +01:00
16213cf3e1 Simplify showing python virtual env in bash prompt 2019-10-29 18:41:12 +01:00
1850606d1a Avoid polluting env with bashrc iteration variables 2019-10-29 18:30:09 +01:00
2b72adc543 Extract sourcing of bash completion helpers into a function 2019-10-29 18:21:07 +01:00
e6d06f00cb Indent bash PATH additions for readability
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.
2019-10-29 18:14:57 +01:00
b608d71738 Rewrite (and simplify) SSH config 2019-10-28 18:40:18 +01:00
52aa81e0fb Use non-standard port for GitLab SSH access 2019-10-24 12:30:22 +00:00
04701a7511 Remove superfluous user name definition
We already define that connections to `polaris` are done with the user
`fernando`.
2019-10-23 22:04:06 +02:00