HNHacker News
TopNewBestAskShowJobs

tuhdo

785 karma · joined June 13, 2014

submissionscomments
tuhdo··on Spacemacs – Emacs advanced kit focused on Evil
Unite, fireplace, rainbow parens, vim-sexp and vim-surround are all available in Emacs with its own and better implementation.

If you want Unite equivalent, check Helm which is created before Unite and is still actively maintained. See one of Helm package demo: http://tuhdo.github.io/helm-projectile.html. The same for rainbow-parentheses. Actually, Emacs got something better than rainbow-parentheses for visual aiding parentheses: https://github.com/syl20bnr/spacemacs/issues/1173

For proper sexp manipulation, check this guide with great animations: http://danmidwood.com/content/2014/11/21/animated-paredit.ht...

For Clojure, in Emacs you got a debugger than can step expression by expression: http://endlessparentheses.com/cider-debug-a-visual-interacti...

If you want to know features for Clojure that already configured in Spacemacs, check its Clojure documentation: https://github.com/syl20bnr/spacemacs/tree/master/contrib/la...

You got all IDE features like refactoring and jump to symbols

More demos:

Here are some nice features that Emacs and its 3rd packages provide:

- Powerful automatic indentation with aggressive-indent: https://github.com/Malabarba/aggressive-indent-mode(scroll down for demos). It does not only indent the current line, but the whole semantic context around your cursor.

- Live grep:http://tuhdo.github.io/static/live_grep.gif

- C/C++ refactoring with built-in parser: https://github.com/tuhdo/semantic-refactor/blob/master/srefa...

- Lisp Code reformatting: https://github.com/tuhdo/semantic-refactor/blob/master/srefa...). As far as I know, there's none Lisp code reformatting outside of Emacs.

- Access to a list of project with a few key strokes: http://tuhdo.github.io/static/helm-projectile/helm-projectil...

- Quickly access any file in your project, as large as Linux kernel, instantly, regardless of where you are in the project, and within a few keystrokes: http://tuhdo.github.io/static/helm-projectile/helm-projectil...)

- Jump to any file depends on context, even if the file path is in a plain ASCII text file: http://tuhdo.github.io/static/helm-projectile/helm-projectil...

- Copy files from anywhere to anywhere: http://tuhdo.github.io/static/helm-projectile/helm-projectil...)

- Delete files anywhere; files are always at your finger tip to do whatever with them: http://tuhdo.github.io/static/helm-projectile/helm-projectil...

- Switch between other files with same names but different extensions: http://tuhdo.github.io/static/helm-projectile/helm-projectil...). Work not only for C/C++ but other languages, and is customizable. You don't have to configure anything, like adding include paths for the command to search. Everything is automatic. Just use it as it is.

- Jump to tag definition, from its own parser or external parser like GNu Global: http://tuhdo.github.io/static/c-ide/helm-gtags-jump-dwim.gif

- Jump up to parent: http://tuhdo.github.io/static/c-ide/senator-go-to-up-referen...

- Do you like outline tree?: http://tuhdo.github.io/static/c-ide/sr-speedbar.gif

- Interactive outline tree: http://tuhdo.github.io/static/c-ide/helm-semantic-or-imenu-w...

- Easily move back and forth using the interactive outline tree: http://tuhdo.github.io/static/part3/helm-semantic-or-imenu-2...

- References retrieved from its Emacs internal parser: http://tuhdo.github.io/static/c-ide/semantic-symref.gif

- Beautiful compile output: http://tuhdo.github.io/static/c-ide/compilation-compile.gif

- Frontend support for GDB: http://tuhdo.github.io/static/c-ide/gdb-many-windows.gif

- Code completion: http://tuhdo.github.io/static/c-ide/semantic-boost-demo.gif

- Open man page for symbol at cursor: http://tuhdo.github.io/static/part3/helm-man-woman.gif

- Emacs open 39MB C file: http://tuhdo.github.io/static/performance.gif

- Emac opens multi-gigabtye file: http://www.emacswiki.org/emacs/VLF

