Skip to content

Commit d0f35b5

Browse files
committed
Easier renaming of camelCase and snake_case words
Accomplished with the one and only tpope's abolish plugin.
1 parent 2db3fd1 commit d0f35b5

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

lua/plugins/abolish-subvert.lua

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
return {
2+
'tpope/vim-abolish',
3+
4+
--[[
5+
-- In Elixir, I wanted to change "activity" to "reading_room", but
6+
-- "Activity" to "ReadingRoom".
7+
--
8+
-- In the before times, I would have to :%s/activity/reading_room/g
9+
-- and then run :%s/Activity/ReadingRoom/g to get all the changes to take.
10+
--
11+
-- In the new world, simply run one command:
12+
-- :%Subvert/activity/reading_room/g
13+
--
14+
-- (or, in the plural case, :%S/activit{y,ies}/reading_room{,s}/g)
15+
--
16+
-- and that's it! That command will turn this:
17+
--
18+
# BEFORE
19+
defmodule ReadsomethingWeb.ActivityHTML do
20+
use ReadsomethingWeb, :html
21+
22+
embed_templates "activity_html/*"
23+
end
24+
25+
# AFTER
26+
defmodule ReadsomethingWeb.ReadingRoomHTML do
27+
use ReadsomethingWeb, :html
28+
29+
embed_templates "reading_room_html/*"
30+
end
31+
--]]
32+
}

0 commit comments

Comments
 (0)