Skip to content

u/Masterchef365

In this archive from Sep 2015 to May 2019

9
posts
128
comments
7
media
642
score

I feel the need to be able to pin my frequent projects quite often, wrote a little script to scratch that itch.

alias d='pin'
printpins() {
	count=1
	while read -r pin; do
		echo "$count $(basename "$pin")"
		(( count++ ))
	done < $1
}

pin() {
	pindir=$HOME/.pins
	case "$1" in 
		"")
			#cat -n "$pindir" ;;
			printpins $pindir ;;
		"p")
			echo "$PWD" >> $pindir ;;
		"del")
			sed -i "$2d" "$pindir" ;;
		"[0-9][0-9]*")
			echo "$1" >> $pindir ;;
		*)
			cd "$(sed "$1q;d" "$pindir")" ;;
	esac
}

To use the pinning system, simply hit d, and it will display a list of your pins with numbers on the left. You can pin the current directory using d p. To jump to a pinned directory, run d <number listed on the pin>. You can also delete pins easily by running d del <num>. Pin locations are stored in ~/.pins. Enjoy!

3 points

I love it! One nitpick though: Maybe remove the demo directory from the git repo? Cloning an entire MP4 and a few large image files might be a bit slow for those with slower internet connections, or that want to keep a clone of the repo on their machine/dotfiles dir. Thanks!

3 points

Stupid answer, but the one that you end up using is the best plugin manager. It doesn't really matter too much imo, I just use Vundle because it's easy and it works and doesn't complain but there's probably something better out there. The point of customization like this is that you have options. Use what works.

3 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.