Note that in the demos you may see me type in the commands. You can think of it like the start menu in Windows, but actually those commands can be executed quickly with a shortcut. I type in the commands for demonstration purpose to Emacs users.

Those demos are just tip of the iceberg.

tuhdo··on Emacs Is My New Window Manager
Then, you can just think of it as a prototype that just working with text.
tuhdo··on Emacs as the Ultimate LaTeX Editor
I agree Srecode needs to improve its documentation. It took me a while to learn to use it by reading the actual templates written that come with CEDET. I may write a tutorial for it at some point. But not now.

You can have a look at a sample template: https://github.com/emacsmirror/cedet/blob/f72ebbc52785013280... . Srt file has syntax highlighting in Emacs.

tuhdo··on Emacs as the Ultimate LaTeX Editor
It's quite more popular than you think. `M-x term` is an example. It's a full-blown terminal emulator in Emacs that runs entirely in another process. Here is another example of async grep/ack/ag: http://tuhdo.github.io/helm-projectile.html#sec-9 . As you can see, Emacs gets line by line results from grep/ack/ag without blocking and gives you new results and you type.

Or Emacs's fantastic support for communicating with REPLs in many interpreted languages.

You can execute any shell command asynchronously while doing other things inside Emacs. You can even compile with beautiful output, in terminal: http://tuhdo.github.io/static/c-ide/compilation-compile.gif

Or built-in GDB integration, also asynchronous: http://tuhdo.github.io/static/c-ide/gdb-many-windows.gif.

Another GDB screenshot: https://flic.kr/p/6FW7Q7.

And Emacs officially supports asynchronous IO, while in Vim it's a hack from Vim Script.

tuhdo··on Emacs as the Ultimate LaTeX Editor
What's wrong with Company: http://company-mode.github.io/? It can give me a large amount of completion candidates without any issue. It's also smooth. Maybe you are using auto-complete?
tuhdo··on Emacs as the Ultimate LaTeX Editor
> Just a simple example is that in xptemplate (and probably any respectable snippet plugin in vim) you can type a part of a snippet name, hit TAB, and it will expand the snippet whose partial name you typed (assuming there's no exact match). In yasnippet, you have to type out the full snippet name before it can be expanded. This is pretty annoying, especially for long snippet names.

Yes, you can do that as well. See the list of expansion methods with screenshots inside: https://capitaomorte.github.io/yasnippet/snippet-expansion.h.... You may interest in minibuffer prompting.

You already have a built-in template system in Emacs called Srecode that allows you to program your templates: http://cedet.sourceforge.net/srecode.shtml

According to the homepage, "the core template text is based loosely on Google ctemplate".

tuhdo··on “Mastering Emacs” ebook announced
You can have decent smart completion in C++ like this: http://tuhdo.github.io/static/c-ide/semantic-boost-demo.gif

Semantic is the equivalent to Intellisense in Visual Studio, though it's less smart on C++ code since C++ moves fast wiht its standard.

> Probably easier to get away without this stuff in C code, though personally I'd probably still get annoyed by the lack of intelligence in completing names of struct members.

Semantic or company-clang can give you code completion of struct members, and even nested struct.

tuhdo··on “Mastering Emacs” ebook announced
At least for C, with GNU Global I can jump around Linux Kernel effortlessly, while I put it into VS and VS just hanged.

For C++, well hopefully we have some new language to replace it in the future. But at least for jumping to symbol definitions/references, it shouldn't be a problem with GNU Global. For code completion, you can still use `company-gtags` to get completion symbols in your project. It's really simple. I know it's not really intelligent (i.e. only show completion candidates in current namespace), but instead throw you everything, but it's practical enough.

tuhdo··on Stack Exchange for Emacs
Fair enough :)

I just wanted to clarify in case someone read your comments and have a wrong impression that Emacs is a text editor like Vim. Nothing more, nothing less.

tuhdo··on Stack Exchange for Emacs
i think skewer-mode is close enough: https://github.com/skeeto/skewer-mode for live editing.

I don't think that inlining feature really help much. Generally, if you want to access a css element in Emacs, you jump in, edit and jump back in an instant to see your result.

