What is the package to paste file path at top of file?


#1

I used to use a package that simply added the file name and path to the top of the file. Now I want to use it again but I can’t find it. Does anyone know its name?

There are so many packages in atom.io now that I can’t find anything. The search isn’t good enough. The search needs tags or something.

It would be a shame to write a new package just because I can’t find the old one.


Key combination to paste current working files absolute path
#2

+1 for tags in package search.


#3

Keywords already exist in package search …


#4

I’m going to do a fork of the snippets package that adds variables like these. So I can easily do what that package did.

  • files

    • ${dirname} => /root/proj/lib
    • ${filename} => /root/proj/lib/main.coffee
    • ${basename} => main.coffee
    • ${extname} => .coffee
    • ${sep} => /
    • ${deliminator} => :
    • ${package} => /root/proj
    • ${dirnamerel} => lib
    • ${filenamerel} => lib/main.coffee
  • date & times (Note the colon)

    • ${:any-moment-format} current time in any format provided by the moment npm package
      • ${:MMMM Do YYYY, h:mm:ss a} => November 22nd 2014, 2:24:26 am
      • ${:dddd} => Saturday
      • ${:MMM Do YY} => Nov 22nd 14
  • positioning – these variables always show an empty string

    • ${top} => insert entire snippet at top of file
    • ${bottom} => insert entire snippet at bottom of file
    • ${12} => insert such that top line of snippet is on line 12
    • ${cursor-3} => insert such that top line of snippet is 3 lines above cursor
  • Package.json (note the exclamation mark)


#5

Why not contribute that back to the official snippets package so that everyone can benefit?


#6

I asked if they wanted a PR.

It doesn’t really matter. If I do a fork of snippets for a package then they can ask for a PR at any time and I’ll delete my package.


#7

Hmmm. How do I do this? If I do a real fork on github is there a way to publish it to atom.io under a different name? If I don’t do a real fork I won’t be able to do a PR later, right?


#8

Yet another question about this. How do I work on a core package? Does atom automatically replace a core module with one of the same name in ~/.atom/packages?


#9

I believe you can change the name of the package independently of the repository by changing it in the package.json. Though you would have to be careful that didn’t get included in the pull request.

Yes, it does. Or ~/.atom/dev/packages if you’re running Atom in Dev Mode.


#10

So it will only check ~/.atom/packages in normal mode and only ~/.atom/dev/packages in dev mode?

I made a pull request. I tried to make a package out of the fork but I gave up. I changed the name snippets to snip everywhere (a lot of places) and put it in ~/.atom/packages but I couldn’t get it to take effect. Oh well, I just hope the team likes it enough to pull it.


#11

No, it’s more like this:

  1. If in Dev Mode, load packages from ~/.atom/dev/packages
  2. Load packages from ~/.atom/packages if packages of the same name haven’t already been loaded
  3. Load default-installed packages if packages of the same name haven’t already been loaded

Though the order may be reversed, the effect is the same.