Skip to content

Instantly share code, notes, and snippets.

View sweeneydavidj's full-sized avatar
🏠
Working from home

David Sweeney sweeneydavidj

🏠
Working from home
View GitHub Profile
@sweeneydavidj
sweeneydavidj / phoenix-intro.md
Last active May 28, 2021 13:55
Phoenix Intro
@sweeneydavidj
sweeneydavidj / regex-phoenix-routes
Created May 6, 2020 16:11
Regex for Phoenix routes
%s/\([_a-z]*_path\)/Routes.\1/g
@sweeneydavidj
sweeneydavidj / spacemacs-helm-ag-find-in-named-files
Created July 23, 2019 12:29
Spacemacs helm ag find in named files
SPC /
link -Gshow.html.eex #find link in all files named show.html.eex
SPC /
link -GQ*.html.eex #find link in all files name *.html.eex, Q is for literal string
@sweeneydavidj
sweeneydavidj / spacemacs-helm-find-select
Last active January 27, 2021 12:10
Spacemacs helm find select
SPC /
foo
S-M-SPC (to enter helm transient state) - that's Shift-Meta-Space all at once
T - to mark all
t - to mark individual
then usually C-c C-e to edit selection.
@sweeneydavidj
sweeneydavidj / spacemacs-project-rename-file
Created November 15, 2018 15:27
Spacemacs project rename file
SPC f j - jump to Dired from a file
navigate to project root in Dired
SPC SPC (M-x) find-name-dired
return to confirm directory
type file name using wildcards *foo*
return - a dired buffer will be shown with all matched files
SPC b w to enter read-only mode
ESC
Edit file names (can use %s/foo/bar/g etc)
C-c C-c to save
@sweeneydavidj
sweeneydavidj / spacemacs-project-search-replace
Created October 24, 2018 08:08
Spacemacs project search replace
SPC s f (helm-files-smart-do-search) - this will bring up HELM File Completions
navigate to the directory from which to do the search - use C-h to go up one level if needs be
type the search string
hit C-c C-e (helm-ag-edit)
Once in helm-ag-edit edit as in a normal buffer
For example :%s/foo/bar/g
hit C-c C-c to save
For case-sensitive/insensitive toggle by
@sweeneydavidj
sweeneydavidj / spacemacs-dired-rename-file
Last active October 24, 2018 08:09
Spacemacs dired rename file
SPC f j (Go to dired - usually from the buffer)
SPC b w (Enter buffer read-only mode)
ESC
Edit the file name
C-c C-c (to save)