Get indent size/tab width config from prettier - prettier

Is there a way to get the configuration of the current directory, like the indent size and tab width from prettier? I would imagine something like prettier --get-config tab-width . and getting 2 since that seems to be the default.
I'm trying to solve my vim being set up with 4 spaces when I'm running prettier with no config and with no .editorconfig leaving my formatting to use 2 spaces while my indents are 4 spaces.

Related

Specifiy delimiter in Sublime Text

How can I specify a delimiter in Sublime Text (version 2 or 3)?
I am trying to set some flags but I can not see any option to specify a delimiter.
Is my only option that I have left to use inline flags?
As far as I know, Sublime does not have this and I don't know of a package that does - you would be able to apply most commands on a selection of code, but it's not able to open a new buffer.

WebStorm: reformat tab width on existing files

I'm trying out WebStorm and I've run into a minor, but frustrating problem: working from an existing project, files open with their tab width set to 2 instead of 4.
In Settings -> Code Style -> JavaScript I have use tab character selected and the tab size/indent/continuation indent all set to 4, but Ctrl + Alt + I from here which should 'fix' the indentation from 2 to 4 doesn't do anything, nor does Code -> Reformat Code as per this SO answer
Ultimately, I just want all tabs to be interpreted as a 4 space tab instead of a 2 space tab project-wide (css, scss, javascript, html).
Is there an easy way to do this?

How to increase line padding in Geany IDE?

I am using geany, and I need to increase line padding, ie, space between consecutive lines.
For example, in sublime text, we can change padding by:
"line_padding_bottom": 2,
"line_padding_top": 2
How do we do it for Geany? I tried many options and menus, but there doesn't seem to be an option!
Here is an image illustrating the problem: http://i.imgur.com/SWhdhaY.png
Go to Tools->Configuration Files->filetypes.common and search for line_height, and make as line_height=2;2;
Good answer, but you also need to uncomment [styling] line, if commented (mine was). So, configuration in filetypes.common should look like this:
[styling]
line_height=2;2;

How to keep the view format in notepad++ from simple notepad?

Been trying to get this one done for some time and couldn't find a solution.
The annoying issue I got is that when I open my x.txt notepad file everything is in line, organized, well arranged however when I do open it with notepad++ everything gets messed up. Here is a quick example (left notepad++/right notepad, same file) http://prntscr.com/9ypxcm
Some of the files get the same view format and style in both notepad and notepad++ (probably they were created originally in notepad++?) however some of my other text documents get really messed into notepad++ and I just hate simple windows notepad when it comes to text editing.
Would appreciate some help. Thank you
I just checked for How much spaces does a tab takes in both ?.
Notepad++ takes 4 spaces to constitute 1 tab.
Windows Notepad takes 6 spaces to constitute 1 tab.
Therefore when a file which is first edited in Windows Notepad ( 6 spaces-tab ) is opened in Notepad++, the tab is converted to 4 spaces reducing 2 spaces. That's why everything gets messed up
Solution
1) This is same file opened in two editors.
2) Now go as directed
Settings --> Preferences --> Tab Settings --> normal.
Uncheck the Use default value.
Click on Tab size. A small input box will appear.Input 6 as value and press Enter.
3) The tabs are now properly formatted.

Sublime Text macro to find and replace file path characters on current line

I use Sublime 2 for developing R and PHP code, although I imagine this shortcut would be useful for other languages.
If I copy the path of a file from Windows Explorer / XYPlorer (or other source) it has backslashes for directories. When entering a path into the source code, it needs forward slashes.
Sublime has some reasonably powerful macro commands, but I cannot think of a combination that would be able to:
take the string of text on the current line
replace all instances of '\' and replace them with '/'
Here is the workflow that I envisage:
Locate my filename in Explorer and copy its path
In Sublime, write a line of code and paste in the path
Hit a keyboard shortcut, say Ctrl+Shift+\, and all back slashes are converted to forward slashes
The result:
myPath = "E:\WORK\Code\myFile.csv";
Becomes:
myPath = "E:/WORK/Code/myFile.csv";
Without running the risk of backslashes elsewhere in the file being changed (e.g. \n characters), and without having to use multiple key presses or mouse clicks.
I imagine this would be possible with Regex. Two things I am no expert in are Sublime macros or regex, so I wonder if anyone else knows the magical commands that would achieve this?
I tried this for about 15 minutes. A few things:
Sublime text 2 doesn't allow for find/replace with macros
Sublime text 3 doesn't allow for 'find in selection'
So, I think you are kind of beat right now other than writing a plugin, which would be fairly straightforward.
This works for Sublime Text 3:
Type r before the string to tell python to read the directory as a raw string.
This way all the backslashes are read as slashes instead of 'ignore next character' (default meaning of \ in python)
Example
myPath = r"E:\WORK\Code\myFile.csv"
Python should now read the \ as /