Giter Club home page Giter Club logo

atom-copy-path's Introduction

copy-path

Copy a file path flexibly!

Context Menu on a Tab

capture

Command Palette

The path of the active text editor is copied.

  • copy-path:copy-basename
  • copy-path:copy-extension
  • copy-path:copy-basename-wo-extension
  • copy-path:copy-project-relative-path
  • copy-path:copy-full-path
  • copy-path:copy-base-dirname
  • copy-path:copy-project-relative-dirname
  • copy-path:copy-full-dirname
  • copy-path:copy-line-reference
  • copy-path:copy-project-relative-path-web (windows only)

License

The MIT License.

atom-copy-path's People

Contributors

mvalipour avatar pluff avatar s-shin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

atom-copy-path's Issues

Add option "Copy HTTP URL to this file"

Would be very useful if we can have an option to copy a configurable HTTP path to the file.

We already have the option to copy the full path. eg:

L:\repository\project-trunk3\admin_page\manager\script\test_access.php

But to test manually the code I need to input this in browser:

http://1.2.3.4/myproject/admin_page/manager/script/test_access.php

Of course, it's necessary to exist an option somewhere we can define the new prefix (based on full path) "L:\repository\project-trunk3" replaced by "http://1.2.3.4/myproject/" (and remaining backslashes replaced by slashes).

Where is relative path?

I only get an option for Copy Full Path and Copy Project Path. Is there no relative path option?

Uncaught TypeError: atom.workspace.getActivePaneItem(...).getPath is not a function

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 1.5.3
System: Mac OS X 10.11.3
Thrown From: copy-path package, v0.4.0

Stack Trace

Uncaught TypeError: atom.workspace.getActivePaneItem(...).getPath is not a function

At /Users/leeyi/.atom/packages/copy-path/lib/index.js:91

TypeError: atom.workspace.getActivePaneItem(...).getPath is not a function
    at _class.getTargetEditorPath (/Users/leeyi/.atom/packages/copy-path/lib/index.js:91:47)
    at _class.copyFullPath (/Users/leeyi/.atom/packages/copy-path/lib/index.js:123:31)
    at atom-workspace.copyPathCopyFullPath (/Users/leeyi/.atom/packages/copy-path/lib/index.js:18:47)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:260:29)
    at CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:61)
    at CommandRegistry.module.exports.CommandRegistry.dispatch (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:160:19)
    at AtomEnvironment.module.exports.AtomEnvironment.dispatchApplicationMenuCommand (/Applications/Atom.app/Contents/Resources/app.asar/src/atom-environment.js:1013:28)
    at emitOne (events.js:77:13)
    at EventEmitter.emit (events.js:169:7)

Commands

     -1:50.1.0 encoding-selector:show (div.line)
     -1:44.3.0 tree-view:reveal-active-file (div.line)
  2x -1:40.6.0 spell-check:correct-misspelling (div.line.cursor-line)
     -0:00.6.0 copy-path:copy-full-path (div.package-readme.native-key-bindings)

Config

{
  "core": {
    "disabledPackages": [
      "language-java",
      "language-hyperlink",
      "language-ruby",
      "language-ruby-on-rails",
      "language-toml",
      "language-csharp",
      "wrap-guide",
      "language-clojure",
      "language-coffee-script",
      "erlang-build",
      "language-gfm",
      "keybinding-resolver",
      "language-go",
      "language-objective-c",
      "language-perl"
    ],
    "followSymlinks": true,
    "packagesWithKeymapsDisabled": [
      "atom-alignment"
    ],
    "themes": [
      "atom-light-ui",
      "eiffel-syntax"
    ]
  }
}

Installed Packages

# User
atom-alignment, v0.12.1
copy-path, v0.4.0
css-snippets, v0.9.0
editorconfig, v1.2.4
eiffel-syntax, v0.4.0
language-erlang, v3.0.0
language-swift, v0.4.0
linter, v1.11.3
linter-erlc, v0.3.0

# Dev
No dev packages

Uncaught TypeError: Path must be a string. Received undefined

  1. Open a new tab by Cmd+N.
  2. Copy Basename from the context menu on any tab.

Atom: 1.24.0 x64
Electron: 1.6.16
OS: Mac OS X 10.13.3
Thrown From: copy-path package 0.4.2

Stack Trace

Uncaught TypeError: Path must be a string. Received undefined

At path.js:7

