Skip to content

Instantly share code, notes, and snippets.

View edkolev's full-sized avatar

Evgeni Kolev edkolev

View GitHub Profile
@edkolev
edkolev / core.clj
Created June 24, 2016 07:33
Lambda Dojo 2 - Markov chains
(ns dojo2.core) ; src/dojo2/core.clj
; functions for building the model
(defn ends-with-dot?
[word]
(clojure.string/ends-with? word "."))
(defn starts-with-capital?
[word]
@edkolev
edkolev / dojo1.hs
Last active April 17, 2016 16:41 — forked from bbsbb/core.clj
Lambda Dojo #1
import Data.List
type Cell = (Int, Int)
type Board = [Cell]
minX :: Board -> Int
minX b = minimum $ map fst b
minY :: Board -> Int
minY b = minimum $ map snd b

Answer by Jim Dennis on Stack Overflow question http://stackoverflow.com/questions/1218390/what-is-your-most-productive-shortcut-with-vim/1220118#1220118

Your problem with Vim is that you don't grok vi.

You mention cutting with yy and complain that you almost never want to cut whole lines. In fact programmers, editing source code, very often want to work on whole lines, ranges of lines and blocks of code. However, yy is only one of many way to yank text into the anonymous copy buffer (or "register" as it's called in vi).

The "Zen" of vi is that you're speaking a language. The initial y is a verb. The statement yy is a simple statement which is, essentially, an abbreviation for 0 y$:

0 go to the beginning of this line. y yank from here (up to where?)

function __promptline_git_details {
[[ $(git rev-parse --is-inside-work-tree 2>/dev/null) == true ]] || return 1
local added_symbol="●"
local unmerged_symbol="✖"
local modified_symbol="✚"
local has_untracked_files_symbol="…"
local clean_symbol="✔"
local ahead_symbol="↑"
local behind_symbol="↓"