How do I keep formatting when copying from gedit into open office? - formatting

I am editing octave files in gedit, and it does a nice job highlighting them. However, when I try to copy and paste the code into Open Office, it loses all formatting. Even when I try paste > special, it still doesn't work.
Is there any way to do this without having to manually go through all my code highlighting keywords?

The free and open source editor KATE can actually export in HTML Octave's code keeping the correct syntax highlighting.

I had the same problem and I found this very usefull page: http://tohtml.com/
So you don't need to install any other editor or stuff, just copy paste to the page and let it do it.
PS: It seems like the owner likes to sell the domain, so hopefully the project will stay online, otherwise you will find other solutions google: "cpp online syntaxhighlighter"

I don't know if this can be any good, but if you open the script with the MatlabĀ® editor, then you can make copy and paste (paste > special), keeping the Octave syntax highlighting.

If you don't want to install KDE dependencies for run Kate I found a solution that could work until Scite implementation in GNU/Linux (?) haven't got the command "Copy as RTF", take a look here
So let's go:
sudo apt-get install wine synapse
wine: Windows Emulator ;)
synapse: fast application launcher
download notepad++ installer version
go to Downloads, chmod +x executable file (permissions to execute, could do graphically with properties of file, in permissions)
install it! (with default values works)
now you can run it easily with synapse:
if is launched: Ctrl+Space (or Super (windows key)+Space) and type "notepad" (if no appear, press Arrow Down and search it!)
write a text in, for example:
for i=1:3
%comment!
end
and now select it, with right button of mouse "plugin commands > copy text with syntax highlighting"
paste it!
in LibreOffice Writer: be carefull, use Ctrl+Shift+V or Edit>Paste Especial>Formated Text [RTF]
in Abiword works with Ctrl+V

Related

How can I install word font programmatically?

I'm creating a word template for some users, and I need to use "MT Extra" font, which I know is common for all word versions, but I need to be sure that it's installed because at the time of word installation user may choose not to install any font!
So can I add a VBA piece of code to install this font on user's machine, whatever the settings of machine are ?? (32/64 bit or whatever).
It's not so easy...
Have a look here: http://www.codeproject.com/Questions/728740/How-can-I-install-word-font-programmatically-using

How to save as jade file?

I'm trying to use jade, i am currently using sublime text 2, when i go to save my file there is no option to save as a jade file, Do i have to use something that can save as a jade file or can i use sublime and just save the file as file.jade. I seen this answer Syntax highlighting for Jade in Sublime Text 2? but, i am not understand what to do im on windows 8, i have never used github before and i see like 10 things i can click on when i click this link, https://github.com/miksago/jade-tmbundle i think i may rather use something from google chrome, i know they have a editor that supports jade. Anyone know of a good free editor or just something i can use to just save jade files.
Maybe you have to activate "file extensions" to do so, in older windows versions it was disabled on default.
To activate just open your explorer, hit view then, under options, click on folder options or something like that. There you find "Hide file extensions", deactivate this checkbox.
After that you can save files in Sublime in every format you want to, like #henguin1001 mentioned before.
You can just Save As -> then add the extension .jade, or rename your txt file with that extension and there is even a sublime text plugin for jade https://sublime.wbond.net/packages/Jade

Name strOld as strNew not working

I have a macro that renames a file at the end to change a .zip extension back to a .docx extension using the Name command:
Name strOldZip as strNewDocX
If I run this in debug mode, it works. However, whenever I run the macro full speed, it doesn't work quite right. The .docx file gets created, but the .zip file icon remains on the desktop. The Word icon and filename don't appear. So I have an empty icon of the .zip file on my desktop, and a .docx file that I've confirmed isn't hidden, but doesn't appear unless I search for it. (Once I find it in the search, I can drag it into a new folder and then back to get it to show up.)
I've tried making the macro sleep for a while after the name command, but that doesn't work either. I think the hiccup might be in the time Windows needs to change the Desktop icons and display the new name, which is why it works in debug mode. Am I right? And if so, how do I get around this?
Posting as answer from #GSerg's comment above:
"Try making it sleep before, not after."
Worked like a charm. Thanks, GSerg!