TypeError: Path must be a string. Received undefined
    at assertPath (path.js:7:11)
    at Object.parse (path.js:1494:5)
    at _class.parseTargetEditorPath (/packages/copy-path/lib/index.js:107:17)
    at _class.copyBasename (/packages/copy-path/lib/index.js:116:25)
    at HTMLElement.copyPathCopyBasename (/packages/copy-path/lib/index.js:14:46)
    at CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app/src/command-registry.js:388:36)
    at CommandRegistry.dispatch (/Applications/Atom.app/Contents/Resources/app/src/command-registry.js:273:23)
    at AtomEnvironment.dispatchContextMenuCommand (/Applications/Atom.app/Contents/Resources/app/src/atom-environment.js:1290:25)
    at EventEmitter.outerCallback (/Applications/Atom.app/Contents/Resources/app/src/application-delegate.js:346:31)
    at emitThree (events.js:116:13)
    at EventEmitter.emit (events.js:194:7)

Commands

     -0:06.0 application:new-file (input.hidden-input)
     -0:01.4.0 copy-path:copy-basename (div.title)

Non-Core Packages

activate-power-mode 2.7.0 
aligner 1.2.4 
aligner-javascript 1.3.0 
aligner-ruby 1.6.1 
atom-color-highlight 3.0.9 
atom-ctags 5.1.2 
atom-fuzzy-grep 0.17.2 
atom-ternjs 0.18.3 
atom-typescript 12.1.2 
autocomplete-clang 0.11.4 
autocomplete-paths 2.12.2 
blame 1.0.1 
block-travel 1.0.5 
busy-signal 1.4.3 
clang-format 1.30.0 
color-picker 2.2.5 
copy-path 0.4.2 
docblockr 0.13.6 
environment 1.3.1 
ex-mode 0.18.0 
file-icons 2.1.16 
go-debug 1.6.0 
go-plus 5.8.2 
go-signature-statusbar 1.2.3 
highlight-column 0.5.4 
highlight-selected 0.13.1 
hyperclick 0.1.5 
indent-toggle-on-paste 0.1.3 
intentions 1.1.5 
jumpy 4.2.0 
language-apache 1.8.0 
language-bison 1.0.0 
language-cmake 1.1.0 
language-haskell 1.17.3 
language-jade 0.7.2 
language-kotlin 0.5.0 
language-plantuml 0.2.0 
language-protobuf 0.7.1 
language-rust 0.4.12 
language-scala 1.1.9 
language-vue 0.23.1 
linter 2.2.0 
linter-clang 4.1.2 
linter-coffeelint 1.3.1 
linter-eslint 8.4.1 
linter-jsxhint 0.1.2 
linter-kotlin 0.6.0 
linter-perl 0.8.1 
linter-perl-lint 0.1.2 
linter-perl-misc 0.1.1 
linter-rubocop 2.2.3 
linter-scalac 1.4.4 
linter-shellcheck 1.4.6 
linter-tslint 1.9.0 
linter-ui-default 1.6.10 
local-settings 0.4.1 
merge-conflicts 1.4.5 
minesweeper 0.1.0 
minimap 4.29.7 
minimap-find-and-replace 4.5.2 
minimap-pigments 0.2.2 
pigments 0.40.2 
pomodoro 1.2.0 
preview 0.17.0 
react 0.17.0 
rubocop-auto-correct 1.5.1 
script 3.17.3 
starred-projects 0.1.0 
stealth-mode 0.0.0 
tag 0.5.0 
terminal-plus 0.14.5 
todo-show 2.1.0 
toggle-quotes 1.1.0 
upload 0.0.0 
vim-mode 0.66.0 
vim-mode-plus 1.28.0 

Uncaught TypeError: Cannot read property 'getPath' of undefined

[Enter steps to reproduce below:]

it just happens.

  1. cmd +t
  2. select a file
  3. right mouse click and select copy project relative path

Atom Version: 1.2.4
System: Mac OS X 10.11.1
Thrown From: copy-path package, v0.2.1

Stack Trace

Uncaught TypeError: Cannot read property 'getPath' of undefined

At /Users/kei/.atom/packages/copy-path/lib/index.js:48

TypeError: Cannot read property 'getPath' of undefined
    at _class.getTargetEditorPath (/Users/kei/.atom/packages/copy-path/lib/index.js:48:48)
    at _class.copyProjectRelativePath (/Users/kei/.atom/packages/copy-path/lib/index.js:76:59)
    at atom-workspace.copyPathCopyProjectRelativePath (/Users/kei/.atom/packages/copy-path/lib/index.js:17:59)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:260:29)
    at CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:61)
    at CommandRegistry.module.exports.CommandRegistry.dispatch (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:160:19)
    at AtomEnvironment.module.exports.AtomEnvironment.dispatchContextMenuCommand (/Applications/Atom.app/Contents/Resources/app.asar/src/atom-environment.js:993:28)
    at emitTwo (events.js:87:13)
    at EventEmitter.emit (events.js:172:7)
    at EventEmitter.ipc.sendSync (/Applications/Atom.app/Contents/Resources/atom.asar/renderer/api/lib/ipc.js:21:31)
    at BrowserWindow.RemoteMemberFunction [as emit] (/Applications/Atom.app/Contents/Resources/atom.asar/renderer/api/lib/remote.js:138:29)
    at ContextMenuManager.module.exports.ContextMenuManager.showForEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/context-menu-manager.js:156:33)
    at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentContextmenu (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:252:47)
    at HTMLDocument.<anonymous> (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:3:61)

