Coder Social home page Coder Social logo

Comments (3)

nilscox avatar nilscox commented on May 30, 2024 2

I actually found a way to copy the relative / absolute path and filename of the current file with existing commands from FileManager:

[
  { "keys": ["..."] , "command": "fm_copy", "args": { "which": "relative path" } },
  { "keys": ["..."] , "command": "fm_copy", "args": { "which": "absolute path" } },
  { "keys": ["..."] , "command": "fm_copy", "args": { "which": "name" } }
]

This could be added to the documentation. Hope it helps!

from filemanager.

math2001 avatar math2001 commented on May 30, 2024 1

I don't think that belongs in file manager, but it's not too hard to write your own plugin for that.

import sublime
import sublime_plugin


class CopyFilePathAndLineNumberCommand(sublime_plugin.TextCommand):
	def run(self, edit):
		row_number = self.view.rowcol(self.view.sel()[0].begin())[0] + 1
		file_path = None

		for folder in self.view.window().folders():
			if folder in self.view.file_name():
				file_path = self.view.file_name().replace(folder + '/', '')
				break

		if file_path is None:
			file_path = self.view.file_name()

		sublime.set_clipboard('{}:{}'.format(file_path, row_number))
{"keys": [...], "command": "copy_file_path_and_line_number"}

from filemanager.

danilokleber avatar danilokleber commented on May 30, 2024

Is it possible to include the line number in the copied path?

from filemanager.

Related Issues (20)

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.