Skip to content

Instantly share code, notes, and snippets.

@srijanshetty
srijanshetty / git-hook-pdf2htmlEX
Created May 21, 2015 07:04
Git Hook for pdf2htmlEX
#!/usr/bin/env bash
set -e
branch=$(git rev-parse --abbrev-ref HEAD)
if [[ $branch == "master" ]]; then
xelatex cv
git checkout gh-pages
pdf2htmlEX --process-outline 0 --zoom 1.6 cv.pdf
@srijanshetty
srijanshetty / git-fshow
Last active May 28, 2019 20:36 — forked from akatrevorjay/git-fshow
Browsing git commit history with fzf
#!/bin/zsh
# git-fshow - git commit browser
#
# https://gist.github.com/akatrevorjay/9fc061e8371529c4007689a696d33c62
# https://asciinema.org/a/101366
#
git-fshow() {
local g=(
git log

Vim: pushing built-in features beyond their limits

The situation

Searching can be an efficient way to navigate the current buffer.

The first search commands we learn are usually / and ?. These are seriously cool, especially with the incsearch option enabled which lets us keep typing to refine our search pattern. / and ? really shine when all we want is to jump to something we already have our eyeballs on but they are not fit for every situation:

  • when we want to search something that's not directly there, those two commands can make us loose context very quickly,
  • when we need to compare the matches.

Vim: pushing built-in features beyond their limits

The situation

Searching can be an efficient way to navigate the current buffer.

The first search commands we learn are usually / and ?. These are seriously cool, especially with the incsearch option enabled which lets us keep typing to refine our search pattern. / and ? really shine when all we want is to jump to something we already have our eyeballs on but they are not fit for every situation:

  • when we want to search something that's not directly there, those two commands can make us loose context very quickly,
  • when we need to compare the matches.
@srijanshetty
srijanshetty / redir.md
Created April 17, 2020 05:15 — forked from romainl/redir.md
Redirect the output of a Vim or external command into a scratch buffer

Redirect the output of a Vim or external command into a scratch buffer

Usage (any shell)

Show full output of command :hi in scratch window:

:Redir hi

Show full output of command :!ls -al in scratch window: