YAML Editor. Suggestions? [closed] - editor

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
I am looking for a convenient way to write and edit YAML.
Right now I am using: http://editor.swagger.io/#/
But it is not so convenient because when you have too many lines you are getting lost there.
Suggestions?

You can use Notepad++ it will automatically do identation for you and you can also find out your code lines very easily.I don't whether it supports YAML or not.
Second, You can use Sublime it
Sublime Text 2 also supports YAML files with syntax highlighting and indentation right out of the box. If you have tabs as your default use for indentation in Sublime Text, Jon Thomas over at Coder Wall explains how to fix this. I've copied what he wrote below for your convenience:
Languages like YAML require text to be indented using spaces. Tabs are not allowed. So, if you typically use Sublime Text 2 with tabs as your default indentation, here's how you can force a certain language to always use spaces. I'll use a .yml file as an example, but you can follow the same steps for any file type.
While editing a .yml file in Sublime Text 2, go to the Sublime Text 2 menu. `
Go to Preferences -> Settings - More -> Syntax Specifc` - User
Sublime Text 2
will open a settings file specific to the language you chose to edit settings for. In this case, I'll be editing the YAML.sublime-settings file, which will apply settings to only the YAML syntax language.
Use the following code to set up your indentation settings:
"tab_size": 2,
"translate_tabs_to_spaces": true
3.You can try ORM Designer. It's a visual editor for ERD model with support for import/export to YAML files.

Related

Installshield: Setting the Installdir to an environment variable [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
EDIT:
NO LONGER RELEVANT. Due to difficulties with Installshield including not only this issue but also issues with getting it to build with the project in Visual Studio and its inability to replace one of the old files that needs to be replaced I am now coding an installer in C#. I should have done this earlier because I'd be done by now. Thank you Christopher Painter and Michael Urman for trying to guide me though this issue. Unfortunately I did not get anywhere further with it.
ORIGINAL POST BELOW
Honestly, this has been like pulling teeth. I hope that I'm missing something blatantly obvious. I have been trying to get Installshield to let me set the INSTALLDIR to an environmental variable. This is necessary because of the way the company does things. I know I can set it outside of the installer via a batch file which calls the MSI and passes the folder via an argument, but that solution ended up with an unfriendly MSI. If anyone has any internal solutions please let me know.
Windows Installer has the Environment table that is exposed by InstallShield in the environment view and component | advanced settings | environment view.
Setting Environment Variables
Windows Installer allows you to refer to environment variables using a variant of property notation. I would suggest an approach similar to RobertDickau's, where you use a set-property custom action early to set INSTALLDIR from [%SOMEVAR]. Only run the custom action if INSTALLDIR isn't already defined, so that people can override INSTALLDIR at the command line. Note that this must be run before costing, or you will have to find a different condition and use a set-directory action (like Robert mentions) instead.

Is There A Good Pseudo Code Editor? [duplicate]

This question already has answers here:
Recommendation for Pseudo Code Editor for Development [closed]
(4 answers)
Closed 9 years ago.
I have to create some Pseudo Code but want it too "look good" and consistently formatted. Is there something where it will let me make if statements in Pseudo Code (I know it isn't a real language) so that I keep the same syntax throughout?
I don't want to accidentally start using a slightly different syntax as I go along and hence an editor may help me out.
Notepad++ doesn't support Pseudocode out of the box (nor does any other editor AFAIK), but it does have a syntax highlighting editor which you can use to define syntax highlighting and formatting for Pseudocode.
See also http://www.zoovio.com/image/view/2#!prettyPhoto, where Stewart Venit shows the syntax highlighting he wrote for Notepad++ for one of his books.

code formatter for grails and Groovy? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
I'm currently using a basic text editor to write my grails code. Does anyone know of a program that will automatically format code with indentation similar to indent does for C? I'd rather use a commandline program to do this but can use an IDE to format my code if that's the only option.
Try NetBeans v.6.7 (not the current production release 6.5) with the NetBeans Groovy/Grails plugin enabled. This is a nice clean IDE interface (easier to use than Eclipse IMHO), and you can set it up to integrate with your Grails installation. You can call all your Grails tasks from the IDE, edit your code, test and run your project. Then, if you want to format your code, you just right-click in the code editor and select "Format". Easy!
I am using VIM / GVIM for typing code in Groovy/Grails. it has code formatting, I just need to tell my VIM that groovy and java are similar....
and then press gg = G [enter] (format from top to bottom)
There is a tool recommended in this thread for this purpose. I have not tried it but maybe worth a look.
Here's some instructions on how to get Grails working with NetBeans (couldn't submit the second URL in my last post).
the groovy eclipse plugin does a decent job of formatting groovy code. sts might be smarter about some of the grails code.
You can use npm-groovy-lint for command line, and VsCode Groovy Lint in Visual Studio Code IDE :)
https://www.npmjs.com/package/npm-groovy-lint
https://marketplace.visualstudio.com/items?itemName=NicolasVuillamy.vscode-groovy-lint

