Skip to content

Instantly share code, notes, and snippets.

@kennypete
kennypete / navigating_the_modes_of_Vim.md
Created April 18, 2024 20:46
Navigating the modes of Vim

Navigating the modes of Vim

This diagram illustrates navigating through Vim’s modes. It was built factoring Vim 9 (i.e., all its modes, including up to two new modes, cr and cvr, in November 2023). Information about the state() and 'showmode' is provided too.

SVG version

Some features are only available in the SVG version. It is not provided directly from within this gist’s files because SVGs do not always play nicely in GitHub (particularly, refusing to display embedded fonts).

The SVG version includes hover text help, which shows pertinent information about the underlying key, command, mode, etc.

@guidoism
guidoism / layers.json
Created November 4, 2022 17:16
Keymap Status Viewer
["TAB q w e r t y u i o p BS \nCTL a s d f g h j k l :; RET\nSFT z x c v b n m , . / \u25cc\n \u25cc \u25cc OPT CMD M1 M3 \u2423 M2 \u25cc \u25cc \u25cc \u25cc", " ~ ! @ # $ % ^ 7 8 9 \u25cc \u25cc\n \u25cc \" & * _ \u25cc + 4 5 6 ' |\n \u25cc \u25cc \u25cc \u25cc \u25cc . 0 1 2 3 / \u25cc\n \u25cc \u25cc OPT CMD \u25c9 \u25cc \u25cc M5 \u25cc \u25cc \u25cc \u25cc", " ` \u25cc \u25cc \u25cc \u25cc \u25cc \u25cc \u25cc \u25cc \u25cc \u25cc BS\n \u25cc [ ] ( ) \u25cc \u25cc - = \u25cc \u25cc \\\n \u25cc < > { } \u25cc \u25cc \u25cc \u25cc \u25cc \u25cc \u25cc\n \u25cc \u25cc OPT CMD M4 \u25cc \u25cc \u25c9
@JoakimThorsen
JoakimThorsen / TMC links.md
Last active March 17, 2024 00:41
An attempt at collecting TMC-related resources, websites, mods, servers, and other links.
@deoxys314
deoxys314 / 4d.vim
Last active October 14, 2020 15:16
Four-Dimensional Editing in Vim
let s:second = 1
let s:minute = 60 * s:second
let s:hour = 60 * s:minute
let s:day = 24 * s:hour
let s:week = 7 * s:day
let s:month = 30 * s:day
let s:year = 365 * s:day
function! s:get_undo_time(undo_dict) abort
let l:idx = a:undo_dict.seq_cur
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active May 8, 2024 21:42
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@iamcaleberic
iamcaleberic / pulse.md
Last active November 26, 2023 05:43
Enabling Pulse Audio Equaliser Arch Linux

Enabling Pulse Audio Equaliser Arch Linux

  • Install the pulseaudio package.

     $ pacman -S pulseaudio
    
  • Install control module and equlizer

     $ pacman -S pulseaudio-equalizer pavucontrol
    
  • Install gst-plugins-good if your intended program has a legacy GStreamer implementation.

@avesus
avesus / .bashrc
Last active June 19, 2022 04:09
Vim with NERDTree Adequate Defaults
# I love super fast keyboard. Most of my friends and colleagues can't follow
# I use `atkbd.softrepeat=1` on the kernel command line.
# Even Visual Assist plugin in Visual Studio doubles keyboard repeat rate with _a reason_.
# I'm working on my laptop without X installed to avoid procrastination.
# I've spend a working day googling how to make `kbdrate` using slower delay than 250.
# Add this to your /etc/profile.d/kbdrate.sh: sudo kbdrate -r 82 -d 150 if you want it in console.
# Note that it will force you type password twice. I didn't find any workarounds.
xset r rate 150 82
# When exiting from Vim, just type
@romainl
romainl / pseudo-text-objects.vim
Last active January 11, 2024 07:45
Custom pseudo-text objects
" 24 simple pseudo-text objects
" -----------------------------
" i_ i. i: i, i; i| i/ i\ i* i+ i- i#
" a_ a. a: a, a; a| a/ a\ a* a+ a- a#
" can take a count: 2i: 3a/
for char in [ '_', '.', ':', ',', ';', '<bar>', '/', '<bslash>', '*', '+', '-', '#' ]
execute "xnoremap i" . char . " :<C-u>execute 'normal! ' . v:count1 . 'T" . char . "v' . (v:count1 + (v:count1 - 1)) . 't" . char . "'<CR>"
execute "onoremap i" . char . " :normal vi" . char . "<CR>"
execute "xnoremap a" . char . " :<C-u>execute 'normal! ' . v:count1 . 'F" . char . "v' . (v:count1 + (v:count1 - 1)) . 'f" . char . "'<CR>"
execute "onoremap a" . char . " :normal va" . char . "<CR>"
@wrburgess
wrburgess / 1_initial_migration.rb
Last active December 7, 2023 14:14
Setting up UUID columns for Rails 5+ models utilizing Postgres 9.4+
class InitialMigration < ActiveRecord::Migration[5.0]
def change
enable_extension "pgcrypto" unless extension_enabled?("pgcrypto")
end
end