In the middle of the desert you can say anything you want
Has nice keyboard shortcuts, viewable with ?
. Heavily vim-inspired
Deleted as they were not interesting/relevant anymore, but one of these days I’ll post my final (Russian-language) presentation somewhere here.
You can add things like someObject.someFunction()
and basically any python code there! And it starts getting evaluated immediately after adding, even without stepping through or anything similar! This will save me a lot of “Eval code” - whose last remaining purpose can then be .. is “exploratory debugging” a thing?
There’s a “Go back” action, <C-A-Left>
is the default mapping on my installation - does what it says on the box. Handy for going back after looking at the implementation of something etc etc etc. Can’t find it in the ideavim actionlist though :( Though found <C-O>
to jump to the last edited line which is very handy too:
* |CTRL-O| {@link com.maddyhome.idea.vim.action.motion.mark.MotionJumpPreviousAction}
Life keeps telling me to learn the tools I use daily, to read the entire help/manual etc - maybe one day I’ll learn to do this.
If you refactor a loop variable, such as for t in ...
, if you choose to replace strings in comments, it might replace that letter outside tokens - the “t” in “won’t”, for example. (Not that clicking “Refactor” without looking at the suggestions is ever a good idea).
Object-Detection-Metrics/_init_paths.py at master · rafaelpadilla/Object-Detection-Metrics doesn’t use a main function in the files it runs, but has this neat snippet to add the library to PATH. TODO - at which point does this file get run and using what mechanism?
Add :undo –window by toofar · Pull Request #4807 · qutebrowser/qutebrowser adds this ability, mapped to U
by default. Works for windows!
In general with autosave set, if I’m disciplined enough to close it with :quit
or something mapped to it, it should reopen all of them.
So, again:
Adding the files to /etc/cron.hourly
/daily/weekly/… makes them executed at least once a X. Better than standard way for instances where the computer can be turned off during the planned time, and then it won’t execute - the way above makes sure it will.
Miller (mlr
) is a tool for doing stuff to csvs like jq is for jsqn: Quick examples — Miller 5.10.2 documentation
cocoapi/pycocoDemo.ipynb at master · cocodataset/cocoapi has a nice example of a use case that’s not printlns:
dataDir='..'
dataType='val2017'
annFile='{}/annotations/instances_{}.json'.format(dataDir,dataType)
Nothing was working, neither tqdm nor atpbar, till I used “emulate terminal” in the running config. As soon as I did all bars started working!
Nested loops - for tqdm, nothing needed except just calling it twice. The inner loop, tqdm(iterator, leave=False)
removes the 100% completed inner bar and restarts from 0, so only two bars are seen at the same time.
atpbar (alphatwirl/atpbar: Progress bars for threading and multiprocessing tasks on terminal and Jupyter Notebook) is basically like tqdm. Can’t find an option similar to leave=True
(though didn’t look), and output looks juuust a bit nicer than vanilla tqdm.
Since speedtest-cli is dead, this is an option that works:
curl -o /dev/null http://speedtest-blr1.digitalocean.com/100mb.test
vim -u NONE
. vim -u filenaem
reads only that filename as .vimrc
, NONE
is a key to not use anything.
Finally decided to undertand this part: Vim documentation: pattern
\m
is magic, \M
is nomagic. \m
/magic is the default.\v
is verymagic, \V
is very nomagicHandy table from the documentation:
Examples:
after: \v \m \M \V matches
'magic' 'nomagic'
$ $ $ \$ matches end-of-line
. . \. \. matches any character
* * \* \* any number of the previous atom
() \(\) \(\) \(\) grouping into an atom
| \| \| \| separating alternatives
\a \a \a \a alphabetic character
\\ \\ \\ \\ literal backslash
\. \. . . literal dot
\{ { { { literal '{'
a a a a literal 'a'
Practically:
\v
/verymagic - almost everything has a special meaning (numbers, letters and _
are the only ones parsed as-is)\V
/verynomagic - almost nothing has a special meaning, everything interpreted as-is EXCEPT \
A Vim Guide for Adept Users has these nice tips that I’ll stick to:
My advice in this madness: remember that very magic will allow you to use every regex metacharacter without escaping them, and that very nomagic oblige you to escape these metacharacters to use them.
and
I propose this simple rule:
- When you need a regex, use “very magic” by adding \v before your pattern.
- When you don’t need a regex, use “very nomagic” by adding \V before your pattern.
It also has this nice list:
\s or [:blank:] - whitespace characters.
[A-Z] or \u or [:upper:] - Uppercase.
[a-z] or \l or [:lower:] - Lowercase.
[0-9] or \d or [:digit:] - Digits.
\_ - Character class with end of line included.