I want to widen the left viewer in rails.vim - ruby-on-rails

I use rails.vim which is great. One thing that annoys me is that every time I open a file, the left window (directory viewer) is set to its default width(24 cols). It's too narrow to see the file path. Even if I widen it, it comes back to its default size when I open a file.
How can I change the default size? Or for better, how can I prevent it from auto-resizing?

I don't think the rails.vim plugin has a directory viewer -- my best guess would be that you're actually seeing NERDTree's directory viewer.
Try adding this to your ~/.vimrc file to set a custom width:
let g:NERDTreeWinSize=40

Related

Where does Electron save previous zoom?

Electron appears to remember what the zoom factor when restarting the app - where is this saved? I want to be able to reset this.
Thanks!
The zoom factor information for each browser window is memorized in a JSON file named Preferences located in the user data directory accessible through app.getPath ('userData');
If the zoom factor is different from its default value 1.0, it will be listed at the end of the JSON file (after the DevTools settings), associated with the window's URL. You may find the whole relevant syntax quite odd though...
As a user said, you must find Preferences file in C:\Users\<<username>>\AppData\Roaming\<<package name>>. I tried to change zoom value firstly but it didn't work. After I tried to change per_host_zoom_levels to 0 and it works.
So if you want to manipulate zoom from saved file, you must change per_host_zoom_levels.
I'm not sure about this, but could be in:
C:\Users\**<name>**\AppData\Local\Temp
and then in a folder relative of the name of the app.
The file structure should be C:\Users\%YOUR-USER%\AppData\Roaming\%YOUR-APP%\, edit the Preferences file with an editor (I used notepad), look for {per_host_zoom_levels": {"%SOME-NUMBER%":{%HERE%}}}. At the %HERE% part will have the zoom preference, delete the contents to reset and so that {per_host_zoom_levels": {"%SOME-NUMBER%":{}}} remains. Can augment to have different values as well. Hope it helps for future readers!

Using script or Automator to set page settings, margins and page wrap automatically on Text Edit files

