Skip to content

Instantly share code, notes, and snippets.

View xEgorka's full-sized avatar
⌨️
oversteer

Egor Maltsev xEgorka

⌨️
oversteer
View GitHub Profile
@todgru
todgru / starttmux.sh
Last active September 26, 2024 04:28
Start up tmux with custom windows, panes and applications running
#!/bin/sh
#
# Setup a work space called `work` with two windows
# first window has 3 panes.
# The first pane set at 65%, split horizontally, set to api root and running vim
# pane 2 is split at 25% and running redis-server
# pane 3 is set to api root and bash prompt.
# note: `api` aliased to `cd ~/path/to/work`
#
session="work"
@squarism
squarism / iterm2.md
Last active March 3, 2025 09:28
An iTerm2 Cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)
@QuantumGhost
QuantumGhost / example.puml
Last active September 21, 2024 19:19
A simple template for PlantUML to draw ER diagram.The basic idea comes from http://plantuml.sourceforge.net/qa/?qa=331/database-modeling
@startuml
' uncomment the line below if you're using computer with a retina display
' skinparam dpi 300
!define Table(name,desc) class name as "desc" << (T,#FFAAAA) >>
' we use bold for primary key
' green color for unique
' and underscore for not_null
!define primary_key(x) <b>x</b>
!define unique(x) <color:green>x</color>
!define not_null(x) <u>x</u>
@romainl
romainl / pseudo-text-objects.md
Last active March 3, 2025 06:04
Custom pseudo-text objects

This is a list of custom pseudo-text objects for Vim.

Note the use of "pseudo", here. Conceptually, text object are "special" motions but there is no proper mechanism dedicated to creating text objects, specifically. We are left with the generic mechanism succinctly described under the easy-to-miss :help omap-info.

Writing one's own pseudo-text objects and motions is a great way to extend Vim without perverting its nature ;-).


My Vim-related gists.

@romainl
romainl / grep.md
Last active February 14, 2025 13:41
Instant grep + quickfix

FOREWORDS

I don't mean the snippet at the bottom of this gist to be a generic plug-n-play solution to your search needs. It is very likely to not work for you or even break things, and it certainly is not as extensively tested and genericised as your regular third-party plugin.

My goal, here and in most of my posts, is to show how Vim's features can be leveraged to build your own high-level, low-maintenance, workflows without systematically jumping on the plugins bandwagon or twisting Vim's arm.


Instant grep + quickfix

@g0xA52A2A
g0xA52A2A / Vim_autoreply.md
Last active June 4, 2023 23:30
Vim autoreply

A modified version of Romain's gist.

See prior revisions for functionality closer to the original. This is now a simplification that aims only to provide prompts that would typically follow basic commands.

function! ExpandCommand(pattern) abort
  let aliases =
 \ { 'cn' : 'cnext'

Annoying vim search highlight "everyone" tries to get rid of

You have turned on hlsearch for some reason in your vim config (well obviously to highlight your searches) but it gets in your way, right?

Now you try to find a solution to this problem, like

  1. spam random searches /klsdf<CR>

  2. do :nohl command or

@viglioni
viglioni / string-bin.hs
Last active July 2, 2022 21:54
Encode/Decode strings into strings of binaries
--
-- Encodes/Decodes string in a string of binaries
--
-- Each char is converted to a string with eight 0s or 1s
-- λ> encode "The darkside of the force is a pathway to many abilities some consider to be unnatural"
-- "0101010001101000011001010010000001100100011000010111001001101011011100110110100101100100011001010
-- 01000000110111101100110001000000111010001101000011001010010000001100110011011110111001001100011011
-- 00101001000000110100101110011001000000110000100100000011100000110000101110100011010000111011101100
@ndtn97
ndtn97 / cmdtab2missioncontrol.json
Created April 5, 2022 11:06
Karabiner-Elements Command+Tab -> Mission Control
{
"title": "Command + Tab -> Mission Control",
"rules": [
{
"description": "Replace Command + Tab -> Mission Control",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "tab",