Printing code with syntax highlighting? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 months ago.
Improve this question
I have occasion to need to print code (Horrors!!! ;) ), and i was wondering what editor or tool would i use to print that code out with proper formatting and syntax highlighting? If it's important, it will be c# code but ideally the tool will work for as many languages as possible. Can Notepad++ or something handle this?
You can use Vim! It's probably installed already if you're on modern Linux/MacOS and an easy install if not.
:syntax will turn syntax highlighting on and :hardcopy will print it. There's syntax highlighting definitions for many languages out there. The default look is usually optimised for screen display, but you can fix that.
Simply open the file on command line with vim <filename>, type :syntax on<ENTER>, then :hardcopy<ENTER> to print it. Quit Vim with :q!<ENTER>.
There's also the :TOhtml command which will open the current selection as HTML in a new Vim window. Capture the entire document with :%y<ENTER> followed by :TOhtml<ENTER> to open it.
Yes, Notepad++ can certainly print code with syntax highlighting.
Colour printing would obviously be preferable, but on the occasions when I've printed in black and white, the subtle differences in colour [rendered as shades of grey, of course] can be difficult to distinguish.
However, I think a little customisation of the colour schemes should make this less of a problem.
New Answer:
Use TextMate. It prints colored code automatically. There's no setup. Just print. In case previous or newer versions can't do this I'm using TextMate version 2.0.23
Old Answer, and the answer for people who don't have Macs:
Use vim. Its the easiest method to do it in my experience by far, that is, once you know how.
Vim comes pre-installed on Macs, btw. And I know how you special people like colors, so I'm going to make this impatientbusinessman-proof for the benefit of all.
1.) open file
vim filename.m
2.) enable syntax coloration (mine did not have enabled by default)
:syntax on
3.) print
:hardcopy
Vim will choose your system's default printer without asking you so make sure you set that up first.
4.) exit the program (this is actually not a given)
:q
http://pygments.org/ is one option. It supports a ton of languages, and since it's written as a python library, you can script the conversion process however you want.
Visual Studio will, and allows you have a completely separate configuration for printing.
I recently compared the 2 solutions already mentioned : vim & pygments. They both give great results, but there is how you can practically use them quickly:
pygments does not provide direct export to PDF. Hence, the simplest solution I found was to export to HTML and then use wkhtmltopdf. You can combine both operations using the following bash script:
src2pdf () {
local noext="${1%.*}"
pygmentize -O full -o "$noext.html" "$1"
# enabling line wrapping in <pre> blocks
perl -i -wpe '/<style.*>$/&&($_.="pre{white-space:pre-wrap;}\n")' "$noext.html"
wkhtmltopdf "$noext.html" "$noext.pdf"
rm "$noext.html"
}
for vim, it's as simple as this: TERM=xterm-256color vim '+hardcopy >out.ps' +q code.src
I found out that the $TERM environment variable can affect the output colors, so I prefer to set it explicitly.
And finally, you may need to tweak your .vimrc a little:
set printfont=:h9
set printoptions=number:y,left:5pc
The tool called enscript is very much the tool for doing this. It is very powerful, is not tied to an editor nor a language and you can create PDF's with syntax highlighting.
The documentation pretty much says it all.
enscript man page
Under unix you might want to try a2ps. It is flexible and produces nice results.
I while ago I created a household python script that wraps pygments into a small console utility. It works with any language supported by pygments.
Also if you happen to use eclipse, you could simply copy the selected text in the editor and then paste it in a RTF-aware editor like MS Word - it will preserve all the colors, fonts and formatting.
If you have problems with Visual Studio 2012 concerning the highlighted printing an handeling the described problem:
Download and install this Power Tool which implements the color
printing, besides some other features and bug fixes. Works for me!
Solution For Bash Shell
Add this line to ~/.bashrc if you are using UBUNTU
or, to ~/.bash_profile if you are using MAC
If that file does not exists, create it.
alias lprc='vim -me -c ":syntax on" -c ":hardcopy" -c ":q"'
source ~/.bashrc or source ~/.bash_profile
To print colored hello.py just do this:
lprc hello.py instead of lpr hello.py
Use ConTEXT programming editor (which is free). I am using it for both generating .pdf-s with syntax highlighted source code and printing to paper.
There are many ConTEXT syntax highlihting definitions to download and you can make your own highligher file which will BTW be highlighted using the ConTEXT Highlighter Files highlighter definition.
I do it downloading js and css files from
https://prismjs.com/
There are so many 5-7 options to select the theme and language highlighter. Once you select a theme and download the tiny js/css files the next thing you need to do is rename the code file to html, and call the css/js files. Open the html in a browser and print it. Done!
You can also use this in case you've to print with bnw syntax highlighting https://github.com/SGI-CAPP-AT2/code-highlight-n-print

