Skip to content

Instantly share code, notes, and snippets.

Avatar

Egor Zvorykin EgZvor

  • Санкт-Петербург
View GitHub Profile
@EgZvor
EgZvor / process-vim-log.py
Last active July 4, 2022 12:40
A script to convert specially constructed Vim log into a lines with raw key presses.
View process-vim-log.py
"""See
https://hub.netzgemeinde.eu/channel/vim_sensei?mid=b64.aHR0cHM6Ly9odWIuaG90ZWxkYWFuLm5sL2l0ZW0vZGU2MjI1MDgtZjc1Ni00MGUzLWI1MTgtYjE1YTkwYTg2MWJi
for details on how to set up Vim to produce the log that this script parses.
"""
import fileinput
import os
import re
import signal
import sys
@EgZvor
EgZvor / focus_vim.py
Created February 17, 2022 19:38
Find Vim window in i3 by its server name
View focus_vim.py
#!/usr/bin/python3
"""
The script accepts either an argument or stdin line as a Vim server name
and focuses on i3 window contaning that Vim instance.
Read `:help client-server
<http://vimdoc.sourceforge.net/htmldoc/remote.html#client-server>`_.
Requires ``psutil`` ::
@EgZvor
EgZvor / ash.vim
Last active January 25, 2022 11:22
Automatic search highlighting clearing for Vim
View ash.vim
if exists('g:loaded_auto_search_highlighting')
finish
endif
let g:loaded_auto_search_highlighting = 1
if ! exists('g:auto_search_highlighting')
let g:auto_search_highlighting = 1
endif
@EgZvor
EgZvor / smooth_split.vim
Created December 9, 2021 14:36
Smooth window splitting animation for Vim
View smooth_split.vim
function SmoothSplit(vertical = 0) abort
syntax off
if a:vertical
let new_size = winwidth(0) / 2
vertical 1 split
else
let new_size = winheight(0) / 2
1 split
endif
if a:vertical
@EgZvor
EgZvor / dunstrc.cfg
Last active November 11, 2021 07:26
Dunst config
View dunstrc.cfg
[global]
monitor = 0
follow = mouse
width = 300
height = 300
origin = top-right
offset = 20x50
scale = 0
notification_limit = 0
progress_bar = true
@EgZvor
EgZvor / jumpfile.vim
Created November 8, 2021 18:22
Vim mappings to jump through jumplist by files
View jumpfile.vim
if exists('g:loaded_jumpfile')
finish
endif
let g:loaded_jumpfile = 1
function! JumpFileComputePrevious()
let [jump_list, pos] = getjumplist()
let previous_list = jump_list
\ ->map({idx, val -> [idx, val]})[:pos]
@EgZvor
EgZvor / vims.sh
Last active August 17, 2021 17:45
View vims.sh
#!/bin/bash
if [ "$1" == "--servername" ]; then
servername="$2"
shift 2
else
servername=$(vim --serverlist | rofi -dmenu -i -p "Enter the vim server name" 2>/dev/null)
fi
if [ "${servername}" == "" ]; then
View Keybase proof.markdown

Keybase proof

I hereby claim:

  • I am egzvor on github.
  • I am egzvor (https://keybase.io/egzvor) on keybase.
  • I have a public key ASCQzubYGyRq4R_viV2lVtIe--fiaa3sFAU_gkvmhUK11Qo

To claim this, I am signing this object:

View focus_vim.py
#!/usr/bin/env python3
"""
The script accepts either an argument or stdin line as a Vim server name
and focuses on i3 window contaning that Vim instance.
Read `:help client-server
<http://vimdoc.sourceforge.net/htmldoc/remote.html#client-server>`_.
Requires ``psutil`` ::
@EgZvor
EgZvor / fzy.zsh
Created August 15, 2019 23:56
fzy bindings for zsh mirrored from fzf and simplified
View fzy.zsh
# CTRL-T - Paste the selected file path(s) into the command line
__fsel() {
setopt localoptions pipefail 2> /dev/null
rg --files --hidden --glob '!.git/' | fzy
local ret=$?
echo
return $ret
}
fzy-file-widget() {