Skip to content

Instantly share code, notes, and snippets.

@Konfekt
Konfekt / diff.md
Last active October 18, 2021 08:21 — forked from PeterRincker/diff.md
:DiffOrig but smarter

:DiffOrig but smarter

This is an enhanced version of the snippet provided under :help diff-original-file.

Where the original :DiffOrig only shows differences between the buffer in memory and the file on disk, :Diff can be used in two ways:

  • against the file on disk, like the original, with:

    :Diff
    
@Konfekt
Konfekt / snippy.sh
Last active June 4, 2018 18:40 — forked from coderofsalvation/snippy.sh
modified version of snippy that does NOT use the clipboard and works thus everywhere
#!/usr/bin/env bash
# From
# Based on:
# https://github.com/BarbUk/dotfiles/blob/master/bin/snippy
# https://git.zx2c4.com/password-store/tree/contrib/dmenu/passmenu
DIR=${HOME}/.snippy
MENU_ENGINE="rofi"
DMENU_ARGS='-dmenu -i -sort -lines 25'
function! <sid>CCR()
    if getcmdtype() isnot# ':'
      return "\<CR>"
    endif
    let cmdline = getcmdline()
    if cmdline =~# '\v^\s*(ls|files|buffers)!?\s*(\s[+\-=auhx%#]+)?$'
        " like :ls but prompts for a buffer command
        return "\<CR>:b"
    elseif cmdline =~# '\v/(#|nu%[mber])$'