See also web-mode: http://web-mode.org

tuhdo··on Stack Exchange for Emacs
> But it was written as just a text editor

No it's not. It is really a big REPL optimized for text processing. You compare Emacs to the like of Python, not just some random editor. Unlike other editors that have an optional extension language, if you remove Emacs Lisp, effective you remove Emacs. Even file opening is written in Emacs Lisp.

tuhdo··on Stack Exchange for Emacs
You can view the demo here: https://tuhdo.github.io/static/emacs-read-pdf.gif
tuhdo··on Stack Exchange for Emacs
If you want image display, there Emacs has it eons ago, and people write plug-ins for it, like this one: https://github.com/josteink/wsd-mode

Emacs is also a fine PDF reader. I can search text in the PDF file with highlighting and a table of content side by side. All can be controlled with the keyboard: https://tuhdo.github.io/static/emacs-read-pdf.gif. I never use Evince again.

tuhdo··on Stack Exchange for Emacs
> Yes (ctrl+alt+up).

Does it work in the source as large as the linux kernel that shows you every possible files? i.e I have a file named `fpu.c`, I want all `fpu.h` in Linux. And Emacs does not work with only C/C++, but work for any languages that users define two lists of pairs of file extensions to switch to. i.e. you can switch between Gemfile <-> Gemfile.lock, .h <-> .js...

> I'm not sure I understand. I mentioned fuzzy completion before, the way it works is that it matches even subparts of the paths and/or filename, with the only requisite of preserving left to right. For instance if I type "bmx25" I can find boot-related imx25 files, because it will match the "b" from the boot path, and then "mx25" from the filename (even a few directories down the path).

No. I mean that in an ASCII text file, with only the filename (no path information), you press a key binding, it automatically jumps to that fine. For example, I have a file "Document/test.txt". In "src/feature1/test.c", it only mentions "test.txt". I want that when cursor is on "test.txt", and if that file is the only file in my project, I jump to it instantly; otherwise, it gives me a list of potential candidates. And this must work in any file, even plain ASCII text file.

If the text at point is a directory path, I expect with a single key stroke, my editor returns all files that contain that path.

> So it depends whether you want to compare the richness of the ecosystem or the core capabilities of the editor.

Both. After all, Emacs is a Lisp interpreter at its core. It's a computing environment more than a text editor; text editing is just a subset of it. That's why it is so easy to write tools for Emacs, despite a much lesser user base than other editors. Emacs has many hidden things that I can never find in other editors. For example, it has an advanced calculator and mathematical tool roughly based on the HP-28/48 : http://www.gnu.org/software/emacs/manual/html_mono/calc.html

> I honestly don't know; it doesn't that by default, though there might be some plugin to that effect; when I use compiled languages, I prefer a linter-like approach to showing compilation errors, so I don't use this kind of plugins in my own environment

Emacs supports coloring compile output by default, built-in. Emacs also has a syntax check plugin for wide array of languages, called flycheck: https://github.com/flycheck/flycheck (see the homepage for a simple demo).

And here is GDB inside Emacs: tuhdo.github.io/static/c-ide/gdb-many-windows.gif

Every change you make to a value, all other panes update as well, when relevant. You can also have an integrated memory debugger inside Emacs. You can even do remote debugging with Emacs.

