Skip to content

Instantly share code, notes, and snippets.

View TroyFletcher's full-sized avatar

Troy Fletcher TroyFletcher

View GitHub Profile
@TroyFletcher
TroyFletcher / vim_tmux_no_X_clipboard.vim
Last active February 8, 2022 21:05
Sharing clipboards between vim and tmux without xsel or xclip or X forwarding
" Share clipboards between vim and tmux without xsel or xclip (which require X and
" X forwarding with SSH) and without changing tmux shortcuts. Requires only tail.
"
" Great for an ssh session to you linode or droplet.
"
" Uses z buffer in vim and writes output to ~/.clipboard and then to tmux's paste
" buffer, and reads it back in cleanly for putting (puddin').
"
" NOTE: tmux has an undocumented command limit! https://github.com/tmux/tmux/issues/254
" this means if you mean to copy larger bits of code (entire functions) tmux will
@TroyFletcher
TroyFletcher / vim_airline_with_total_line_count.vim
Last active November 2, 2015 16:54
Append total line count after current line number on default airline statusline (IE: from 12 to 12/34)
" Off the basic output [echom g:airline_section_z] I've added /%L after the %4l
" and moved the %#__restore__# to keep only the current line bold
" Added canonically according to https://github.com/bling/vim-airline/issues/482
function! AirlineInit()
let g:airline_section_z = '%3p%% %{g:airline_symbols.linenr}%#__accent_bold#%4l%#__restore__#/%L:%3v'
endfunction
autocmd VimEnter * call AirlineInit()
@TroyFletcher
TroyFletcher / live_rot13_insert_mode.vim
Last active November 5, 2015 04:16
Obfuscate text entry into vim by applying Rot13 live as you type
" Hide what you're typing in using rot13 live as you enter text
" Obviously, you need to type accurately since you can't see your entered text
" Use F3 to toggle plaintext view and review your work
map <F3> mmggg?G`m|"Toggle Rot13 on whole file in normal mode
imap <F3> <ESC>mmggg?G`ma|"Toggle Rot13 while in insert mode
inoremap a n
inoremap b o
inoremap c p
inoremap d q
@TroyFletcher
TroyFletcher / FletchINKeasyAVR.dat
Last active January 12, 2016 20:53
The EasyAVR layout for my Frosty Flake'd Cooler Master Quick Fire Rapid
const uint8_t PROGMEM LAYERS[NUMBER_OF_LAYERS][NUMBER_OF_ROWS][NUMBER_OF_COLS] = {
{
{ 0, 0, HID_KEYBOARD_SC_LEFT_ARROW, 0, 0, HID_KEYBOARD_SC_SLASH_AND_QUESTION_MARK, 0, 0, 0, HID_KEYBOARD_SC_B, HID_KEYBOARD_SC_N, 0, SCANCODE_FN, HID_KEYBOARD_SC_RIGHT_ALT, HID_KEYBOARD_SC_F12, 0, HID_KEYBOARD_SC_DOWN_ARROW, HID_KEYBOARD_SC_RIGHT_ARROW, },
{ 0, 0, 0, 0, 0, 0, HID_KEYBOARD_SC_Z, HID_KEYBOARD_SC_X, HID_KEYBOARD_SC_C, HID_KEYBOARD_SC_V, HID_KEYBOARD_SC_M, HID_KEYBOARD_SC_COMMA_AND_LESS_THAN_SIGN, HID_KEYBOARD_SC_DOT_AND_GREATER_THAN_SIGN, 0, HID_KEYBOARD_SC_ENTER, HID_KEYBOARD_SC_RIGHT_CONTROL, 0, 0, },
{ 0, HID_KEYBOARD_SC_LEFT_SHIFT, 0, HID_KEYBOARD_SC_RIGHT_ALT, 0, HID_KEYBOARD_SC_OPENING_BRACKET_AND_OPENING_BRACE, HID_KEYBOARD_SC_TAB, HID_KEYBOARD_SC_LEFT_CONTROL, HID_KEYBOARD_SC_F3, HID_KEYBOARD_SC_T, HID_KEYBOARD_SC_Y, HID_KEYBOARD_SC_CLOSING_BRACKET_AND_CLOSING_BRACE, HID_KEYBOARD_SC_F7, 0, HID_KEYBOARD_SC_BACKSPACE, 0, 0, 0, },
{ HID_KEYBOARD_SC_RIGHT_GUI, HID_KEYBOARD_SC_RIGHT_SHIFT, 0,
@TroyFletcher
TroyFletcher / .vimrc
Last active August 4, 2019 05:16
Proverbial VimRC. NOT copied from anyone else. Perhaps there's some trick you might use
" git clone https://gist.github.com/b1f4795e010049e8087322dd0a7960bf.git
set nocompatible " This must be first... BECAUSE REASONS...
let mapleader = "\<Space>"
let maplocalleader = "\<Space>"
set t_Co=256
set laststatus=2 " For airline
filetype off
" set the runtime path to include Vundle and initialize
"set rtp+=~\Downloads\vimwin\bundle\Vundle.vim

Keybase proof

I hereby claim:

  • I am troyfletcher on github.
  • I am troyfletcher (https://keybase.io/troyfletcher) on keybase.
  • I have a public key ASAGTao2FmXpSwavpeKJUeahjfAVFBHdHi23gZucyS0Kygo

To claim this, I am signing this object: