This is really impressive, I'm starting to try Racket coding with Emacs + Geiser Mode. And I really need some sort of Guides to rely on once in a while.
The following words also sounds convincing:
"If you are a programmer, you should try to automate thing as much as possible. One way of doing this is using a good editor that automates many menial and tedious tasks. For example, one of the thing that annoys me is using the command cd to change into a deep directory path like this:
Related to that last part... after 10 or so years of using Emacs off and on (mostly when editing files remotely), I went full time with it a couple of months ago. In the beginning I used projectile the way the OP illustrates it works, but then I began streamlining and customizing that workflow even more.
An example of this is that as part of my job I have to maintain a handful of wordpress sites. We keep these sites in one git repo, but they are different sites altogether so the layout would be:
/sites/www/site1
/sites/www/site2
(and so on)
... with each site(N) being distinct Wordpress installations. One of the annoying aspects of maintaining a bunch of Wordpress sites like this is that they all contain the WP framework code (which I never edit) and all of the code that is edited frequently tends to be in each sites respective theme, all of which also tend to have the same filenames. So if you wanted to visit the header template for site1 you would fire up projectile, type in "site1/wp-content/themes/header.php" or some such and you'd probably get a hit. If you just typed in "header.php" you'd end up with a bunch of different hits, including Wordpress framework files, multiplied by the number of sites.
Projectile has a mechanism for ignoring files[1], which is nice for omitting framework code, but I wanted a workflow that was "On keystroke, prompt me for sitename and open a projectile prompt that autocompletes files for that site only". Turns out this is really easy. While Projectile will normally use git to determine its project root, you can actually add a .projectile file to any directory and that directory then becomes a project root. From there it's easy to write an interactive elisp function that will ask you which projectile project to load, then fire up the autocomplete. Bind that to a global key and it becomes really easy to break down your large-ish codebase into logical sub-projects and get to business quickly.
(Haha, I just realized how emacs-y that tip was.)
Lastly, if you find your .emacs configuration becoming unwieldy, or if you are like me and originally broke out mode specific configuration into distinct files (php.el, ruby.el, web.el) I can't recommend enough switching your config to one big org-mode + babel[2] file. Doing so was my first foray into org-mode and literate programming and I can't recommend it enough, if only for keeping your Emacs configuration sanely documented. I used this config as an example for getting started:
You might want to combine Geiser with Quack[1] for best result with Scheme. Also, I think it's worth a shot to have a look at the fairly new Racket-mode[2] written by Greg[3]. Geiser + Quack are rather old and for Scheme in general, Racket-mode focuses on and is tightly integrated with Racket.
tuhdo: just to clarify, I am Vincent Foley-Bourgon and yes, I wrote both "Why I (Still) Use Emacs" articles. I sometimes omit the last part of my last name since it's often butchered by people who don't speak French.
By the way, thanks for putting both of them up there: I forgot about the one I put up on Wordpress :D
Thanks for writing such a good article, so people can have a better glimpse of what Emacs is capable of. It saved my time because I don't have to research all of those and make my article even longer :D
You can also set mark at first 'b' in the first line, go to first 'b' in the last line and use C-x r t to insert a string across all the lines.
You can of course use regex-replace, too: \(a+\|b+\|c+\|d+\) -> \1 <- space here
And so on and on. It's good to see well written "introductory courses", like this one, but what about "Emacs for black belts"? "Advanced Emacsology"? There is one book about writing Emacs extensions (http://shop.oreilly.com/product/9781565922617.do), but that's all there is. Does anyone know about another source of knowledge about the most advanced Emacs techniques?
I've fixed that. I only wanted something simple for new users to try out the new feature (Macro).
This manual is only about stock Emacs features, not adding complexity with 3rd party packages. When I first introduced on Reddit, someone advised me to stick to stock Emacs (which I did) because they see this section using an external package (ggtags) for browsing kernel source code: http://tuhdo.github.io/emacs-tutor.html#sec-8. When people are good with the basics, they understand what they need and find appropriate packages.
If you want advance techniques, the primary resource should be Emacs Lisp Manual, Emacs docstrings, and learn code written by package maintainers.
EDIT: Even before working with Emacs Lisp, using 3rd party packages already makes Emacs much more advanced.
That's a pretty good introduction. I've been using emacs for years, but this post reminds me that I've never gotten around to setting up a satisfactory project management system, so that I can grep and find files across the whole project.
Projectile is neat, but you don't need anything fancy to grep and find across the project. I just have a single binding to switch to an eshell, and running rgrep or find commands automatically pops up a hyperlinked buffer containing results. Having a shell function to cd to the project root helps too.
Nice work. It would be nice if you can find a native English speaker, or at least someone with stronger English skills, to edit (in the literary sense) your prose. You manage to get the point across, but the grammatical errors are distracting.
Thank for your feedback. I will improve it. Please tell me my mistakes , I will fix it quick. Even a little is better than none. For your convenience, feel free to open a new issues at https://github.com/tuhdo/tuhdo.github.io
Wow, this is great but I'm a vim user. I'd really love to have something in this format for vim. Maybe something like that already exists but I just don't know about it yet?
I would like to write something like this for Vim, but I don't know how to easily create animated screencaps like those displayed here. Does anyone know a good tool for that?
I learned how to record the window layout with register, but I also want it to be recorded for next time. but I would like to record this for next time I use emacs. How to do this?
With workgroups2, windows configurations can be stored in a workgroup, and you can create as many workgroups and named it; later, you can switch back. Because you can name your window configurations, you don't have the burden to remember which to which in registers. You can also save your window configurations to continue using them in later Emacs sessions.
You can issue a command to save current session with workgroup2.
- Setup a shortcut on your desktop to c:\Local\Emacs\bin\emacsclientw.exe
- Double click the new shortcut."
Or just use the 32 bit version from official GNU Emacs homepage.
Could you tell me what the problems are? I use Emacs on Windows fine, with all my 3rd-party packages. At least with stock Emacs, it should work on Windows.
[+] [-] pimgeek|11 years ago|reply
The following words also sounds convincing:
"If you are a programmer, you should try to automate thing as much as possible. One way of doing this is using a good editor that automates many menial and tedious tasks. For example, one of the thing that annoys me is using the command cd to change into a deep directory path like this:
[/path/to/a/very/long/long/long/long/long/long/..../directory/ ]"
[+] [-] look_lookatme|11 years ago|reply
An example of this is that as part of my job I have to maintain a handful of wordpress sites. We keep these sites in one git repo, but they are different sites altogether so the layout would be:
/sites/www/site1 /sites/www/site2 (and so on)
... with each site(N) being distinct Wordpress installations. One of the annoying aspects of maintaining a bunch of Wordpress sites like this is that they all contain the WP framework code (which I never edit) and all of the code that is edited frequently tends to be in each sites respective theme, all of which also tend to have the same filenames. So if you wanted to visit the header template for site1 you would fire up projectile, type in "site1/wp-content/themes/header.php" or some such and you'd probably get a hit. If you just typed in "header.php" you'd end up with a bunch of different hits, including Wordpress framework files, multiplied by the number of sites.
Projectile has a mechanism for ignoring files[1], which is nice for omitting framework code, but I wanted a workflow that was "On keystroke, prompt me for sitename and open a projectile prompt that autocompletes files for that site only". Turns out this is really easy. While Projectile will normally use git to determine its project root, you can actually add a .projectile file to any directory and that directory then becomes a project root. From there it's easy to write an interactive elisp function that will ask you which projectile project to load, then fire up the autocomplete. Bind that to a global key and it becomes really easy to break down your large-ish codebase into logical sub-projects and get to business quickly.
(Haha, I just realized how emacs-y that tip was.)
Lastly, if you find your .emacs configuration becoming unwieldy, or if you are like me and originally broke out mode specific configuration into distinct files (php.el, ruby.el, web.el) I can't recommend enough switching your config to one big org-mode + babel[2] file. Doing so was my first foray into org-mode and literate programming and I can't recommend it enough, if only for keeping your Emacs configuration sanely documented. I used this config as an example for getting started:
https://github.com/larstvei/dot-emacs/blob/master/init.org
[1] https://github.com/bbatsov/projectile#ignoring-files [2] http://orgmode.org/worg/org-contrib/babel/intro.html
[+] [-] cmpitg|11 years ago|reply
[1] http://www.neilvandyke.org/quack/ [2] https://github.com/greghendershott/racket-mode [3] http://www.greghendershott.com/
[+] [-] davexunit|11 years ago|reply
[+] [-] tuhdo|11 years ago|reply
[+] [-] gnuvince|11 years ago|reply
By the way, thanks for putting both of them up there: I forgot about the one I put up on Wordpress :D
[+] [-] tuhdo|11 years ago|reply
Thanks for writing such a good article, so people can have a better glimpse of what Emacs is capable of. It saved my time because I don't have to research all of those and make my article even longer :D
[+] [-] klibertp|11 years ago|reply
You can also set mark at first 'b' in the first line, go to first 'b' in the last line and use C-x r t to insert a string across all the lines.
You can of course use regex-replace, too: \(a+\|b+\|c+\|d+\) -> \1 <- space here
And so on and on. It's good to see well written "introductory courses", like this one, but what about "Emacs for black belts"? "Advanced Emacsology"? There is one book about writing Emacs extensions (http://shop.oreilly.com/product/9781565922617.do), but that's all there is. Does anyone know about another source of knowledge about the most advanced Emacs techniques?
[+] [-] tuhdo|11 years ago|reply
This manual is only about stock Emacs features, not adding complexity with 3rd party packages. When I first introduced on Reddit, someone advised me to stick to stock Emacs (which I did) because they see this section using an external package (ggtags) for browsing kernel source code: http://tuhdo.github.io/emacs-tutor.html#sec-8. When people are good with the basics, they understand what they need and find appropriate packages.
If you want advance techniques, the primary resource should be Emacs Lisp Manual, Emacs docstrings, and learn code written by package maintainers.
EDIT: Even before working with Emacs Lisp, using 3rd party packages already makes Emacs much more advanced.
[+] [-] baddox|11 years ago|reply
[+] [-] tuhdo|11 years ago|reply
And use Helm with it like this: http://tuhdo.github.io/helm-intro.html#sec-28
[+] [-] technomancy|11 years ago|reply
[+] [-] MarcScott|11 years ago|reply
All written in org-mode as well.
Thank you
[+] [-] jzzskijj|11 years ago|reply
[+] [-] rafaelbeirigo|11 years ago|reply
Great material!
[+] [-] neonscribe|11 years ago|reply
[+] [-] tuhdo|11 years ago|reply
[+] [-] wyclif|11 years ago|reply
[+] [-] vadskye|11 years ago|reply
[+] [-] emlearn5|11 years ago|reply
[+] [-] tuhdo|11 years ago|reply
With workgroups2, windows configurations can be stored in a workgroup, and you can create as many workgroups and named it; later, you can switch back. Because you can name your window configurations, you don't have the burden to remember which to which in registers. You can also save your window configurations to continue using them in later Emacs sessions.
You can issue a command to save current session with workgroup2.
[+] [-] mattattaque|11 years ago|reply
[+] [-] yoanizer|11 years ago|reply
[+] [-] Yuioup|11 years ago|reply
[+] [-] tuhdo|11 years ago|reply
"There is no installer. All you have to do is:
- Unpack in a location like c:\Local\
- Setup a shortcut on your desktop to c:\Local\Emacs\bin\emacsclientw.exe
- Double click the new shortcut."
Or just use the 32 bit version from official GNU Emacs homepage.
Could you tell me what the problems are? I use Emacs on Windows fine, with all my 3rd-party packages. At least with stock Emacs, it should work on Windows.
[+] [-] TeMPOraL|11 years ago|reply
[+] [-] nodivbyzero|11 years ago|reply