I am trying to set the default indentation and tabs in Xcode 8.x to 2 spaces
In the utilities I changes the default values from 4 to 2
However nothing has changed. Did I miss something?
If you want to do this for all projects, you can set this globally in the
Text Editing / Indentation preferences:
You have to go to every file and then to Command + A then Ctrl + I which will indent the file with the two spaces. That setting does not touch files already created in the project.
How to (easily) get current file path in Sublime Text 3
I don't often use ST console (I used it only once to install package manager), but I suppose it could be good way to :
get current file path like some kind pwd command.
But it doesn't work.
Does anyone know an easy way to get current file path?
to clipboard : better not a strict objective in the answer
not necessary by ST command, maybe package?
Right click somewhere in the file (not on the title tab) --> Copy file path
If you don't want to use the mouse, you could set up a keyboard shortcut as explained here https://superuser.com/questions/636057/how-to-set-shortcut-for-copy-file-path-in-sublime-text-3
To easily copy the current file path, add the following to Key Bindings - User:
{ "keys": ["ctrl+alt+c"], "command": "copy_path" },
Source
Key Bindings - User can be opened via the command palette (command + p on OSX)
Easy to understand using image. On Right Click you will get this.
Transcribed code in image for convenience:
import sublime, sublime_plugin, os
class CopyFilenameCommand(sublime_plugin.TextCommand):
def run(self, edit):
if len(self.view.file_name()) > 0:
filename = os.path.split(self.view.file_name())[1]
sublime.set_clipboard(filename)
sublime.status_message("Copied file name: %s" % filename)
def is_enabled(self):
return self.view.file_name()... # can't see
Mac OS X - Sublime Text 3
Right click > Copy File Path
A lot of these answers involve touching the mouse. Here's how to do get the path without any mouse clicks using SideBarEnhancements
Install SideBarEnhancements using PackageControl.
Click super + shift + P to open the command palette
In the command palette begin typing path until you see File: Copy Path
Select File: Copy Path
Now the path to file you are working in is copied into your clipboard.
There is a Sublime Package which gives your current file location inside a status bar. I just cloned them directly to my /sublime-text-3/Packages folder.
git clone git#github.com:shagabutdinov/sublime-shell-status.git ShellStatus;
git clone git#github.com:shagabutdinov/sublime-status-message.git StatusMessage;
You have to check/read the description on GitHub. Even it is listed in package control it would not install properly for me. You can actually edit the shell output as you want. If you have the right skills with python/shell.
Looks like this (Material Theme)
If you're like me and always click on items in the sidebar just to realize that copying the path only works when clicking in the editor area, have a look at the SideBarEnhancements package. It has a huge bunch of options to copy file paths in a variety of different ways.
Installation is available via Package Control (despite the webpage only mentions installation via manual download).
Note: The package “sends basic, anonymous statistics”. The webpage explains how to opt out from that.
Go to this link. The code in the link is given by robertcollier4.
Create a file named CpoyFileName.py or whatever you like with .py extension.
Save the file in Sublime Text 3\Packages\User folder. Then paste the above given key bindings in your Preferences: Key Bindings file.
Now, you can use the specified key bindings to copy just filename or total (absolute) filepath.
Please note that the filename or filepath do contain file extension.
Fastest Solution ( No Packages Needed + Comprehensive ):
Folder Path:
Folder in "Sidebar"
Right Click
"Find In Folder"
"Where" field contains everything you need
File Path:
File in current "Tab"
Right Click
"Copy File Path"
I am trying to add a Windows Context Menu item that will let me right click a file in Windows Explorer and click a button Open in Dev Server.
This will then pass the file path of the selected file to a Windows .bat file.
In my .bat file openLocalHostWebBrowser.bat so far I have this code below which wehn ran opens a new tab in my web browser with the supplied URL.
#echo off
start "webpage name" "http://someurl.com/"
So I need help. I know how to add the context menu in Windows Explorer that will run my openLocalHostWebBrowser.bat file when clicked on.
What I need help with is taking that file path that is passed and changing it by removing part of the front of it and prepending my localhost or any URL for that matter, perhaps another one for a production server.
So if the file path passed to my .bat file is like this...
E:\Server\htdocs\labs\php\testProject\test.php
then I need to somehow turn it into this...
http://localhost/labs/php/testProject/test.php
The E:\Server\htdocs\ should be replaced with http://localhost/
I believe your requirement is fixed (E:\Server\htdocs\ should be replaced with http://localhost/). If so, below may help you.
#echo off
set input=%1
Echo.Input was - %input%
set converted=%input:E:\server\htdocs\=http://localhost/%
set converted=%converted:\=/%
echo.Converted to - %converted%
Sample tested output -
D:\Scripts>repl.bat E:\Server\htdocs\labs\php\testProject\test.php
Input was - E:\Server\htdocs\labs\php\testProject\test.php
Converted to - http://localhost/labs/php/testProject/test.php
Cheers, G
When viewing an XML File in UTF-8 which has the following character 'ß', it actually appears as '▒'. The file was created in notepad++ and all looked fine. But when viewing it in PuTTY the change appears. I have amended my PuTTY configurations as per below, but the file still contains the strange character:
Right click Putty
Click 'Change Settings'
Navigate to Window > Translation
Select 'UTF-8' from the drop down menu.
Click 'Apply' to save the changes.
Snippet of the file:
<?xml version='1.0' encoding = 'UTF-8'?>
<request xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<test>Flo▒\237er Str. 53</test>
</request>
All other characters appear fine e.g. 'ö', 'ü'.
It sounds like your shell environment is simply set incorrectly. To temporarily set it to support UTF-8, do:
export LANG="en_GB.UTF-8"
This should allow you to run view in the same session and the character to show correctly.
Making this change permanently depends on your Linux distribution and whether you have root access. For Ubuntu, see https://help.ubuntu.com/community/Locale#Changing_settings_permanently
If you don't have root access you can edit ~/.bashrc and paste the command above to the end of the file
In Geany, editing PHP scripts, when you select lines and press control-e, the selected lines are commented by being wrapped in "/* ... */". Is there a way to change this behaviour so that it instead puts a "//" in front of each line?
All the other IDEs that I've used make use of "//" (Eclipse, Netbeans, Textmate, etc).
Settings like comment characters are controlled by filetype definition files. Assuming your scripts end in .php, you should find the default system-wide filetype definition file filetypes.php, and copy it to your filedefs directory in your user configuration directory. Then you can modify it as necessary.
This is all explained in detail in the manual (link above).