I'm putting together an installation using Processing, where users type and their text is printed on a receipt printer.
I've got Processing saving out time-stamped text files to a folder, and a folder action in Automator watching that folder and sending to print.
My problem is that these .txt files need some intervention...
Format > Wrap to page
Change margins
Select 80mm receipt roll in Page Setup
I think I have the margins thing figured out by adding some code to the file header on the Processing side. With the rest, I'm drawing a complete blank.
I've tried setting the receipt roll as the default page size in 'Print and scan' in system prefs, but the receipt page size doesn't show in the list in system prefs, only shows on the page size list from within Text Edit application.
I suppose what I'm asking - is there a way of setting TextEdit's default to page wrap, certain page size, certain printer - then a folder action can just print away (I hope).
The idea is that these text files spit out of the receipt printer automatically with no intervention. Does anyone have any ideas? Thanks in advance.
Have you experimented with the settings available for TextEdit in AppleScript? If you look under the print settings section (in TextEdit's Script dictionary), there are a number of options available, which may help you achieve something pretty close to what you want. You could then drop the AppleScript into a Run AppleScript action in your Automator folder action.
Alternatively, you could go completely nuts and design a template in Pages that meets your criteria, and then extract your text, paste into your Pages template, and print that out. A whole lot more work, but once it became functional, you would only need to change the Pages template in the future to meet changing needs.

How to view html output in Notepad++?

How do I view my Code output in Notepad++ as a webpage or something similiar?
I have built something but I can't find a button or something like that in Notepad to view it as a webpage or something similiar.
If it is a webpage written in html:
just go where you saved it and click it.
If it is in php:
You will need a web server, save the file in the www directory. and access it like this:
http://localhost/yourfile.php
Simply, save your file with the correct extension in this case html, then click run , in the run menu click launch in, (in whichever is your browser) in my case, chrome.And it should work(:
Add this plugin in Notepad++: Preview HTML but it opens only in IE
To setup Notepad++ for testing your markup or code there are a few things to consider.
When Notepad++ launches do you want a test document opened by default?
What language do you prefer the document to be opened as?
What browser do you wish to test your test file in?
Do we want a shortcut to open test in browser?
If you do not have your local environment setup to run server-side scripts you will be limited to what the browser supports.
In my example setup I will be using .php as my language. There are some variables, but I've chosen what I believe best suit my needs. I'm also using a windows machine.
Create a new file in C:\Program Files (x86)\Notepad++ (or wherever) as php.php (or whatever). This will be the document we keep open and will remain open so long as we never close it.
In Notepad++ go to Settings > Preferences > New Document
In the bottom left there is a drop-down. Select your language (php in my case).
Open php.php in Notepad++.
Go to Run > Modify Shortcut / Delete Command and locate your desired browser (note: this may not work as expected in some browsers i.e. Internet Explorer, go figure).
Create a custom shortcut so your document can be launched to test (unless you are happy with what is already setup).
This will effectively keep your default file open in Notepad++ every time it is launched in your preferred language and allow you to quickly test your markup.
Cntrl + Alt + Shift + I(Alphabet if you want to open in Internet explorer)
I hope this will work.

XNA XACT Where do I place the .xap file?

I've been trying and looking on the internet for ages now, but where exactly do you place the .xap file? I've read that you should place the file in your content folder, but I have a content folder located in;
TheGame\TheGameContent\
But I also have;
TheGame\TheGame\bin\x86\Debug\Content
Which is it? If I add the .xap file to the latter it recognises it when I refresh the solution explorer, but the former does not.
However, if I add the .xap to the latter it gives an error saying it can't find it when I use the following line of code to access it;
ae = new AudioEngine(#"Content\game_content\audio\xact\Win\xna xact file.xgs");
This line apparently gets the \x86\debug path.
Any advice?
Thanks
Visual Studio, go to the Solution Explorer and right click the Content solution (i.e. "TheGameContent (Content)") or a folder in that section and select Add > Existing Item... and select the .xap file. If it isn't in there, it will copy the file into TheGame/Content, but it will also make it ready to load and work within your project.
Basically it's the same as adding an image file to an XNA project, and it will save you all that trouble you are having.

Sublime tmLanguage file and sublime-settings file

I have two questions about the Sublime Text Editor 2.
My 1st question is, I have several different .tmLanguage files ( ex: Console.tmLanguage) or .tmbundle (Ex: Handlebars.tmbundle) saved in the Packages/User folder. But it won't detect by the Sublime when the initial loads. If I move them under the Package folder, sublime will see them as a color syntax setting.
I thought everything should store inside the User Folder so that it won't be erased when updates or any other possible overwritten situations. What can I do to make sublime see those file when they are stored inside User folder.
I have moved those file several different locations. When I initialized sublime, I received this error " Error loading syntax file "Packages/User/Console.tmLanguage": Error parsing plist xml: Failed to open file In file "Packages/User/Console.tmLanguage" "
I did research about this error, one of the file maybe use that color setting has been cached. I could not remember that which one is using it. How can I clear all the cache to get rid of this initial loading error?
My 2nd question is, I am sharing the Preferences.sublime-settings file for Windows and Mac via Dropbox. But Mac has high resolution, window has not. Mac need font size of 21 to show the same size on windows( font-size: 14 ). Every time When I sync the setting, I have to switch this value from setting file. So I created two different files, Preferences (OSX).sublime-settings and Preferences (Windows).sublime-settings to hold the font-size setting only. It seems to work on windows, but Mac just ignore that file, no font size is being applied at all. It is so tiny that I could not see. Any ideas how could I fix that?
I solved the 2nd problem (i.e. eliminating display differences) as follows:
Create the Default folder that will "mirror" Default.sublime-package:
Window 7:
%USERPROFILE%\AppData\Roaming\Sublime Text 3\Packages\Default
Mac OS X:
~/Library/Application Support/Sublime Text 3/Packages/Default
Extract two files from Default.sublime-package into this folder:
Preferences (OSX).sublime-settings
Preferences (Windows).sublime-settings
I used the following settings to get the same look and feel on Windows 7/XP and MacBook with Retina:
Windows:
{
"font_face": "Consolas",
"font_size": 11,
"line_padding_top": -1
}
Mac OS X:
{
"font_face": "Consolas",
"font_size": 14,
"line_padding_bottom": -1,
}
According to this post in the Sublime Text forums, you need to remove an existing .tmlanguage file from the /Packages folder AND the .tmlanguage.cache file and relaunch Sublime Text to confirm that the program is no longer reading them. Then you can put your .tmlanguage or .tmbundle file in /Packages/User.
It's not clear to me that the error message you got was indicating a problem with the location and not a problem with the plist file itself. You might try using one of the free plist editors to make sure the structure of the file itself is OK.
Good luck on the Mac/Windows display difference. I have no idea how you might solve that.
For windows delete - Delete all the sublime files from
C:\Users\\AppData\Roaming

Resources