6 ms·
Building Your First Atom Plugin
- asd 10y agoI really want to love Atom, mainly due to the plethora of cool plugins being created lately. However, its inability to handle large files and the slow launch times are unfortunate.
- shriek 10y agoI haven't tried atom for a while now but it's startup time was also something that put me off from using it on a daily basis.
- qudat 10y agoI guess I don't get the concern. Bootup happens once for me. I used to use vim but atom is much more Web friendly.
- sotojuan 10y agoNew software law: Every thread about Atom must contain a few people complaining about the start up time. It's also fine for me, and I love plugins like the merge conflicts one[1]. [1] https://atom.io/packages/merge-conflicts https://atom.io/packages/merge-conflicts
- striking 10y agoEh, vim has that too: http://vimcasts.org/episodes/fugitive-vim-resolving-merge-conflicts-with-vimdiff/ http://vimcasts.org/episodes/fugitive-vim-resolving-merge-co... (edit: holy downvotes, Batman! I thought I'd provide a helpful point about vim, since not everyone knows it has plugin capability. My bad!)
- fizzbatter 10y agoOn the note of Vim, i wonder what could make Plugin development as active as Atom? To me, that is a large part of what makes Atom attractive is the development community. I don't feel like Vim or Emacs has that, despite having so many plugins/etc. There just isn't as much Zeal for it. I wonder if something about Vim could simplify this. Make it easier to support, develop, extend and use plugins?
- sotojuan 10y agoDon't use Vimscript? You can't beat the react and ease of use of JavaScript. Also, a lot of people like their editors minimal. Vim users especially delegate a lot of work to Unix tools.
- biocomputation 10y agoAtom is ~30 years newer than the original version of Windows Notepad, and Atom runs on hardware that is orders of magnitude faster than the 286 on which early versions of Windows ran. Yet Atom is still slower and laggier than Notepad running on Windows in 1986. How did GitHub manage to pull off that feat? Given the fact that faster programs were made 30 years ago on vastly inferior hardware, Atom's performance absolutely deserves to be criticized. I can start Visual Studio right now and make a simple Windows desktop app in an hour with a text editor whose performance ( startup/ file load / editing ) will blow Atom away.
- lghh 10y ago> Yet Atom is still slower and laggier than Notepad running on Windows in 1986. I would love to see something beyond just a void claim of this. Numbers, a video, literally anything. Even though Atom has a completely different use case than Notepad, one is for a quick edit of a file and one is for managing a project including file indexing, project search, and plugins, I still don't believe this is true. And I don't even like Atom!
- biocomputation 10y agoIt would be great to post a video or some actual performance numbers, but I don't know where I'd get my hands on a 286 running the original version of Windows.
- lghh 10y agoI'd wager, if you somehow could find it, your nostalgic view of the speed of a computer from the 80s would quickly diminish. Especially when you had to deal with more than one file with Notepad.
- biocomputation 10y agoI was actually just a kid, so I don't really have nostalgic views of computer performance from the 1980s. I do remember typing reports in Notepad. We had a PC because my parents couldn't afford a Mac.
- rgreasons 10y agoI love Atom as well and didn't understand why there were so many complaints about its performance, but once I ran into one of these issues myself I was unable to use it for the time being. This specific issue opened on github[0] seemingly would affect a large number of atom's userbase - "Windows users with git repos" - and yet the best course of action is to modify atom from a community workaround. I love the editor and can't wait to go back to it, but I do really wish they would make a push to fix the smattering of performance issues and transition to v2.0. I think the editor is going to continue to have a bad PR problem as long as each discussion thread is half-full of potential users complaining about performance. [0]: https://github.com/atom/atom/issues/9544 https://github.com/atom/atom/issues/9544
- thom 10y agoIt seems like some people have created VLF-like packages for Atom that employ similar workarounds to emacs for large files. This tickles me, but I assume long term this'll be solved more fundamentally. I personally never cared much about emacs' similarly slow loading times, and don't see much of an issue with a modern editor taking time to start up. I'm happy just never quitting emacs on any of my machines, but it does mean you need something that interacts with sudo (i.e. tramp in emacs) to make quick edits to config files etc.
- tombert 10y agoIn Emacs' case, it bothered me until I discovered you can compile everything (including your `.emacs` file) and have it boot a lot faster. AFAIK, there's no equivalent in Atom yet.
- cloverich 10y agoI know this gets viewed as overly negative, but to provide a bit more context: I still use my purchased Sublime text instance for: 1) Quickly opening single files, and 2) Opening large e.g. JSON files. I prefer everything else about Atom / VSCode, but in my experience they have not yet matched the performance of Sublime Text.
- jnevelson 10y agoFor me it's not so much the slow start-up time - that I can deal with since it happens so infrequently - it's the intermittent lag when typing or selecting text, and the high memory and CPU usage. A text editor should not be consuming 100% of a CPU core for almost any length of time and making my laptop sound like an aircraft carrier. I love the concept of Atom (OSS text editor is awesome!), but it's bordering on unusable for me at the moment.
- whizzkid 10y agoLittle bit off topic but it is ironic that Atom's biggest problem of being laggy also applies to their blog post.
- hifumi 10y agoI'm glad someone finally made a tutorial for this. I've had some ideas for atom plugins but little help in implementing them.
- crashdown 10y agoin before Visual Stuidio Code/Sublime is better than Atom
- neuromute 10y agoIs there any plugin similar to this for Sublime? EDIT: Not sure why I'm being downvoted, but I'm genuinely curious. I searched the package manager and google, but couldn't find anything that offered this functionality.
- striking 10y agoHere you go. https://github.com/azac/sublime-howdoi-direct-paste https://github.com/azac/sublime-howdoi-direct-paste I think it's really sad you're being downvoted. Dunno why anyone would do that, it's a good question.
- neuromute 10y agoThank you! The gif/screenshot appears to be dead, so I can't see how it behaves exactly, but I'll investigate further.
- neuromute 10y agoSo, the first 2 searches pulled back fairly poor results. It would perhaps be useful to have a cycle to next result shortcut, in order to keep searching until you find something of use. That said, the Atom plugin used the same search term and returned a better first result, so it might be worth using something like their method for determining the top result. FWIW... First search, "QuickSort" returned: 6 + 7 = 13 13 / 2 = 6.5 6.5 rounded down = 6 Next search, "BubbleSort", produced: It depends on the way your data is distributed - if you can make some assumptions. One of the best links I've found to understand when to use a bubble sort - or some other sort, is this - an animated view on sorting algorithms: http://www.sorting-algorithms.com/
- romanovcode 10y agoOfftopic but is there some similar resource regarding VS Code?
- cloverich 10y agoThey have an overview and inside it links to a copule example repos: - https://code.visualstudio.com/docs/extensions/overview https://code.visualstudio.com/docs/extensions/overview - https://code.visualstudio.com/docs/extensions/example-hello-world https://code.visualstudio.com/docs/extensions/example-hello-...) to some getting started examples
- todd8 10y agoAtom does look very cool. Systems will get faster and any performance problems with Atom should diminish. But Atom makes me sad. I've got years and years invested in understanding how Emacs works and being able to tweet the capabilities of Emacs and write my own commands and packages in Emacs Lisp. I feel kind of stuck with it now. Don't get me wrong its a great place to be stuck--Emacs is the world's most powerful editor. Yet, a weakness that has always bothered about Emacs is it's reliance on an unpopular language, its own version of Lisp. There are so many Javascript programmers that, eventually, a Javascript based editor will exceed the capabilities Emacs which is written in Lisp and C. (I don't rule out success for NeoVim either, the foundation of vim with a clean way to write packages in Python, totally cool!) I wish there was a Neomacs project or a true org-mode and magit for Atom.
- formula1 10y agoSystems will not get faster since Moore's (not murphys) law is reaching its end. Though Atom could certainly get faster in a variety of ways. I think my biggest problem with atom currently is that its only useful on a personal computer in long sessions. I would never (could never) install it on a server and certainly cant use it to create a little script or project.
- LaMarseillaise 10y agoDid you mean Moore's Law?
- fizzbatter 10y agoIs it reaching it's end though? I could foresee us simply scaling horizontally rather than vertically. Even if it ends up drawing more power, more total CPU could still mean an increase in raw performance, no? (assuming systems were setup with better parallel processing. I'm aware that NodeJS is pretty terrible on this front)
- jamiewilson 10y agoThe end of Moore's Law does not mean that processing power will stop improving. It just means that there will likely be a slower rate at which the number of transistors gets doubled. Say, 3 years instead of 2. I think there is a physical boundary to that, but Moore's Law doesn't really address that.
- nicktikhonov 10y agoHey everyone ! I'm Nick - GitHub Campus Expert and the author of this tutorial. I'm glad that you all enjoyed hacking with Atom and can't believe that my post got to the front page! I would love to answer any questions about the content and would appreciate any feedback for this or future posts.
- ben_jones 10y agoAutomatically finding and dragging in code from stackoverflow is the most dangerous thing I've ever heard of. How accurate would you consider comparisons between yourself and J. Robert Oppenheimer? Jokes aside it's a cool tutorial. Plugin development for many editors is unnecessarily hard and a detriment to their ecosystems. It's cool that it's that simple for Atom. But as someone happy with my current editors (Jetbrains derivatives + plugins for projects / Sublime + plugins for small stuff), what advantages would you say Atom has that would incentivize people to try it out?
- nicktikhonov 10y agoWhile I advocate hacking Atom, I don't advocate actually using the plugin the tutorial teaches you to make as-is! A safer bet is Sourcerer (https://atom.io/packages/sourcerer https://atom.io/packages/sourcerer) - it's got some neat features like previewing snippets and attributing credit to the SO author through added comments. I always thought of this plugin as an educational tool for learning new languages, rather than something to be used regularly when building real software. That said, So many of us use StackOverflow to find library/API examples, and this is a nice shortcut! I think that this is generally safe for finding one-line examples and shorter snippets, where it's easy to read and understand what the code does. Before switching to Atom, I used vim and Sublime Text. The thing I enjoyed most about both of these editors was extending them with plugins. I think it's important to customise and personalise your editor because it's one of the few tools we use the most as developers, and any tweak/feature that saves us time doing a particular task means a great deal in the long term. I chose to switch to Atom because it's an editor designed around being easy to extend and customise - anyone who has done any web/Node development can dive right in. There are already nearly 5000 packages and themes available, and so far I found it much more open and easier to develop for than both Sublime and Vim.
- mhw 10y agoYay - it's great to get some more documentation about how to build plugins for Atom. That said, this tutorial neatly avoids adding much to Atom's view layer. When you try to extend the user interface you'll eventually run into https://github.com/atom/atom/issues/5756 https://github.com/atom/atom/issues/5756 "Let's choose a view framework for docs, generated packages, etc." which has been open for nearly 18 months. There's a commendable commitment not to force a single view framework on all plugin authors, but the cost of that seems to be that there's no single view framework that the project feels comfortable recommending and documenting as a starting point for new authors. And without a view framework to present as an example, there's little to go on to help figure out how to structure a plugin with some custom user interface components. The project generator used in this tutorial creates a sourcefetch-view.js file, but the tutorial never mentions it. The Atom flight manual talks about the view file in a little more detail, but stops short of explaining how responsibilities should be split between model and view in a more complex plugin. The best option available seems to be to go reading through the source code of other existing plugins out there, but as each chooses a different approach (see original problem) it's difficult to pick up what might be considered best practice and what has been deprecated - some packages use atom-space-pen-views for example, but that's the old recommended view framework that's been deprecated for a while. I like Atom as an editor, and part of the reason is that I really would like to extend it by using the languages that I'm already familiar with. But writing a plugin will (for me) only ever be a side project, and the amount of research I need to do to understand how to build some meaningful UI in Atom is too great at the moment for me.
- pbiggar 10y agoAfter 10 years in Vim and 5 years in Emacs, I recently switched to Atom. The reason I switched is how easy it is to extend. And it truly is: I was up and running in a few hours with my first plugin in Atom (the emacs legacy of code is daunting, while vimscript is truly awful). This is a great resource, which I had patched together while I was building my first plugins. One major downide of atom is that while you can develop your own plugins, core atom modules are extremely slow to accept contributions. I spent a lot of time on something (https://github.com/atom/tree-view/pull/913 https://github.com/atom/tree-view/pull/913) which makes sense in core but is hard to do as a package, and it's been ignored, along with 42 other PRs on the same repo. I really like Atom for its hackability, but an important part of hackability is community contribution. Their roadmap is 404ing (http://blog.atom.io/2014/10/23/public-roadmap.html http://blog.atom.io/2014/10/23/public-roadmap.html), they don't really take public contributions, and AFAICT there's no public product direction of any kind. I hope they solve this - Atom is too good to lose to bad community management.
- lee-dohm 10y agoThanks very much for the feedback! We're always excited to hear when people enjoy using Atom. It is true that we have been extremely slow to accept contributions. There are many causes for this, not the least of which is that we are a small team of maintainers working on a very large and ambitious project. Whatever the causes, it is something that I am committed to fixing. I'm working with the engineering manager on a new system of prioritization to burn down the backlog of PRs needing review (https://github.com/search?utf8=%E2%9C%93&q=user%3Aatom+is%3Apr+is%3Aopen+label%3Aneeds-review https://github.com/search?utf8=%E2%9C%93&q=user%3Aatom+is%3A...). We feel we've made some good progress because of it. We took down the roadmap because it wasn't being maintained by the team anymore. (I'll amend the blog post to note that fact.) We felt that no roadmap is better than an incorrect one. The best we can offer right now for a public roadmap is what is currently being worked on by the official Atom maintainers. There is an easy GitHub search linked in the Atom FAQ on the subject (https://discuss.atom.io/t/is-there-an-atom-roadmap/21033 https://discuss.atom.io/t/is-there-an-atom-roadmap/21033). Longer term this is also something that we are going to be increasing transparency on. Again, thank you for calling out these problems. Community contribution is important to us. We're having some growing pains right now, yes. We are committed to fixing them and I and the rest of the team hope that you and others with the same concerns will stick with us while we work out exactly how to fix them!
- deelowe 10y agoI like Atom, but man the start-up time is rough when there are several plugins installed.
- nikmobi 10y agoGiven the amount of complaints about this (from me as well) I would think this would be priority #1 for Atom developers, but that doesn't seem to be the case. I remember some time ago there was an uber issue on Github for this, but I think I remember seeing it marked as resolved when I can absolutely tell not much has changed (and I have installed barely any plugins). :( EDIT: I guess I was wrong[0,1] [0] https://github.com/atom/atom/issues/2654 https://github.com/atom/atom/issues/2654 [1] https://github.com/atom/atom/issues/9572 https://github.com/atom/atom/issues/9572
- 0xmohit 10y agoWe'll be building a clone of Sourcerer, a plugin for finding and using code snippets from StackOverflow. I wish some other example was demonstrated. This reminds one of https://imgur.com/gallery/SZPjHwz https://imgur.com/gallery/SZPjHwz EDIT: This is even more disappointing after observing that the post author -- "GitHub Campus Expert". What a fantastic example being presented to students.