Skip to content

Instantly share code, notes, and snippets.

View aberezin's full-sized avatar

Alan Berezin aberezin

View GitHub Profile
@aberezin
aberezin / gist:692657ff3d5711349f2abce0ab9ccb30
Last active March 27, 2023 19:13 — forked from rolandcrosby/gist:c26571bf4e263f695d2f
Convert rich text on the clipboard to Markdown
We couldn’t find that file to show.
@aberezin
aberezin / defauts.duti
Created April 5, 2022 17:38 — forked from apfelchips/defaults.duti
set file-associations on macOS: ~ 🥖.config 🥖duti 🥖defauts.duti
# duti settings file
# src: https://gist.github.com/apfelchips/0073cb3e8d186115f590d318998c1025
# mkdir -p "${XDG_CONFIG_HOME:-$HOME/.config}/duti/" && curl -L "https://git.io/JRtzH" -o "${XDG_CONFIG_HOME:-$HOME/.config}/duti/default.duti"
# duti-apply wrapper: alias duti-apply='duti -v "${XDG_CONFIG_HOME:-$HOME/.config}/duti"'
## duti documentation https://web.archive.org/web/20180901095433/http://duti.org/documentation.html
## see also: https://github.com/Lord-Kamina/SwiftDefaultApps#readme
# List of MIME Types:
@aberezin
aberezin / ini2json.py
Created January 1, 2020 18:03 — forked from Natim/ini2json.py
Convert an ini configuration file into a json file
# -*- coding: utf-8 -*-
import json
import sys
from ConfigParser import (ConfigParser, MissingSectionHeaderError,
ParsingError, DEFAULTSECT)
class StrictConfigParser(ConfigParser):
def _read(self, fp, fpname):
@aberezin
aberezin / iterm
Created June 22, 2018 22:53 — forked from vyder/iterm
iterm.bash - Launch iTerm from command line
#!/usr/bin/env bash
#
# Open new iTerm window from the command line using v3 syntax for applescript as needed in iTerm2 Version 3+
# This script blocks until the cmd is executed in the new iTerm2 window. It then leaves the window open.
# TODO Add option to close iTerm2 after cmd execs
# See also https://www.iterm2.com/documentation-scripting.html
#
# Usage:
" Canonical is at https://gist.github.com/aberezin/0ee9c5e6354996849d3b0bcb50c6e29c"
" This didnt work for me so lets just manually synch with the gist above
" let configpath = '/Users/aberezin/.cvimrc'
" set localconfig
" ccim_server in ~/bin needs to be run mannually for now. Maybe make a
" service
set noautofocus
set autoupdategist
@aberezin
aberezin / cvimrc
Created November 28, 2017 18:52 — forked from yograf/cvimrc
let hintcharacters="asdfgjkl"
map H previousTab
map L nextTab
map b :buffer<Space>
map B :buffer<Space>
map u lastClosedTab
map O :tabnew<Space>
map T :tabnew&<Space>
@aberezin
aberezin / vim-cheat-sheet.md
Last active June 5, 2016 13:45
Vim Cheat Sheet

Vim Cheat Sheet

My collection of vim tips to make the best editor even better. This is by no means complete or a tutorial on how to use vim, but a set of commands I don't want to forget and need to write them down before they burn into memory. See the resources section below for a more complete introduction and a set of in-depth tutorials.

Files

:tabe SomePath " open a new tab on path :split SomePath (vsplit) " open window (vertical window) on path :r SomePath " read into current buffer

Navigation

:nn            " Jump to line nn