![]() ![]() `current-word' can of course be replaced by other functions. this function determines the scope of `iedit-start'. "Starts iedit but uses \\ to limit its scope." The iedit author suggest that you bind iedit-mode – the default command for entering iedit – to C- and I agree: it’s rarely used and easy to type. If you pass an argument to the function, it will iedit all occurrences in the entire buffer. Note: Don’t forget that although defun is Lisp-speak, most modes support all the defun-like commands such as mark-defun or narrow-to-defun. When invoked, it activates iedit for the current defun only. Sacrificing function for form is not something that I usually do especially in regard to text editing. I prefer a workflow that minimizes the use of commands to do routine tasks – a fairly common goal for most Emacs hackers. February 13th, 2020 Why the Switch I love the way that Spacemacs looks and its easily extensible config supports most everything that I need, but it has always felt slow to me. spacemacs-base contains only a minimal set of packages whereas spacemacs is the full Spacemacs experience. You can now choose between two distributions spacemacs or spacemacs-base. So iedit’s pretty great and all that, but I don’t replace words across a whole buffer very often sure, I hear you say: “just narrow-to-defun with C-x n d!” Indeed, narrowing’s great, but this blog is all about half-baked, half-inventions and cobbled-together scripts, and this post is no exception! 1.11 What is the difference between spacemacs-base and spacemacs distributions The distribution concept was introduced in 0.104.x. Here’s a sample demonstration showing what exactly it is I’m talking about, in brilliant technicolor: Sure, go ahead use the older way if you have complex, partial replacements you want to do, but if you’re renaming a variable in a buffer… Why not use iedit? If you regularly replace variables or words with M-% or C-M-% - well, you can retire that workflow now, as iedit will handle it for you. How cool is that? Modern IDEs have it already – usually hidden away in the “Refactoring” section – and does exactly the same thing, but iedit is a lot dumber as it cannot infer context beyond I want to iedit all occurrences ofword* point is on.* When you alter a highlighted word, the other highlighted words change also. You plonk your point down on a word you want to change you run iedit-mode and now all the occurrences of that word is highlighted on your screen. The twist here is it uses in-buffer editing without disrupting your workflow with prompts, windows or any of that stuff. Well, quite simply, you can edit multiple, identical string occurrences at the same time. Tried Spacemacs and loved it at first, but there were quite a few niggles that annoyed me - many standard Emacs ways to config things and packages clashed with the layers system (admittedly the Spacemacs guys say that you should write a layer to add features, but that seemed over the top) - window management in mu4e was a disaster. Have you ever heard of iedit for Emacs by Victor Ren? Me neither, until recently, and that’s a terrible shame as it is a cornerstone of my programming workflow now that I’ve learned about it. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |