Best code editor for Hugo

Hello there,

I am curious as to what code editors you guys like to use and find works well with Hugo. I am additionally specifically looking for a code editor that allows me to view my filesystem with custom ordering (e.g. if I want a file at the top of a folder, I drag it there, and that’s where it stays even if it starts with z).

My existing editor (microsoft visual studio) and most other ones I have looked at, force me to order my filesystem tree by alphabetised folders first, then by alphabetised files. I find that very difficult when dealing with lots of content (espcially with _index.md files)…What I really want is to display my content files and folders in any order I like…(based on a logical order of my choosing according to the associated content)…

I would be interested in any suggestions or thoughts on what editor people find best? and if anyone could suggest one that fulfills the above desire…

Ps. I have gone to great lengths to hack my content filenames to get them to display in an order that is alphabetised but still in a custom logical order (by prefixing my content files with a number)…but that has led to all kinds of difficulties…

Thanks heaps for any thoughts
John

Have you looked into the explorer.sortOrder setting?

I think he’s actually using Visual Studio not VSCode.

I use VSCode for everything now I was a huge Sublime Text 3 user but VSCode has won me over and the fact is free is even better.

This is something that comes down to user preference really, there is no best anything it’s just what allows you to do your job with the least problems.

1 Like

Same for me. Made the change last year, not going back.

I’ve been using Emacs + Org mode for many years now, and no new editor on the block comes even close :wink:

I made a detailed post on it a while back (and all of that still holds; I still write my posts in Hugo the same way):

The issues you brought up about:

  • setting front-matter specific to directory
  • mass-updating front-matter (not just tags)

are a non-issue with this flow.

Thank you! It’s way out of my comfort zone going to those, but looks interesting, I’ve had a read of the link. I’m only part time at the website thing so not sure I will step too far from home…

Hi guys, thank you for responses…

Yes, I am using visual studio (community edition…not code)…by enlarge, I am very skeptical about any product Microsoft put out free. They like to change things, or screw them up, or just decide, yeah nah, we can’t be stuffed any more… I use visual studio because I am a c# developer, and hugo is just a side project for me…but when familiar with things I stick to em…

I’ve done a bit of google on it. I don’t thing it allows custom ordering. I’ll perhaps install it and mess with it to see if I can make it do what I want, but I’m not sure it’s promising :frowning:

Same here. Just to clarify, Emacs is not a web development specific editor. It’s a timeless, general purpose but super customizable text editor.

1 Like

For Windows 10, Visual Studio Code works fine for this Hugo NOOB.
I also have Command prompt running the server to:

  • Instantly update me with any build errors.
  • Issue GIT commands (after ctrl-c to stop the server)
    When I want to search the directory I use Agent Ransack to target the files I need to copy/paste/modify.
    When I run into issues google will find the issues on discourse.gohugo.io or gohugo.io documentation.
    It’s working so far.
1 Like

I use GitLens VSCode plugin for all my git related tasks and I use VSCodes built in terminal to run multiple terminal windows for hugo server or any other related command line tasks.

I use VIM. It is highly customizable. I can set it to open with the file that I am working on or in the directory that has the files I am working on. I use NERDTree add-in to display the file system in a tab or split window and can display bookmarks to any file or directory I bookmark. I set folding to hide or show various levels of markdown HTML headlines. I set syntax highlighting for markdown with customization. I create custom text completes of any length with the Abolish add-in or I can use the builtin text completion. Vim has spell checking and error highlighting. And Hugo automatically updates the page in the local web server whenever I write a file. It takes work to customize VIM and learn how to use it but once you do, all operations are performed with keyboard shortcuts, no mouse needed. VIM is free, super fast, and I cannot imagine a more efficient workflow.

I use ProWritingAid desktop app for grammar check, style and many other types of writing assistance. It is ten times better than Grammarly. If you Google for a discount code, you can get a lifetime license for $105. ProWritingAid does not currently have a VIM add-in but it does have an API and integration within VIM may be possible. What I do is open a file in VIM and also in the ProWritingAid desktop app. Then locate my writing errors in ProWritingAid, search in Vim for the error and correct the error in VIM. It would be great if someone could use the API to integrate ProWritingAid into VIM.

Missed this thread, only saw it this morning on the Digest mailer.

Instead of VSCode, I use VSCodium - Code but with all the Microsoft telemetry/tracking removed. In use, I’ve even found it to be noticeably quicker than Code, but it still has all the access to the Code plugins and extensions.

Like other users, I find the integrated shell function superb for Hugo use.

5 Likes

This is amazing - it’s notably quicker than VS Code. I just installed via brew (I am on macOS) and installed the VS Code Settings via “Settings Sync” by Shan Khan. Works like a charm. Identically now to VS Code but as I said: Much snappier.

Question: Is this thing updated as well as VS Code? Actual release is 1.28.2

Tnx for this great tip, @dg01d

thanks @dg01d (nice avatar, lol). Added VSCodium to the Reference wiki page.