Skip to content

Instantly share code, notes, and snippets.

@ivar
Last active August 1, 2022 00:04
Show Gist options
  • Save ivar/13d528f3bd3bb852e76e1fccb1272d23 to your computer and use it in GitHub Desktop.
Save ivar/13d528f3bd3bb852e76e1fccb1272d23 to your computer and use it in GitHub Desktop.
spacemacs - global search and replace

There's a couple of ways, one way is

  • Get search results
    • Do SPC / and type in your search string
    • or SPC x S and search string - where x is your scope indicator (p for project, d for directory, etc..)
  • Once you have the occurences you want, hit C-c C-e inside the helm buffer to put all your match occurences and puts them into a special buffer called the edit buffer or something like that
  • in that buffer you can use any commands you'd normally use on a buffer
  • the C-c C-c to commit your changes.

Editorconfig support used to be a separate layer, but the benefits of making it a layer were marginal.

In your .spacemacs file:

  1. Add editorconfig to dotspacemacs-additional-packages e.g.
dotspacemacs-additional-packages '(editorconfig)
  1. Add
(use-package editorconfig
  :ensure t
  :config
  (editorconfig-mode 1))

to the dotspacemacs/user-config section of .spacemacs

@ivar
Copy link
Author

ivar commented Dec 3, 2017

Difference between w in vim vs w in emacs

The only real difference is the underscore character. You can basically adjust the syntax table in emacs as every major mode has its own syntax table that decides which characters are part of a word.
if you make _ a word character then it will start getting including by w
that said, for text objects in particular you may consider trying the o text object - it is the "symbol" text object.
this is pretty fantastically useful because it uses the definition of a legal identifier for whatever programming language you're in
so it will include underscores since that's legal in almost every programming language
but in elisp it will also include hyphens, and almost everything, since those are legal names for things

@achikin
Copy link

achikin commented Jun 28, 2018

Brilliant, thank you!

@dwahyudi
Copy link

This is awesome..

@AlekseyZaytcev
Copy link

You are awesome! oO

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment