diff options
author | Alan Pearce | 2018-06-07 13:55:17 +0200 |
---|---|---|
committer | Alan Pearce | 2018-06-07 13:55:17 +0200 |
commit | 10dded485e1c2627575b2b9e21dfaabc31ee07f3 (patch) | |
tree | b3f0369bae776cd556078225fc446c10165f8624 /content/post/repository-management-with-ghq.md | |
parent | 956bf3a40be61da586bd5178a3868ca037eebbe8 (diff) | |
download | website-10dded485e1c2627575b2b9e21dfaabc31ee07f3.tar.lz website-10dded485e1c2627575b2b9e21dfaabc31ee07f3.tar.zst website-10dded485e1c2627575b2b9e21dfaabc31ee07f3.zip |
Use code fences instead of template tags for syntax highlighting
Diffstat (limited to 'content/post/repository-management-with-ghq.md')
-rw-r--r-- | content/post/repository-management-with-ghq.md | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/content/post/repository-management-with-ghq.md b/content/post/repository-management-with-ghq.md index 6006605..d831c9e 100644 --- a/content/post/repository-management-with-ghq.md +++ b/content/post/repository-management-with-ghq.md @@ -8,10 +8,10 @@ I recently encountered [ghq][], a tool for automatically organising VCS-backed projects automatically. Give it a repository URL, it will clone a project to your projects dir (set by `$GHQ_ROOT`) like so: -{{< highlight sh >}} +```sh $ ghq get https://github.com/motemen/ghq # Runs `git clone https://github.com/motemen/ghq ~/.ghq/github.com/motemen/ghq` -{{< /highlight >}} +``` I don't like the idea of having projects hidden away, so I set `$GHQ_ROOT` to `$HOME/projects`. @@ -23,11 +23,11 @@ I wanted a nicer way to visit project directories. Since I'm using [fzf][] as a fuzzy-finder, I thought it would be nice to use it for this. I created a simple function, `fp` (find project) to do that: -{{< highlight sh >}} +```sh fp () { ghq look $(ghq list | fzf +m) } -{{< /highlight >}} +``` I ran into some issues with the subshell of `ghq look` and wondered whether it might be possible to create a zsh command to remove the @@ -36,7 +36,7 @@ need for a subshell. I found that `fzf` includes a [cd-widget function][fzf-cd-widget] and created something similar that uses `ghq` instead of `find`: -{{< highlight sh >}} +```sh cd-project-widget () { local cmd="ghq list" setopt localoptions pipefail 2> /dev/null @@ -52,7 +52,7 @@ cd-project-widget () { return $ret } zle -N cd-project-widget -{{< /highlight >}} +``` It should be quite simple to modify it to work with other fuzzy-finders. The basic idea is to show the output of `ghq list` for @@ -62,9 +62,9 @@ to print the correct directory for `cd`. What's really nice about this, is that I can bind it to a key sequence: -{{< highlight sh >}} +```sh bindkey '\es' cd-project-widget -{{< /highlight >}} +``` Now I can press `M-s` in a shell, start typing "dotfiles" and press enter to `cd` to my [dotfiles][] project. Pretty neat! |