Commands

     -2:56.9.0 core:move-down (atom-text-editor.editor.is-focused)
     -2:53.9.0 editor:select-to-end-of-line (atom-text-editor.editor.is-focused)
     -2:53.6.0 core:copy (atom-text-editor.editor.is-focused)
  6x -2:53.3.0 core:move-up (atom-text-editor.editor.is-focused)
     -2:51.8.0 editor:move-to-end-of-screen-line (atom-text-editor.editor.is-focused)
     -2:50.4.0 core:paste (atom-text-editor.editor.is-focused)
     -2:49.8.0 editor:newline (atom-text-editor.editor.is-focused)
     -2:47.4.0 core:move-up (atom-text-editor.editor.is-focused)
     -2:47.2.0 editor:move-to-end-of-screen-line (atom-text-editor.editor.is-focused)
     -2:46.9.0 editor:newline (atom-text-editor.editor.is-focused)
  4x -2:29.6.0 core:move-left (atom-text-editor.editor.is-focused)
     -2:12.7.0 fuzzy-finder:toggle-file-finder (atom-text-editor.editor.is-focused)
     -0:56.2.0 core:select-all (atom-text-editor.editor.mini.is-focused)
     -0:51.9.0 core:confirm (atom-text-editor.editor.mini.is-focused)
     -0:12.4.0 fuzzy-finder:toggle-file-finder (atom-text-editor.editor.is-focused)
     -0:01.2.0 copy-path:copy-project-relative-path (li.tab.sortable.active.right-clicked)

Config

{
  "core": {}
}

Installed Packages

# User
copy-path, v0.2.1

# Dev
No dev packages

Feature Request: Escaped path names

I'm not sure how useful this is cross platform, but on OS X, for copying paths into the terminal that contain a space in the folder name, it would be great if it copied with the space escaped:

/Users/jeremyclark/Code/Test\ Vectors/blah.c <--- this
/Users/jeremyclark/Code/Test Vectors/blah.c <--- not this

Uncaught TypeError: Not a string or buffer

[Enter steps to reproduce below:]

  1. create a new file
  2. save it
  3. right click the tab, "Copy Full Path"

Atom Version: 1.0.11
System: Microsoft Windows 7 Professional
Thrown From: copy-path package, v0.1.1

Stack Trace

Uncaught TypeError: Not a string or buffer

At crypto.js:97

TypeError: Not a string or buffer
    at TypeError (native)
    at Hash.update (crypto.js:97:16)
    at Clipboard.module.exports.Clipboard.md5 (C:\Users\Andy\AppData\Local\atom\app-1.0.11\resources\app.asar\src\clipboard.js:16:39)
    at Clipboard.module.exports.Clipboard.write (C:\Users\Andy\AppData\Local\atom\app-1.0.11\resources\app.asar\src\clipboard.js:20:40)
    at _class.copyFullPath (C:/Users/Andy/.atom/packages/copy-path/lib/index.js:79:20)
    at atom-workspace.copyPathCopyFullPath (C:/Users/Andy/.atom/packages/copy-path/lib/index.js:18:47)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (C:\Users\Andy\AppData\Local\atom\app-1.0.11\resources\app.asar\src\command-registry.js:245:29)
    at CommandRegistry.handleCommandEvent (C:\Users\Andy\AppData\Local\atom\app-1.0.11\resources\app.asar\src\command-registry.js:3:61)
    at CommandRegistry.module.exports.CommandRegistry.dispatch (C:\Users\Andy\AppData\Local\atom\app-1.0.11\resources\app.asar\src\command-registry.js:156:19)
    at [object Object].jQuery.fn.trigger (C:\Users\Andy\AppData\Local\atom\app-1.0.11\resources\app.asar\src\space-pen-extensions.js:64:23)

Commands

     -0:16.9.0 application:new-file (ul.list-inline.tab-bar.inset-panel)
     -0:14.8.0 core:save (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "themes": [
      "atom-dark-ui",
      "atom-dark-syntax"
    ],
    "disabledPackages": [
      "wrap-guide"
    ]
  }
}

Installed Packages

# User
copy-path, v0.1.1
file-types, v0.5.1
project-manager, v2.2.0

# Dev
No dev packages

Unable to map keybindings to commands

I am working on MacOS Sierra and have been unable to get any keybindings to work with the provided commands. I pasted this into my keymap.cson to no effect.

'copy-path:copy-line-reference':
  'ctrl-shift-X': 'copy-path:copy-line-reference'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.