Skip to content

Instantly share code, notes, and snippets.

@dvzubarev
dvzubarev / yank.el
Last active February 8, 2024 17:55
(defun my-copy-region-advice (orig-func beg end &rest r)
(with-silent-modifications
(save-excursion
(goto-char beg)
(put-text-property beg (1+ beg) 'first-line-indent (current-column))))
(unwind-protect
(apply orig-func beg end r)
(with-silent-modifications
(remove-text-properties beg (1+ beg) '(first-line-indent)))))
@dvzubarev
dvzubarev / autoload.el
Last active May 1, 2024 16:33
python-ts-mode extended fontification
;;; lang/my-python/temp-conf/autoload.el -*- lexical-binding: t; -*-
;;;###autoload
(defun my-py-hl-filter-self (node)
(not (equal (treesit-node-text node) "self")))
;;;###autoload
(defun my-python-update-highlights ()
(setq python--treesit-settings
(append python--treesit-settings
@dvzubarev
dvzubarev / autoload.el
Last active January 27, 2023 23:12
targets.el setup
;; this is needed for targets remote objects. Without this advice remote objects
;; do not work in other windows
;; TODO see evil-surround-interactive-setup - they change evil-inhibit-operator there
;; maybe it possible to do the same in targets.el to get rid of this advice
;;;###autoload
(defun my-evil-motion-advice (orig-fun motion &optional count type)
(let* ((regex (rx "targets-"
(or "a" "inner" "inside" "around")
"-remote-"
(one-or-more (any ascii))))
#include <jsoncons/json.hpp>
#include <jsoncons_ext/cbor/cbor.hpp>
#include <fstream>
#include <chrono>
using namespace jsoncons;
int main()
(defun my/realgud-init ()
(interactive)
(when (not (realgud-get-cmdbuf))
(realgud-short-key-mode)))
(defun my/realgud-eval-dwim ()
(interactive)
(when (not (use-region-p))
(mc--mark-symbol-at-point))
(realgud:cmd-eval-dwim)