Code Substitution Done Right - Switch.vim
vimninjas.com
Code Substitution Done Right - Switch.vim
1–10 of 14 posts
Re: Code Substitution Done Right - Switch.vim
#2So I'll pass on this plugin for the time being. That said, this new blog is fantastic and I'm bookmarking all the articles for later.
Re: Code Substitution Done Right - Switch.vim
#3Though looking back a year ago, I struggled to navigate, let alone copy and paste. Step at a time, right? RIGHT?!
Re: Code Substitution Done Right - Switch.vim
#4Annnnnd another tutorial that shows me how vastly underwhelming my vim skills are. Though looking back a year ago, I struggled to navigate, let alone copy and paste. Step at a time, right? RIGHT?!
I'll get there though. Eventually.
Re: Code Substitution Done Right - Switch.vim
#5Re: Code Substitution Done Right - Switch.vim
#6Re: Code Substitution Done Right - Switch.vim
#7I don't get it. How often do you need to change between complete opposites? (should/should_not, true/false, &&/||) And what's the point of changing "predicate?" to "true and (predicate?)" or "false or (predicate?)"
https://github.com/zef/vim-cycle
I really use it all the time and find it extremely useful, but not exactly in the way he seems to in the video. One of the ways I frequently use it is for CSS, where there are related words that can frequently change, like margin/padding, top/bottom, class/id, png/gif/jpg, absolute/relative, or in Ruby if/unless, present/blank, else/else if. Things like that...
The mapping I use is the same as is used to increment and decrement numbers in Vim, which is very natural to me so it's a really easy way to switch things much more quickly than typing them.
You can see the pairs I define by default in my plugin here:
https://github.com/zef/vim-cycle/blob/master/plugin/cycle.vi...
Re: Code Substitution Done Right - Switch.vim
#8Annnnnd another tutorial that shows me how vastly underwhelming my vim skills are. Though looking back a year ago, I struggled to navigate, let alone copy and paste. Step at a time, right? RIGHT?!
I recently moved to vim as well. Everything I'm doing I'm pretty much aware that I could probably be doing it in some superdooper quick way... I'll get there though. Eventually.
Re: Code Substitution Done Right - Switch.vim
#9I don't get it. How often do you need to change between complete opposites? (should/should_not, true/false, &&/||) And what's the point of changing "predicate?" to "true and (predicate?)" or "false or (predicate?)"
Re: Code Substitution Done Right - Switch.vim
#10I don't get it. How often do you need to change between complete opposites? (should/should_not, true/false, &&/||) And what's the point of changing "predicate?" to "true and (predicate?)" or "false or (predicate?)"
* toggling booleans in a config file.
* switching a string literal between 'single quotes', "double quotes #{so I can add interpolation}", and :symbols. I do this pretty often. The former is easy enough with surround.vim (cs'"), but the latter is a pain (ds'bi:)
* the ability to add a "tap" and remove it with a single key combo is interesting for debugging.