Does atom have undofile feature like vim? - atom-editor

Vim has feature called undofile, in which vim stores changes. It allows to revert changes after a file was closed and opened again. Does atom have similar feature?

Out of the box, no atom does not have this feature, but what you could do is modify the save event to allow you to commit to a github file and then roll back the commits.

Related

Commit a large number of files in RStudio using GIT panel

In RStudio, if you are dealing with a directory that contains a large number of files, and you want to commit and push the recent changes (that you made on all of them) to your repository, the GUI Git component gets super slow and practically doesn't work. Any idea?
Of course you can ignore the GUI and stick to the command-line Git forever, but if you don't want, a quick jump to the command-line git would solve this problem for now.
The temporary solution that I found is as follows:
Click on the blue-gear icon on the GIT panel, inside RStudio.
Select Shell (a terminal window will pup up!)
Write the add and commit command in the terminal:
{ATTENTION: The following command will commit changes on ALL files! You may want to use what is appropriate for your situation!}
git add -A && git commit -m 'staging all files'
Now you can go back to the GUI Git, and click on push button. All files that you staged in the terminal window, will be pushed up to your repository.
My workaround today was to...
create a man1/ directory in my RStudio project (after force-closing and
relaunching RStudio a few times after I had done something that caused it to hang again),
include man1/ in .gitignore,
move just about everything in man/ to man1/,
delete the .git/index.lock file in the repository,
futz around with RStudio, until it was responsive enough to make the (small) commit of files from man/,
pull and push, so that the remote main was once-again fully synched
copy some files from man1/ to man/, commit these
repeat and rinse of steps 6 and 7, until there's nothing left in man1/
Delete man1/ and its entry in .gitignore
My recipe above isn't one-size-fits-all... for example, you may have run into a "diff is too large" difficulty with RStudio because of a single oversized file, rather than (as I had) with "too many" small files. If you're trying to commit a monstrously-big set of diffs from a single file... you should be including this file in your .gitignore, rather than expecting it to be version-controlled without any difficulty by git. Also, if you're locking up RStudio's Git-interface because of "too many" files being committed simultaneously, your first port of call should I think to commit directories one at a time (but do be sure to push & pull after each commit).
And... I'm not going to complain about this defect in how RStudio interacts with git!
Instead I'll close with some kudos. After just a few days of futzing around with RStudio, I'm finding it to be so much easier than what I remember about hacking on S via emacs in the early 1990s. RStudio handles just about everything (especially the ROxygen documentation workflows) than the emacs/eSS setup that I had been struggling to get fully operational earlier this month.
I'm also impressed with how R has developed since the last time I looked at it -- about 20 years ago! The semantics lurking in corner cases are still very "surprising", to put it mildly ;-) But I do appreciate how it has maintained compatibility with the truly-bizarre and primitive semantics of S while allowing its power-users (which will surely never include me!) to write expressively, elegantly, and with an appropriate balance between concision and the write-only alphabet-soup of APL and its ilk (https://en.wikipedia.org/wiki/Write-only_language)

How to tell Atom to not remember last opened project?

I would like to retrieve the welcome screen (and only it) when I start Atom. That way, I'll be able to choose the project I want to work on each time I start Atom (currently, I have to close the project opened the last time).
I already re-enabled the Welcome package in the init.coffee file so I see the welcome screen each time I start Atom, but there are two problems.
First: this screen is now shown every time I open a new window, so every time I open another project than the current one (I use Projects Manager if it matters). It's not very useful, as I only want to see this screen when I start Atom.
Second: I see the welcome screen on start, but only as new tabs in the last opened project, so the problem remains the same.
Has someone a solution?
The setting you are looking for is Settings > Open Empty Editor On Start, which is on the Core Settings page, right under Ignored Names. Make sure to enable this setting, i.e. check the box. Whenever you start Atom from its icon now, it will start with an empty editor, and will not reopen your previously used files.
I came across this problem, too.
But I found that if I had 'openEmptyEditorOnStart: true' in the config.cson file, and each time I quit the Atom I did "Remove Project Folder" in the "Tree View", next time I opened the Atom edit, I can open it without the last opened project.
Hope it helps. :)
Proper configuration to get empty editor on every start:
✔️ Open Empty Editor On Start
✖️ Restore Previous Windows On Start
Just go to File > Reopen Project > Clear Project History. It worked for me.
I just switched of package tree view
Setting/packages tree-view - disable
And when open Atom it is free of project tree
You need to do both in Core settings:
check Open Empty Editor On Start
set Restore Previous Windows On Start to no

Where does Atom store its recently opened files list?

I'm using Atom 1.0.15. On startup, Atom tries to open a file on a MTP device every time, which is very annoying. Even after closing the tab referring to the file on the MTP device, Atom will try to reopen it on next startup.
A fix would probably be to clear the recently opened files list, but I can't find it. Where is it located?
A quick and inelegant way is to just clean your ~/.atom/storage directory (%HOMEPATH%\.atom\storage).
This should 'reset' Atom to a project-less state.
According to this site: 1, it saved it in indexedDB. So if you want to clear it:
Press ctrl-shift-i
Find the Application tab where you may see the IndexedDB databases.
You may delete the Atom* ones.

Aptana 3 automatic download/upload

I'm trying to switch from Dreamweaver to a real IDE and trying Aptana as a likely candidate, however i'm stuck on how to get it's FTP to behave the way it did in DW.
Basically when I open a file in a project, it needs to automatically download from the FTP connection, before opening it.
The Deployment Settings > Automatically Sync in Both Direction doesn't seem to work, the only option of those 3 that works is "Sync from my machine to remote", which basically uploads the file on save - which is great, but I also need it to download when I open the file as well.
Am I missing something?
Currently Aptana Studio does not run file synchronization on it's opening, only on save.
There is a ticket for this feature which you could vote for.
Alternatively, you should be able to open, edit and save files directly from FTP connection.

open with default editor and wait to be closed

we're developing an app that should be able to open specified file with default editor application. (so if it is .doc - it suppose to be opened by MSWord or openOffice)
But I also need to wait until user will close the editor, check if it was changed (by size and date), and upload it to the server.
So the following steps:
1) find def editor
2) open file
3) wait it be closed
4) do smth after that with the file.
now results of my research:
-> opening by def editor is simple: file.openWithDefaultApplication();
but there is no way to know that editor is closed (maybe by checking that file is not locked in timer???)
-> i can start the native process and pass file as parameter BUT looks like the code
NativeApplication.nativeApplication.getDefaultApplication(file.extension);
does not work for any extension :( - it doesnt work for "rtf", "doc" but works for "pdf"... and [file.openWithDefaultApplication()] works fine with any file!
any suggestions?
thx in advance!
but there is no way to know that
editor is closed
Correct. I do not believe what you want to do is possible with AIR. How would AIR be able to tell whether the file is open or not? You might want to look into using NativeProcess; but that would be reliant on the underlying OS/default program exposing APIs to let you know when the program was open and/or closed.
My only suggestion is that you don't have the Air application watch the file, but instead show a popup that say 'click okay when done editing file' and then upload it based on that.
The only other way I can think of this working is if you create both a .bat and a .sh file
(for both windows and macs/linux; select one or the other depending on the os) which open the file you want through NativeProcess (and of course, put 'wait') and then listen for the close event.

Resources