Skip to content

Instantly share code, notes, and snippets.

View HarmtH's full-sized avatar

Harm te Hennepe HarmtH

  • University of Twente
View GitHub Profile
@nxtr
nxtr / counsel-yank-pop.el
Created March 11, 2021 10:37
Advice counsel-yank-pop for proper vterm-mode yank-pop using emacs-libvterm, ivy and counsel
(define-advice counsel-yank-pop (:around (fun &rest args))
(if (equal major-mode 'vterm-mode)
(let ((counsel-yank-pop-action-fun (symbol-function
'counsel-yank-pop-action))
(last-command-yank-p (eq last-command 'yank)))
(cl-letf (((symbol-function 'counsel-yank-pop-action)
(lambda (s)
(let ((inhibit-read-only t)
(last-command (if (memq last-command
'(counsel-yank-pop
@tarruda
tarruda / nvim-terminal-edit.py
Last active January 18, 2025 07:36
Edit file in host Neovim instance from a :terminal buffer
#!/usr/bin/env python
"""Edit a file in the host nvim instance."""
import os
import sys
from neovim import attach
args = sys.argv[1:]
if not args:
print "Usage: {} <filename> ...".format(sys.argv[0])