diff --git a/041a1acc.html b/041a1acc.html deleted file mode 100644 index b9d456e..0000000 --- a/041a1acc.html +++ /dev/null @@ -1 +0,0 @@ -
! shell command filtersSpecifying a range when running a ! shell command filters the range through the specified shell command by piping the range’s content into the shell command via stdin and replacing the range with the shell command’s stdout.
Running
:1,10!sort -ron
2
-3
-7
-1
-9
-4
-0
-8
-5
-6results in:
9
-8
-7
-6
-5
-4
-3
-2
-1
-0m{a-zA-Z}: set a “bookmark” at a cursor position.
'{mark}: jumps the cursor to first non-whitespace character on the line with.
 `{mark}: jump the cursor to the exact mark position.
Uppercase marks are global, and by default are persisted across sessions.
Don’t forget, search is a motion, and can be combined with other actions, like d (delete): d/foo<CR>.
The expression register (=) can be used to evaluate expressions, like 2+3. If this register is used while in Insert mode (<C-r>=), the results of the expression will be inserted after the expression is evaluated.
Interacting with display lines (vs real lines) is easier when you prefix motion commands with a g.
git check-ignoretoday i ran into an issue where i tried creating a new bin/ dir in a git repo, and trying to add the files within to a new commit, but was greeted by:
$ git add bin/README.md
-
-The following paths are ignored by one of your .gitignore files:
-bin
-hint: Use -f if you really want to add them.
-hint: Turn this message off by running
-hint: "git config advice.addIgnoredFile false"confused, i ran a simple grep on the project’s .gitignore:
$ grep bin .gitignore
-which yielded nothing. i was pretty sure i didn’t have that pattern set in my global gitignore, either.
a quick internet search turned up a git util that is new to me:
https://git-scm.com/docs/git-check-ignore
using this command, i was able to trace the exact line responsible:
git check-ignore -v bin
-
-.gitignore:123:[Bb]in   binohhhhh, oops. well, that makes sense. neat! this could’ve been solved with a more sophisticated grep pattern, but who has time for that?
<C-d> in command mode presents an auto-completion listIn command mode you can specify a range of lines to operate on, based on patterns, rather than absolute (or relative line numbers). This can be a great way to isolate changes without looking up the individual line numbers.
:/start/,/end/cmd<CR>On a Python file, this might look like:
def main():
-    foo = do_something()
-    bar = do_something_else(foo)
-    return bar:/def main/,/return/s/foo/baz/g<CR>results in:
def main():
-    baz = do_something()
-    bar = do_something_else(baz)
-    return barx into the top of each roll*2:read allows piping shell stdout into a buffer:read !ls<CR>for example:
041a1acc.md
-56653cb1.md
-73dcbcc7.md
-82ded935.md
-9227847e.md
-92598822.md
-96fc3093.md
-9b74f625.md
-9db45ab6.md
-aab45963.md
-acc60422.md
-b364352b.md
-b926d9bd.md
-c4e96daf.md
-d2e178e0.md
-da69e0f5.md
-dc879f80.md
-ec21e3f5.md
-ec672cb5.md
-fa6a31b4.md
-index.md
-neuron.dhall
-staticBalancing many disparate tasks is good for my morale (“Wow! If I get bored with this one thing, I can just do something else!”), but feeling “behind” is most decidedly not good for my morale. Timeblocking and scheduling are great, but they require discipline. I like to think that I am effectively entering into a short-term contract with myself. If the terms aren’t clear, the chances of failure go up (significantly). Interestingly, I think this scenario represents a conflict of interest: I am basically the party responsible for monitoring that contract, as well as the one actually executing the work.
Besides having a clear plan (a statement of work) I think the next biggest concern involves distractions. In my experience, you can’t get rid of distractions, but you can be judicious about what distractions you choose to entertain. That gets to the same end-goal of choosing when to focus on distractions, but puts a different emphasis on the problem.
The “hard” part (to me) is that developing the intuition of what to do (and when) is much easier said than done. Maybe because it is a constantly moving target?
c instead of deleting and inserting in visual modeUsing the c change action in visual mode is very convenient! For some reason I often neglect that action when operating in visual mode, instead opting for two actions: delete and insert. This seems like a habit worth breaking!
adduser $USER
-usermod -aG sudo $USER
-# if account requires password-less elevation:
-sudo visudo  # add an entry like: $USER ALL=(ALL) NOPASSWD:ALL
-# confirm that the account works as expected
-su - $USERpython-piplibglib2.0-devlibxml2-devlibcurl4-openssl-devlibid3-3.8.3-devvimmopidycastgetsudo raspi-config
-mkdir -p /home/pi/podcasts/{playlists,podcast1,podcast2,podcast3}mopidy + extensions (see links above for installation info)# edit /etc/mopidy/mopidy.conf
-[local]
-enabled = true
-media_dir = /home/pi/podcasts
-scan_timeout = 10000
-
-[file]
-enabled = false
-
-[http]
-enabled = true
-hostname = 0.0.0.0
-port = 6680
-
-[mpd]
-enabled = true
-hostname = 0.0.0.0
-port = 6600
-
-[logging]
-verbosity = 1
-
-[m3u]
-enabled = true
-playlists_dir = /home/pi/podcasts/playlistscastget (see link above for installation info)# edit /home/pi/castgetrc
-
-# note, the keys in this config should correspond with the podcast dirs
-# created in step 1 above
-
-[podcast1]
-url=http://url.to/podcast1
-spool=/home/pi/podcasts/podcast1
-filename=%(date) %(title).mp3
-
-[podcast2]
-url=http://url.to/podcast2
-spool=/home/pi/podcasts/podcast2
-filename=%(date) %(title).mp3
-
-...sync.sh script with the following content (ymmv, use at your own risk):#!/usr/bin/env bash
-
-set -e
-
-# fetch podcasts
-/usr/local/bin/castget -C /home/pi/castgetrc -1 "$1"
-
-playlist="/home/pi/podcasts/playlists/$1.m3u"
-files=(/home/pi/podcasts/$1/*.mp3)
-
-# remove stale playlist
-if [ -f "$playlist" ]
-then
-  rm "$playlist"
-fi
-
-# build new playlist with newest entries _first_
-for (( i=${#files[@]}-1; i>=0; i-- ))
-do
-  fp="${files[$i]}"
-  fn=$(basename -- "$fp")
-
-  # next, we'll make these all relative fps
-  quoted=$(python -c "from urllib import parse, sys; print(parse.quote(sys.argv[1]))" "$fn")
-  echo "local:track:$1/$quoted" >> "$playlist"
-done
-
-sudo mopidyctl local scan5 * * * * /home/pi/sync.sh podcast1 >> /path/to/podcast1.log
-0,15,30,45 15,16,17 * * * /home/pi/sync.sh podcast2 >> /path/to/podcast2.log
-0 0 * * 5 /home/pi/sync.sh podcast3 >> /path/to/podcast3.log/home/pi/podcasts/playlists.:normal command runs normal commands on multiple linesThe :normal command is a useful way to run the same Normal mode command on multiple lines.
:%normal i# <CR>The command above will comment out an entire Python source file.
<C-r><C-w> in command mode will insert the word under the cursor in the cmdRight now this is just a draft outline, ideally I will circle back on this some time this year to fill in some more details.
copy command doesn’t use a registerThe copy command doesn’t use a register. This is useful for not overwriting the current value in the default register - you might not need to run the copy command, but it might help keep your registers clean.
q: opens the command history windowq: opens the command history window. When this window is open, it maintains exclusive focus.
<C-o> & <C-i> & :jumps
gf motion will jump to the filename under the cursorThe suffixadd option needs to be set, although most common filetype plugins should handle this automatically.
From Normal mode, R activates Replace mode, which behaves a lot like Insert mode, except that it allows you to effectively type over existing content. This is different from r, which is a single character replacement (ending back in Normal mode) - R requires you to deliberately exit back to Normal mode.
Notes not belonging to any heterarchy:
The notebook has 29 notes and 31 links. It has 2 clusters in its folgezettel graph. Each cluster's folgezettel heterarchy is rendered as a forest.
experiment(s) with a public notebook.