Skip to content

Instantly share code, notes, and snippets.

@kmanna
kmanna / vimdiff.md
Last active August 29, 2015 14:06 — forked from mattratleph/vimdiff.md

vimdiff cheat sheet

##git mergetool

In the middle file (future merged file), you can navigate between conflicts with ]c and [c.

Choose which version you want to keep with :diffget //2 or :diffget //3 (the //2 and //3 are unique identifiers for the target/master copy and the merge/branch copy file names).

:diffupdate (to remove leftover spacing issues)

:only (once you’re done reviewing all conflicts, this shows only the middle/merged file)

#
# Shell functions to wrap cmdline utility output with JSON
#
# Useful for running shell commands and then extracting output with logstash
#
json_kv_pair()
{
K="$1" # key
V="$2" # value
Q="$3" # quote
#include <unistd.h>
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <dirent.h>
#include <stdint.h>
#include <sys/types.h>