> yes, this is supported, though I personally switched to Dash (http://kapeli.com/dash) recently, which is similar but much more powerful than just man, as it allows to cache and index documentation from dozens of programming environment and frameworks, taking care of the different formats, etc. So for instance with the same shortcut I can get the help for a POSIX function from its man page, or a Boost class method from their official documentation, and everything is blazingly fast because of local cache and index, so my computer doesn't need to go to boost.org to show that page.

Emacs has support for Dash as well, and you can view it inside Emacs: https://github.com/areina/helm-dash

> You can do that in Sublime, but you need to define a project (which, in its most basic form, is just a "save project" command after having opened a directory); at that point, you have a shortcut to switch between projects with fuzzy completion, and each project keeps the full workspace, ALSO including unsaved modifications to files (which sounds crazy but I love it) as it means that you can do it without even thinking once.

Emacs can do that as well. You can switch between projects, and Emacs remembers window layout of each project you are working on with Projectile: https://github.com/bbatsov/projectile. You can see more Projectile demos in my guide (demos at top): http://tuhdo.github.io/helm-projectile.html

What I said is very different. You think each Emacs window is like a perspective in Eclipse. Each window layout can have different purposes: it can be a layout of 4 smaller code buffers, or it can be a debug view, or it can hold many documentation panes... You can arrange arbitrary window layouts, save and restore in future sessions. You can group many window layouts (or "perspectives") inside a workspace, and you can also have many workspaces like that. Each workspace can be a project, each has many different layouts for different purposes.

> Generally speaking, I don't think there's a world of difference. I find vim harder to replicate in its more advanced features, with its approach to command combinations which is totally different from anything else; but emacs introduced to the world the concept an extendible editor based on complicated, targeted commands (which is the one in widespread usage today), so I think that any sufficiently advanced editor can get very close to emacs in most features.

Vim is now a proper subset of Emacs. Evil is the best Vim emulator out there, said Vimmers who switched to Emacs. See Spacemacs: https://github.com/syl20bnr/spacemacs

> If look at Atom for instance, they introduced a concept where the editor window is not simply line-based, but they can open graphical windows within it, which is a paradigm shift which might introduce unique features, very hard to replicate. See for instance their nested CSS editing feature, which is very nice because it helps my brain limit the context switching a lot.

Yet Atom cannot work in terminal, which is essential for working remotely. Emacs can live to this day because it has 30 years of accumulating vast amount of different uses cases. Someday someone will add such capacities to Emacs, when it is really needed. For now, graphic is cute but it mostly satisfies web development. If I have 10 or 20 local VMs (with only terminal), it would be crazy without Emacs to manage all of them effortlessly.

tuhdo··on Stack Exchange for Emacs
Docview is great, but not enough. He mentioned pdf-tools: https://github.com/politza/pdf-tools, that enhances doc-view with outline for table of contents and annotations.
tuhdo··on Stack Exchange for Emacs
Emacs also has that preview feature when you move the highlighter to a selection. However, I feel it annoying because screen keeps changing while I narrow to a file or a set of files, and luckily it is off by default.

How about other thing? Like switch between source and header files without configuring anything? Or Jump to any file I see instantly, even without full filepath and you only have just a name and without typing the filename? http://tuhdo.github.io/static/helm-projectile/helm-projectil...

Can it do powerful automatic indentation: https://github.com/Bruce-Connor/aggressive-indent-mode. It does not only indent the current line, but the whole Semantic context around your cursor. Demos inside the homepage.

Beautiful compile output: http://tuhdo.github.io/static/c-ide/compilation-compile.gif

Open man page for symbol at cursor: http://tuhdo.github.io/static/part3/helm-man-woman.gif

Emacs can save any arbitrary window layout and restore it later. You can even have workspace in Emacs, each can store a set of window layouts (i.e. one for debugging, one for reading doc, one for just source code...), can be saved as a bookmark and later restore in future session. In Emacs, you can bookmark everything, even a git commit.

tuhdo··on Stack Exchange for Emacs
Can Sublime Text/Atom do all of this here: https://news.ycombinator.com/item?id=8639804 ?

I want to jump to any file at any time regardless of where I am in the project instantly, can Sublime do it? And even if a project has 30-40k files, it must be fast and make me jump instantly. See the demos in this guide for details: http://tuhdo.github.io/helm-projectile.html

Atom has a limit of 2MB text file which is worse than Vim in the 90s.

tuhdo··on Stack Exchange for Emacs
Emacs certainly is not just a text editor. Emacs is just a big REPL, a REPL with a powerful text editor instead of minimal command line interface. Right on the homepage: http://www.gnu.org/software/emacs/, it is written that:

"GNU Emacs is an extensible, customizable text editor—and more. At its core is an interpreter for Emacs Lisp, a dialect of the Lisp programming language with extensions to support text editing."

Text editing is a subset of Emacs and Emacs Lisp, not the other way around.

tuhdo··on The Case for Slow Programming
Think it the other way around: if someone can come up with a solution 5x fater than you and also type 3x faster than you, then how long you are going to catch up with him.
tuhdo··on The Case for Slow Programming
There's no correlation but at least it makes you more productive. Like using an IDE or good editor does not make you a good programmer, but it could improve your productivity in the right situations. For example, I don't want to waste a lot of time hunt-and-pecking emails or IM. Touch typing helps.
tuhdo··on CotEditor – Text Editor for OS X
You never need to remember keyboard shortcuts for major modes. When you forget, you can always bring a "cheatsheet" using "C-h m" which lists all key bindings of current major modes and minor modes. Every time I'm new to a major mode, I always use this table. If you forget any key binding but remember prefix key, I press <prefix key> + C-h to bring all the key bindings that start with that <prefix key>. If you ever forget key binding but remember the command, use helm-M-x that list key bindings along side with the commands. DEMO: http://tuhdo.github.io/static/part3/helm-m-x.gif . In Emacs, I NEVER remember things consciously; I keep using something until it is recalled effortlessly. On the other hand, it's not like you don't have to remember things with those fancy GUIs. Take Eclipse as an example. You would have to steps through meaningless GUIs to configure something to work, and you have to remember those steps mechanically the next time you setup something. I would rather learn a consistent programming language with actual easy to remember rules to first configure simple things, and later extend my editor, rather than stepping through those meaningless GUIs.

And what you said that most of the stuff that are easily achievable with a mouse, try to do equivalent things like this in SECONDS: http://emacsrocks.com/. Well, that's why my co-workers work so hard why I have time to enjoy other things during my daily work.

What you said, like many other people who didn't learn Emacs properly or left it for so long that don't know what Emacs is currently capable of, is seriously outdated.

You should have a look at my post in this thread: https://news.ycombinator.com/item?id=8639804 to see what Emacs is capable of that I could never find in any other editors, and even IDEs.

tuhdo··on CotEditor – Text Editor for OS X
You should see my other answer to see what Emacs is capable of: https://news.ycombinator.com/item?id=8639804

Definitely not less than Sublime.

tuhdo··on CotEditor – Text Editor for OS X
Emacs can make Vim a subset of it. You should check spacemacs: https://github.com/syl20bnr/spacemacs. It was made by Vimmers and is ambitious: it wants to replace not only the "editor" inside Emacs, but also rebind everything else to Vim's convention. Evil-mode can do everything in Practical Vim, I was told by a Vim user switched to Emacs.
tuhdo··on CotEditor – Text Editor for OS X
I think what you described is code folding. Emacs/Vim has that too. And more to that. Look for the demos in my other answer in this thread.
tuhdo··on CotEditor – Text Editor for OS X
I collected them from my guides: http://tuhdo.github.io/, so it's quick if you don't account the time to write the guides.
tuhdo··on CotEditor – Text Editor for OS X
You can be quickly productive with my mini manual: http://tuhdo.github.io/emacs-tutor.html. If you write C++, did you check my C/C++ guide: http://tuhdo.github.io/c-ide.html. A few demos:

- code navigation: jump to anywhere instantly. DEMO: http://tuhdo.github.io/static/c-ide/helm-gtags-jump-dwim.gif.

- code completion: context-sensitve completion. DEMO: http://tuhdo.github.io/static/c-ide/semantic-boost-demo.gif.

- code compilation: you can click on the error and it gets you to where you want; work with any build system, while other IDE only supports a specific build system, i.e. for Makefile project, you only get plain text error message. DEMO: http://tuhdo.github.io/static/c-ide/compilation-mode.gif.

- code debugging: provides a frontend for GDB; DEMO: http://tuhdo.github.io/static/c-ide/gdb-many-windows.gif.

- Powerful automatic indentation: https://github.com/Bruce-Connor/aggressive-indent-mode. It does not only indent the current line, but the whole Semantic context around your cursor. Demos inside the homepage.

- Live grep: http://tuhdo.github.io/static/live_grep.gif.

- Access to a list of project with a few key strokes: http://tuhdo.github.io/static/helm-projectile/helm-projectil...

- Quickly access any file in your project, as large as Linux kernel, instantly, regardless of where you are in the project, and within a few keystrokes: http://tuhdo.github.io/static/helm-projectile/helm-projectil...

- Jump to any file depends on context, even if the file path is in a plain ASCII text file; even if there's only a filename without any path information, as long as it's in your project, Emacs can jump to it fine: http://tuhdo.github.io/static/helm-projectile/helm-projectil...

- Copy files from anywhere to anywhere: http://tuhdo.github.io/static/helm-projectile/helm-projectil...

- Delete files anywhere; files are always at your finger tip to do whatever with them: http://tuhdo.github.io/static/helm-projectile/helm-projectil...

- Switch between other files with same names but different extensions: http://tuhdo.github.io/static/helm-projectile/helm-projectil... Work not only for C/C++ but other languages, and is customizable. You don't have to configure anything, like adding include paths. Everything is automatically done for you.

- Jump to tag definition, from its own parser or external parser like GNU Global: http://tuhdo.github.io/static/c-ide/helm-gtags-jump-dwim.gif

- Do you like outline tree?: http://tuhdo.github.io/static/c-ide/sr-speedbar.gif

- Interactive outline tree: http://tuhdo.github.io/static/part3/helm-semantic-or-imenu.g...

- References retrieved from its Emacs internal parser: http://tuhdo.github.io/static/c-ide/semantic-symref.gif

- Beautiful compile output: http://tuhdo.github.io/static/c-ide/compilation-compile.gif

- Frontend support for GDB: http://tuhdo.github.io/static/c-ide/gdb-many-windows.gif

- Open man page for symbol at cursor: http://tuhdo.github.io/static/part3/helm-man-woman.gif

- Emacs open 39MB C file: http://tuhdo.github.io/static/performance.gif

- Emac opens multi-gigabtye file: http://www.emacswiki.org/VLF

tuhdo··on CotEditor – Text Editor for OS X
How is it faster than Projectile? Demos in here: http://tuhdo.github.io/helm-projectile.html. With Projectile, I can jump to any file quickly, even with source tree as large as Linux kernel with more than 36k files. If a file is in a project, regardless of where I see it, even in a plain .txt file, I can jump to it: http://tuhdo.github.io/static/helm-projectile/helm-projectil...

If you want that live web stuff, you can try skewer-mode: https://github.com/skeeto/skewer-mode

tuhdo··on Emacs Rocks
It works well for project like Linux kernel. Jump/listing references happens instantly.
tuhdo··on GNU GLOBAL source code tagging system
But GNU Global is being maintained, while cscope was abandoned. With GNU Global, you can actually update your database without recreating your tag database again. This is very useful for editor integration when you finish editing a file and save it.
tuhdo··on Emacs Rocks
It gives you hints like "buffer position 28726". You can press "M-g c" and enter that number to jump to that location, which is a character location of the error.

I wrote a guide on how to use package.el to install your package and how to customize and extend your Emacs here: http://tuhdo.github.io/emacs-tutor3.html, if you want control of your configuration from scratch.

Probably if you do not have proper Elisp learning, you should use Prelude: https://github.com/bbatsov/prelude. Everything is configured for you and packages are downloaded automatically. This is the easy way. Put your personal configuration code in ~/.emacs.d/personal/. You can also enable additional modules based on your need in ~/.emacs.d/sample/prelude-modules.el by toggling off comments: https://github.com/bbatsov/prelude/blob/master/sample/prelud....

I haven't tried loading from a different location, but you should try in your ~/.emacs.d first. Are you sure your packages are installed in Dropbox folder? I think it is installed in ~/.emacs.d. You should use a VCS like Git to store your configuration in the same .emacs.d directory.

Finally, to make sure it is because Magit, you should uninstall it to see if your Emacs loads properly. In my Windows machine, it loads perfectly fine with more than 130 packages.

← PreviousPage 2 of 5Next →