Skip to content

Instantly share code, notes, and snippets.

@jerdna-regeiz
jerdna-regeiz / i3.config
Last active June 16, 2021 10:54
Use vim anywhere by filling clipboard in i3 (inspired by vim-anywhere)
# uses simple terminal (could be replaced with i3-sensible-terminal)
# replace xclip with the clipboard tool of your choice
# will have last selection as content in the editor per default
bindsym $mod+Ctrl+Return exec "zsh -c 'file=$(mktemp); xclip -o > $file; st -n FloatingST -e vim $file; head -c -1 $file| xclip -se c;'"
for_window [instance="Floating.*"] floating enable
@jerdna-regeiz
jerdna-regeiz / togglesurround.vim
Created January 24, 2019 10:11
vim-surround toggling quotes
function! Toggle_Surround(char)
let pos = getcurpos()
let cur = col(".")
exe "norm! va".a:char
let start = col("v")
let end = col(".")
exe "norm! \<esc>"
call cursor(pos[1], pos[2])
if start <= cur && cur <= end && start != end
" inside quote :)