pressing option + arrow keys on an empty prompt navigates your directory history in fish shell
lifehacks TILs
- hardwrap in vim with gqip #
Set the textwidth option first, e.g.
:set textwidth=77Then
gqwill reformat the lines you want.For example,
- select a block of text ->
gq - you’re in a paragraph and want to reformat the whole paragraph ->
gpip - reformat the next 10 lines ->
gq10j
Here’s how I configure this in my
.editorconfigto set a textwidth in markdown files:[*.md]max_line_length = 77 - select a block of text ->
- vim "+norm Go" "+startinsert" $filename #
Use the command
vim "+norm Go" "+startinsert" $filenameto automatically move at the end of the file and start editing.
This is useful when you are invoking vim from another script i.e. when you don’t want this to be the default behaviour but want it in a special case.
For me this was useful for my
journalscript which appends the current time at the end of a file and opens the file and (now) automatically moves to the end and goes to insert mode. - We can run queries across a range in google sheets #
Query Language Reference (Version 0.7) | Charts | Google for Developers
QUERY function - Google Docs Editors Help
Google Sheets supports a QUERY function using which we can run queries on a range of data.
The Google Visualization API Query Language has a SQL-like syntax and exposes a variety of functions to work on the selected range.
For example,
The following query groups by date summing the values in column B. The query runs on the rangeA:B=QUERY(A:B, "SELECT todate(A), SUM(B) GROUP BY todate(A)")
"Any sufficiently advanced technology is indistinguishable from magic."
— Arthur C. Clarke