cragg

@cragg@emacs.ch

I post short howtos and code snippets
#emacs #elisp #cli

This profile is from a federated server and may be incomplete. Browse more on the original instance.

cragg, to emacs

How to use wdired to delete files:

  1. Use find-name-dired to target files for deletion: Follow prompts to populate directory to search and file name pattern.
  2. C-x C-q to make the results buffer writeable (wdired)
  3. For each file you want to delete, press 'd' next to the file
  4. 'x' to execute deletion.
    #emacs #dired #wdired
cragg,

@holgerschurig I tried to delete the filename then do C-c, but that didn't do anything. Any advice?

cragg, to random

My Emacs JSON starter pack:
(use-package json-mode
:ensure t)

;; Fires up a separate buffer where you can navigate JSON (buffer or region)
(use-package json-navigator
:ensure t
:after json-mode)

;; Uses jq to format JSON in buffer
(use-package jq-format
:ensure t
:after json-mode)

;; Uses jsonlint to detect malformed JSON
(use-package flymake-json
:ensure t)

(add-hook 'json-mode-hook 'flymake-json-load)

cragg, to emacs

How to rename multiple files in dired:

  1. Mark files in dired: 'm' for each file at point.
  2. % R
  3. Enter regexp to rename from: (Unknown[-]?[0-9]?)
  4. Rename to: \1.jpg
    #emacs #dired
cragg,

@holgerschurig I'll post the wdired version of this next, but this way took fewer steps.

cragg, to emacs

How to rename a variable name:

  1. Move point on variable to rename
  2. M-s . (isearch-forward-symbol-at-point)
  3. C-M-% (query-replace-regexp)
  4. Enter replacement string

Alternatively, rename variable within region:

  1. Select region
  2. C-M-% (query-replace-regexp)
  3. Enter string to replace
  4. Enter replacement string
    #emacs
  • All
  • Subscribed
  • Moderated
  • Favorites
  • provamag3
  • InstantRegret
  • mdbf
  • ngwrru68w68
  • magazineikmin
  • thenastyranch
  • rosin
  • khanakhh
  • osvaldo12
  • Youngstown
  • slotface
  • Durango
  • kavyap
  • DreamBathrooms
  • JUstTest
  • tacticalgear
  • ethstaker
  • cisconetworking
  • modclub
  • tester
  • GTA5RPClips
  • cubers
  • everett
  • normalnudes
  • megavids
  • Leos
  • anitta
  • lostlight
  • All magazines