How to copy and paste code without rich text formatting? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I used to often find myself coping a piece of code from a website/Word document etc only to discover that when doing Paste I would end up with the desired code plus some extra HTML tags/text, basically extra formatting information.
To get rid of that extra ballast I would paste the text to the Notepad and then copy it again and then paste to the desired destination.
Pretty recently I discovered a simple and free tool for Windows called PureText that allows me to cut the Notepad step. It basically adds an extra keyboard shortcut e.g WinKey + V that will do the Paste action without formatting; just pure text.
I find it very handy.
I was wondering what approach would you use yourselves? Are they any better/easier to use tools around?
Just to summarize the available options:
Tools
PureText - free tool for Windows
Use AutoHotkey and write your own macro
as suggested by Dean
Browsers
To copy plain text from a browser: Copy As Plain Text or CopyPlainText (suggested by cori) - Firefox extensions
To paste without formatting to a browser (Firefox/Chrome at least): CTRL+⇧ Shift+V on Windows/Linux, see below for Mac OS X.
Other
Under Mac OS X, you can ⇧ Shift+⌥ Alt+⌘ Command+V to paste with the "current" format (Edit -> Paste and Match Style); or ⌘ Command+⇧ Shift+V to paste without formatting (by Kamafeather)
Paste to Notepad (or other text editor), and then copy from Notepad and paste again
For single-line text: paste to any non-rich text field (browser URL, textarea, search/find inputs, etc.)
Please feel free to edit/add new items
Just for reference, under Mac OS X, you can use ⌘ Command+⇧ Shift+V to paste without formatting or with the "current" format.
Note: in some apps it's ⌘ Command+⇧ Shift+⌥ Alt+V (see "Edit" Menu → "Paste and Match Style")
I'm a big fan of Autohotkey.
I defined a 'paste plain text' macro that works in any application. It runs when I press Ctrl+Shift+V and pastes a plain version of whatever is on the clipboard. The nice thing about Autohotkey: you can code things to work the way you want them to work across all applications.
^+v::
; Convert any copied files, HTML, or other formatted text to plain text
Clipboard = %Clipboard%
; Paste by pressing Ctrl+V
SendInput, ^v
return
From websites, using Firefox, I use the CopyPlainText extension.
If you're pasting into Word you can use the Paste Special command.
I have Far.exe as the first item in the start menu.
Richtext in the clipboard ->
ctrl-escape,arrdown,enter,shift-f4,$,enter
shift-insert,ctrl-insert,alt-backspace,
f10,enter
-> plaintext in the clipboard
Pros: no mouse, just blind typing, ends exactly where i was before
Cons: ANSI encoding - international symbols are lost
Luckily, I do not have to do that too often :)
Nice find with your PureText. I had build, before I change keyboard, a key that was running a macro that was copying-pasting-copying in notepad for this task! I'll give a try to your software since I do not have any macro key now :(
I wrote an unpublished java app to monitor the clipboard, replacing items that offered text along with other richer formats, with items only offering the plain text format.
Look for a little clipboard icon that pops up at the end of the material you pasted. Click on this and choose "keep text only".
I use OpenOffice.org and that offers a paste special option, where you can omit the formatting altogether. If you are not bound to MS Word, it's IMO worth a try and it's free :-)
Whenever these plugins and options aren't available I just use my good ol friend notepad. Paste content into notepad where it won't accept the extra formatting and then copy it right back out. Sort of hacky but oh well. It works!
I usually work with Notepad2, all the text I copy from the web are pasted there and then reused, that allows me to clean it (from format and make modifications).
You can download Notepad2 here
If you are using MS Word then try ALT+E, S, U, Enter (Uses the Paste Special)

Resources