In the middle of the desert you can say anything you want
Started to crash suddenly. git pull
-ing didn’t help, but it and recreating the virtualenv using scripts/mkenv.py
did.
der werkzeugkasten - toolbox/kit
This makes empty newlines be part of the fold: 1
" Ignore empty lines when using tabfold
:set foldignore=#<CR>
.. exists and works. 2
.one.two|=sort_by('.whatever')|.next.thing
(Also used in input of some other internal tools) They are: 1
Range Meaning
1.0 x >= 1.0 * The default Maven meaning for 1.0 is everything (,) but with 1.0 recommended. Obviously this doesn't work for enforcing versions here, so it has been redefined as a minimum version.
(,1.0] x <= 1.0
(,1.0) x < 1.0
[1.0] x == 1.0
[1.0,) x >= 1.0
(1.0,) x > 1.0
(1.0,2.0) 1.0 < x < 2.0
[1.0,2.0] 1.0 <= x <= 2.0
(,1.0],[1.2,) x <= 1.0 or x >= 1.2. Multiple sets are comma-separated
(,1.1),(1.1,) x != 1.1
literal_eval - ast - Python documentation - Kite
Safely evaluates Python expressions, nice to use for input.
may only consist of the following Python literal structures: strings, numbers, tuples, lists, dicts, booleans, and None.
To pipe output with jq
to for example less
preserving the colours, use -C
. (Simialar to --color=always
etc.)
jq . $filename -C | less
The script that sets dev/prod sets a variable to 1 if using dev. Based on that variable I get (or not) a red (B) in my zsh prompt.
Did these changes to the theme clean2.zsh-theme
:
PROMPT='%{$fg[green]%}(%*/%!)$ZSH_USING_DEV%{$fg[$NCOLOR]%}%B%b%{$reset_color%}%{$fg[blue]%}%B%5c/%b%{$reset_color%} $(git_prompt_info)%(!.#.$) '
ZSH_USING_DEV=""
if [ "$USING_DEV" = "1" ]
then
ZSH_USING_DEV="%{$fg_bold[red]%}[B]%{$fg[$NCOLOR]%}"
fi
and in ~/.zsrhc
alias uc='. ~/s/setenv.sh p'
alias ud='. ~/s/setenv.sh d'
Using the usual ./
way doesn’t work!
Note the . ~/s..
in the script above.
Running it as ~/what.sh
will create a new shell, export the new values there, and close it. Starting with a .
will make it run the script without starting a new shell. 1
“Publish without notifying watchers” exits.
If I paste something from vim that has tabs in it in a Code block, in the Edit window it will look fine, but won’t at the end. Editing again will make it again look fine in the edit window. Moral: use spaces.
If you copypaste things from it to code blocks in jira/confluence it will start being weird. You can do expandtabs/retab to convert it to something that looks just like this with spaces when saved. Though feels suboptimal.
If I have a laptop and two external monitors, put the ‘distracting’ things on the laptop monitor and close the laptop. Open it when I’m officially doing a pause.
I shouldn’t forget that I have g
aliased to grep
, along with h
to history | grep
.
Just tried this and it works:
h vim | g http
Added this 1 to ./zshrc
:
expand-aliases() {
unset 'functions[_expand-aliases]'
functions[_expand-aliases]=$BUFFER
(($+functions[_expand-aliases])) &&
BUFFER=${functions[_expand-aliases]#$'\t'} &&
CURSOR=$#BUFFER
}
zle -N expand-aliases
bindkey '^E' expand-aliases
^E
is <C-e>
. Gets run anytime I use it, without connection to the written text. Neat.
Also found this in ./.zshrc
:
# Usage:
# In the middle of the command line:
# (command being typed)<TAB>(resume typing)
#
# At the beginning of the command line:
# <SPACE><TAB>
# <SPACE><SPACE><TAB>
#
# Notes:
# This does not affect other completions
# If you want 'cd ' or './' to be prepended, write in your .zshrc 'export TAB_LIST_FILES_PREFIX'
# I recommend to complement this with push-line-or edit (bindkey '^q' push-line-or-edit)
function tab_list_files
{
if [[ $#BUFFER == 0 ]]; then
BUFFER="ls "
CURSOR=3
zle list-choices
zle backward-kill-word
elif [[ $BUFFER =~ ^[[:space:]][[:space:]].*$ ]]; then
BUFFER="./"
CURSOR=2
zle list-choices
[ -z ${TAB_LIST_FILES_PREFIX+x} ] && { BUFFER=" "; CURSOR=2; }
elif [[ $BUFFER =~ ^[[:space:]]*$ ]]; then
BUFFER="cd "
CURSOR=3
zle list-choices
[ -z ${TAB_LIST_FILES_PREFIX+x} ] && { BUFFER=" "; CURSOR=1; }
else
BUFFER_=$BUFFER
CURSOR_=$CURSOR
zle expand-or-complete || zle expand-or-complete || {
BUFFER="ls "
CURSOR=3
zle list-choices
BUFFER=$BUFFER_
CURSOR=$CURSOR_
}
fi
}
zle -N tab_list_files
bindkey '^I' tab_list_files
<C-i>
gives a list of files in the directory, and space-space-tab at the beginning of the line too. <C-q>
(push-line-or-edit
). More about it here: TIL: save half-typed commands in bash and zsh « Serge Gebhardt (sgeb.io) TL;DR remove command currently being edited and paste it at the next Return.
Seen in the wild at work: ASAPST - like ASAP, but even more urgent. 1
Just found this hack: if the program you want to use doesn’t pick the right camera and you can’t control that through settings, open another program that will use the wrong camera - the first program will pick the first free camera, the one you want.