Here’s another quick one. It could be when formatting pieces of code that you want to remove any space from the beginning of the line. Removing de-facto any indentation. M-x query-replace-regexp RET ^[[:space:]]+ RET RET Confirm then one by one with ‘y‘ or replace all of the buffer with ‘!‘. Advertisements
Most of the time I use emacs with auto-fill mode breaking any line at 70. Sometimes though I’d like a paragraph to be reverted to a single line; for example for copy-pasting into other editors where it could breaks the formatting. Here’s how M-x set-variable RET fill-column RET 100000 M-q (on the desired paragraphs) M-x […]
Here is a quick way to strip (remove) blank lines from a file with emacs. position on top of file: M-< Call a query-regex-replace: M-C-% input the regex ^ C-q C-j that stand for match all lines that consist in only a carriage return. RET-RET. The first one confirm the regex and the last one […]
Sometimes ago I cited a cool mode for emacs: log4j-mode. Since I started useing it just for “syntax hilight”, I’ve discovered a very cool macro: log4j-start-filter. I had the needs to filter an application log file (30Mb growing) in which many applications is logging. I’ve not decided this, so don’t hang up with me :). […]
Once you have recorded a macro, you can save it for later usage on a file (or within your .emacs). The steps to follow in order to get this work, is (1) give a name to the macro, (2) insert it into a buffer. M-x name-last-kbd-macro RET my-cool-macro-name then (what I usually do), open a […]
Another quick post. Having syntax hilight for python in emacs is very simple as usual. Just install the python-mode by copying the relative .el file into your site lisp and edit your .emacs file for loading the required mode.
I’ve updated my .emacs file adding the support for log4j-mode and disabling the font-lock-maximum-size variable.
I’m a bit abstracted and usually works with a lot of opened files. So it happens sometimes that in the rush of job i ended editing a file instead of another. I’m also usual to open existing files I wrote in order to get some hints. And I could edit them for error. To avoid […]
I will never stop saying how much I love emacs. I have to admit that it’s very difficult to learn how to use it and even after you have learned enough to use it, you will always find something that you didn’t know. The task for today is simple: sorting the lines in a region. […]
It happens that sometimes you need to digit more than one character sequentially. This is not a problem if you have to digit it only 3-4 times, but what about 15 or 100s times? Emacs again come into your help. Let’s say you have to digit character 0 for 15 times C-u 15 C-u 0 […]