Transferring Intellij Live Templates Between Machines

I'm trying to figure out how to transfer the templates in the /.IdeaC10/config/templates/user.xml file to my coworker's machines.
If I copy into the user.xml file, then those changes seem to be getting squashed by Intellij, reverting to the old file contents.
Anyone know how to work around this?
EDIT:
Is there any way to do this by copying and pasting the xml? That would be preferrable...!
Use File | Imprort/Export Settings.
An improved and easier way
This allows you to share them easily between collegues.
You can select multiple live templates and then copy them (right click and select copy, or ctrl+c). This gives you XML-descriptions in your clipboard you can send to others.
Other can then take that XML, and paste it into a "Template Group". Right click one of the groups and select Paste. If the option is greyed out, you didn't select a group but something else.
If you have Settings Repository set you may find your Live Templates stored in
<your_user_home_directory>\
.IntelliJIdea<version>\
config\
settingsRepository\
repository\
templates
the technique of copying and pasting the xml file on another computer in the correct directory, function perfectly for me! But the name of my template file is android.xml for my Android developments. Maybe the file name "user" is protected. Try maybe with a different file name
You need to create the required custom template groups and update the relevant predefined groups as necessary and click OK. Based on these changes, IntelliJ IDEA generates the <group_name>.xml files, see Location of Custom Live Templates Definitions above.
Depending on the operating system you are using, the .xml files are stored at the following locations:
Windows: <your_user_home_directory>.IntelliJ IDEA<version_number>\config\templates
Linux: ~IntelliJ IDEA<version>\config\templates
OS X: ~/Library/Preferences/IntelliJ IDEA<version>/templates
Refer to Intellij Help article.

How to Pretty print VBA code?

How do you copy VBA code into a Word document and retain the VBA editor color scheme?
You can use Notepad++ to accomplish this in three ways. Just so you know, Notepad++ is a more advanced version of Notepad, which supports syntax highlighting of different code files "out of the box" - Visual Basic included!
Download & install it, fire it up, and load up your VBA code. You should automatically see it beautifully coloured (if not, because the file extension is something other than .vb, go to Language -> VB or Language -> V -> VB).
If you need to change any of the colours, you can easily do so - just go to Settings -> Styler Configurator. From that menu, you can change the various highlighting and font options, to suit your needs - although the default usually suffices for most.
Then, go to Plugins -> NppExport. From there, you have three options you can consider:
Directly print from Notepad++
Copy all formats to clipboard
Export to RTF
Export to HTML
The first is self explanatory. The second one - "Copy all formats to clipboard" - will copy the entire file with the highlighted syntax to the clipboard. Once you click it, then open Microsoft Word or your other favourite document editor, and just hit paste! You should see the beautifully syntax-highlighted code. If something goes wrong, then you can try one of the other options (export to RTF/HTML), although I've never had a problem with the clipboard method.
There are two programs on cnet downloads, which are free to try. In case you did not try them, here are the links:
VB-VBA Code Formatter & Printer 2.2
VBAcodePrint 6.13.110
Smart Indenter could be what you're looking for? You'd load the result into Notepad++, set language to VB and save as .rtf/.doc (or print to file, can't remember off the top of my head).
For a more modern approach, Sublime Text users can install ExportHTML from Package Control. This has the added benefit of being able to include the line numbers, and changing the code coloration.
HTML files can be opened directly within Word.
Highlight supports a wide range of Operating Systems and 150+ languages including Visual Basic, although I'm not sure about VBA.
I would recommend this one: planetB
It works well with Internet Explorer (didn't work wit Firefox for me, not sure abt Chrome).
Plus it's online, so no need to install anything (the case of Company/University PC's)
Regards
Wheeliam
The following works with Visual Studio Code:
Start VS Code.
New file.
Copy & Paste the VBA code into the VS Code window.
In the lower right-hand corner, click on "Plain Text" and select "Visual Basic" instead. Note that the code is now syntax-highlighted.
Copy & Paste the formatted code into Word.