Page 1 of 1

Source Code Viewer

Posted: 22 Dec 2024 17:35
by Walrez
Hi,
I apologize if this has been asked, I tried searching.
I'd like a viewer that displays code with syntax highlighting, that can be used from xyplorer.
I couldn't find any external utility (I remember there were many years ago). I prefer portable.
If anyone can give a recommendation I'd be very grateful.
Thanks in advance

Re: Source Code Viewer

Posted: 22 Dec 2024 18:53
by Horst
I use the fine free Delphi-Preview-Handler from
https://github.com/RRUZ/delphi-preview-handler
It's installed on the OS level and not portable
but allows previews and more in Explorer, XY and Everything for me.
It can be registered for more file types than its default.

If you really need a portable viewer, why not using one of the many free editors
with Syntax highlighting, like AkelPad or PSPad.

Re: Source Code Viewer

Posted: 22 Dec 2024 19:59
by eil
Just for an option, i use Notepad++ for highlight, and AkelPad for ability to show 4 parts of code simultaneously(which nobody else can, for pity).

Re: Source Code Viewer

Posted: 22 Dec 2024 21:02
by WirlyWirly
eil wrote: 22 Dec 2024 19:59 ...AkelPad for ability to show 4 parts of code simultaneously...
Who still writes code with only 4 parts at once? :lol:
2024-12-22_11-58-41.png
2024-12-22_11-58-41.png (1.36 MiB) Viewed 1235 times
In all seriousness, that Delphi-Preview-Handler is great, a nice quality-of-life for my home pc. Thanks Horst! :beer:

Re: Source Code Viewer

Posted: 23 Dec 2024 11:14
by Walrez
Horst wrote: 22 Dec 2024 18:53 If you really need a portable viewer, why not using one of the many free editors
with Syntax highlighting, like AkelPad or PSPad.
I prefer not to use an editor for viewing, but in the end I settled with notepad++ with a command line switch that allows opening in read-only.

"C:\Tools\npp\notepad++.exe" -ro -nosession

The nosession switch is also nice, because it opens the file alone, without saved tabs from previous sessions.
After closing the viewed file, if opening npp again it will restore the previous opened tabs from a previous editing session (but also the one that was just viewed, for some reason).

I assigned it to a user command and a keyboard shortcut.

I'll try your suggestion as well, thanks!

Re: Source Code Viewer

Posted: 23 Dec 2024 11:56
by eil
WirlyWirly wrote: 22 Dec 2024 21:02 Who still writes code with only 4 parts at once? :lol:
Looks interesting, heard the name but didn't know it can do that.
Shame it isn't user-friendly, even trying to configure it is already a task.

Re: Source Code Viewer

Posted: 23 Dec 2024 19:36
by WirlyWirly
eil wrote: 23 Dec 2024 11:56Looks interesting, heard the name but didn't know it can do that.
Shame it isn't user-friendly, even trying to configure it is already a task.
There is definitely a learning curve, and no vim is not known for being user-friendly, at-least not at first, which is why most people are turned away from it.

If you're looking to get started, there is gVim (which I've never used) or my preferred option; using vim in a terminal such as GitBash or WindowsSubsystemLinux (wsl).

You can simply enter vimtutor in the terminal and you'll get a quick interactive intro on the basics of using vim. Keep in mind that being able to touch-type everything on your keyboard (including the number-row and symbols) is kind of a prerequisite, otherwise you likely won't be able to fully utilize the editor nor enjoy the experience.

After going through vimtutor, you can start editing right-away, but if you really want to jump-start your productivity, I recommend the book, "Practical Vim: Edit Text at the Speed of Thought" by Drew Neil. It picks-up right where vimtutor leaves off, saving you years of fumbling around on your own.

Re: Source Code Viewer

Posted: 27 Dec 2024 18:39
by eil
WirlyWirly wrote: 23 Dec 2024 19:36 If you're looking to get started, there is gVim
I actually tried it first hand, and it has issue of not showing what options are enabled(which is frustrating). Nevertheless thank you for all the hints.