In the middle of the desert you can say anything you want
Remembered about and updated the shortcuts for focusing the different monitors:
# focus outputs screen
bindsym $ms+a focus output eDP-1
bindsym $ms+o focus output HDMI-2
bindsym $ms+e focus output DP-1-1
Connected to me remembering about the tabbed layout:
# change container layout (stacked, tabbed, toggle split)
bindsym $ms+s layout stacking
bindsym $ms+Shift+t layout tabbed
bindsym $ms+Shift+s layout toggle split
takes less space than my usual stacked, but makes it hard to focus a different screen via left/right - until now.
For removing multiple folders if it has to be done often, and the folders may or may not be there, esp. with wildcards, current best option I found is not to do rm -rf one/* two/*something* three
but rm -rf one/* && rm -rf two/*something* && rm -rf three
. If one breaks the other ones will still run.
rm -r **
unalias rm
1I don’t know why but the following works for me - no questions asked [..]
rm -rf **
Works for me too.
That answers a question, but not this one! :) – Lambart Jul 28 ‘17 at 0:43 2
ideavim/package-info.java at master · JetBrains/ideavim
* |CTRL-B| {@link com.maddyhome.idea.vim.action.motion.scroll.MotionScrollPageUpAction}
* |CTRL-D| {@link com.maddyhome.idea.vim.action.motion.scroll.MotionScrollHalfPageDownAction}
* |CTRL-F| {@link com.maddyhome.idea.vim.action.motion.scroll.MotionScrollPageDownAction}
* |<BS>| {@link com.maddyhome.idea.vim.action.motion.leftright.MotionLeftWrapAction}
* |CTRL-H| {@link com.maddyhome.idea.vim.action.motion.leftright.MotionLeftWrapAction}
Half-page-down (<Ctrl-D>
) doesn’t work in the output of running programs / debuggers, but <Ctrl-F>
always does. (And <Page Down
> too, ofc.)
ls -l
, last modified and files from last yearme@server:/some/folder$ ls -larh ..
total 290M
drwxr-xr-x 3 me users 4.0K Jul 7 16:51 file
drwxr-xr-x 4 me users 12K Jul 7 16:51 file
drwxr-xr-x 4 me users 4.0K Jul 7 16:42 file
drwxr-xr-x 2 me users 4.0K Jul 7 16:32 file
drwxr-xr-x 4 me users 4.0K Jul 7 16:32 file
-rw-r--r-- 1 me users 0 Jul 7 16:19 file
-rw-r--r-- 1 me users 4.0K Jul 7 16:19 file
-rw-r--r-- 1 me users 0 Jul 7 16:31 file
-rw-r--r-- 1 me users 1.6K Jul 7 16:32 file
-rw-r--r-- 1 me users 144M Oct 1 13:23 file
drwxr-xr-x 7 me users 4.0K Oct 1 13:35 file
-rwxr-xr-x 1 me users 4.9K Oct 2 2019 file
-rw-r--r-- 1 me users 46K Oct 4 2019 file
-rw-r--r-- 1 me users 45K Oct 2 2019 file
-rw-r--r-- 1 me users 146M Oct 2 2019 file
drwxr-xr-x 2 me users 4.0K Oct 2 2019 file
-rwxr-xr-x 1 me users 3.8K Jul 7 16:32 file
drwxrwx--- 13 500 users 4.0K Mar 27 2020 ..
drwxr-xr-x 9 me users 4.0K Sep 30 17:10 .
If files are not from this year, it shows the year instead of the time!
Jacksum - a free cross platform checksum utility
Is also in the repos as jacksum
.
jacksum -a hashingAlgo -x filename
<Ctrl-plus>
and <Ctrl-minus>
increase / decrease Slack font size!
bash - Linux head/tail with offset - Stack Overflow:
-n, --lines=K
output the last K lines, instead of the last 10;
or use -n +K to output lines starting with the Kth
You can therefore use
... | tail -n +2 | head -n 3
to get 3 lines starting from line 2.
Simple but effective. tail -n +N
does tail
starting from linenumber N.
Search is search, but “find in path” (and some other stuff) is find. I wonder if there’s a meaningful semantic difference in there. Semantic difference between Find and Search? - Stack Overflow has the logical ones, but I can’t connect it to how intellij idea uses them.
bar {
wheel_up_cmd nop
wheel_down_cmd exec ~/.i3/scripts/custom_wheel_down
}
1
is an example. Disabled it in config
, not the i3 statusbars own configs.
“Step out” (<Shift-F8>
) skips to the first line executed after returning from the current method.
<Shift-Return>
changes the window from one line to multi and back.
tee
vs less
with UTF-16 / UTF-16LE encoding + reading them in vimIf a file is UTF-16 encoded, tee
works much better than less
.
To read UTF-16LE in vim, the command is:
:e ++enc=utf-16le
In my text version of this, I need a nice way of interlinking parts of the text. Ideally in a way that adding text doesn’t break it, and in a way that it’s still text-safe.
screenkey
1 (in the repos too) shows the keys you pressed on the screen.
screenkey --show-settings
shows a nice GUI before start with all the configs.
Looks like the second answer here: folding - Is there a best practice to fold a vimrc file - Vi and Vim Stack Exchange
This answer has an awesome idea for folds, something very close to what I was looking for in my long notes file: folding - Is there a best practice to fold a vimrc file - Vi and Vim Stack Exchange
In general TODO vim folds - create a nice stable system instead of the ad hoc hell I have now.
Also How to enable and use code folding in Vim? - Unix & Linux Stack Exchange has a nice summary of fold keybindings:
I forgot I used <leader>
for most of the things I’m currently using F12 for!
TODO I guess A shell script that changes monitor configurations, volume, changes some of the zsh aliases to show me the correct taskwarrior todos, etc.
Something like this:
#!/bin/zsh
if [ "$1" == "work" ]
then
echo "Setting configs to work..."
export SOMETHNIG="something" ...
...
else
echo "Setting configs to home..."
export SOMETHNIG="something" ...
...
fi
zsh
How do I get all open terminals to use the new env. variables though?
If you paste an URL containing characters with a meaning in markdown, it breaks syntax highlight till the end of the file. Especially URIs containing an uneven number of underscores. Fix is either make it code
, or indent it - it seems formatting is local for indentation, at least for vim.
jq
stdin
, otherwise it’s jq filter inputData
.It supports newlines in filters!
“Data science and the command line” (from json - How to nicely remove empty array in jq - Stack Overflow}
I can drag and drop my screenshots in the terminal and it pastes the absolute location!
Wow. …wow. command line - Uniq won’t remove duplicate - Unix & Linux Stack Exchange
This explains really a lot.
The &&
and ||
operators “short-circuit”, meaning they don’t evaluate the right-hand side if it isn’t necessary.
The &
and |
operators, when used as logical operators, always evaluate both sides.
There is only one case of short-circuiting for each operator, and they are:
false && ...
- it is not necessary to know what the right-hand side is because the result can only be false
regardless of the value theretrue || ...
- it is not necessary to know what the right-hand side is because the result can only be true
regardless of the value there. 1Clicking on “improve this answer”, even when not logged in, gives access to the source markdown that I can copy here preserving most formatting.
Stand-off markup (also known as remote markup or stand-off annotation) is the kind of markup that resides in a location different from the location of the data being described by it. It is thus the opposite of inline markup, where data and annotations are intermingled within a single location. 2
The wiki it’s from is also nice: TEIWiki It’s All pages - TEIWiki would be interesting to look through, NB it has a non-intuitive “next page” link there.
I need either a command or an alias for “create task and start immediately”, along with some nice way to create boilerplate code for tasks
“In case if you want to “go back in time” while debugging you can do it via Drop Frame action. This is a great help if you mistakenly stepped too far. This will not revert the global state of your application but at least will get you back by stack of frames.” 3 (Icon with a red X on top left.)
Does it make a difference if I declare variables inside or outside a loop in Java? - Software Engineering Stack Exchange - TL;DR it doesn’t, if you are not creating complex objects. The way to learn this is to look at the generated bytecode, using javap
.
This is freaking awesome:
k: history-search-backward
j: history-search-forward
… in ~/.inputrc
allows using j/k for scrolling through history in vim mode. 1 This configures readline
that then is used by (at least) bash, zsh, and fish.
ag
commandI still have it installed as a standalone command, I should use it. Ag (silver searcher) is better than ack, which is better than grep. ggreer/the_silver_searcher: A code-searching tool similar to ack, but faster.
TODO get proficient with them and learn how exactly they are better for writing code.
dict.cc | muskelkrampf | English Dictionary - muscle cramp
<Ctrl-Shift-f>
for “Find in path” - extremely useful for large codebases; info from Tony.
“The best minds of my generation are thinking about how to make people click ads.” –Jeff Hammerbacher
Found on I no longer build software | Hacker News in the context of Allow docker push’ to push multiple/a subset of tags · Issue #267 · docker/cli · GitHub:
@solvaholic: Sorry I missed your comment of many months ago. I no longer build software; I now make furniture out of wood. The hours are long, the pay sucks, and there’s always the opportunity to remove my finger with a table saw, but nobody asks me if I can add an RSS feed to a DBMS, so there’s that :-)
In ‘set status’ there’s a ‘clear’ option, it controls when the status gets reset, minutes/days.
Uncle Dave - YouTube (No script is too simple | Hacker News) - for later. Notable there is:
<Alt-Shift-9>
and the ideavim cursor works!<Alt-F10>
is also really usefulredshift
Remembered that redshift
exists, added it to startup. It’s the program that makes screen redder at night, a la twilight / night mode / etc etc etc.
Reopening closing windows can be done through View -> Tool windows. It has nice shortcuts that are <Alt-N>
, with N=0..9. For example, debug window is <Alt-5>
.
Additionally - I should use F7
/ ‘step into’ much more.
<Alt-7>
opens a nice structure window with info about the long class you’re editing. With nice options like show public/fields/..
java - Save state of object in IntelliJ debug? - Stack Overflow - google/gson is the answer. User guide: gson/UserGuide.md at master · google/gson · GitHub
Gson gson = new Gson();
gson.toJson(1); // ==> 1
gson.toJson("abcd"); // ==> "abcd"
gson.toJson(new Long(10)); // ==> 10
int[] values = { 1 };
gson.toJson(values); // ==> [1]
// Deserialization
int one = gson.fromJson("1", int.class);
Integer one = gson.fromJson("1", Integer.class);
Long one = gson.fromJson("1", Long.class);
Boolean false = gson.fromJson("false", Boolean.class);
String str = gson.fromJson("\"abc\"", String.class);
String[] anotherStr = gson.fromJson("[\"abc\"]", String[].class);
Not drag-and-drop for more complex stuff though.
You can create breakpoints at all exceptions of a certain type, even when they are caught. May lead to discovery that there are a lot of them in the code :)
On this topic - “Run to cursor” is nice