Live data from Hacker News

GNU nano is my editor of choice

ariadne.space

131–140 of 236 posts

Re: GNU nano is my editor of choice

#131

So I have a question and I'd like to understand if possible. To me programming isn't text editing. Granted, we use text to write most code outside of say Pike but effectively most programming is working with symbols right? Like .subst is meaningless as an operation on a string but .substring(0, 1) is meaningful. So I don't really get the advantage of such, to my mind, rudimentary text editors. At a minimum surely bei…

The advantage is you don't become dependent on an IDE. Ever seen someone who can't write anything without all the IDE aids to fill in code for them?

You should learn how to code in an simple editor and understand how everything is connected, e.g edit -> build -> run.

When you understand that you can start using an IDE. Same as with a calculator or any other advanced tool, i.e learn the basics first.

After that you should of course use the tools available, like an IDE, if it helps you.

Re: GNU nano is my editor of choice

#132
post #40
post #6

The thesis of this post is roughly that nano, when configured, is enough of an editor for the author. Which is totally fine! People should be happy with their tools and not feel pressured by popularity to use what others use (vim, emacs being prime competitors in this case). Alas, nano (and pico before it) have a certain stigma among more "experienced" Unix users that more or less boils down to gatekeeping and snobbe…

Quoted post unavailable.

The fact that you don't know that nano can jump to line numbers calls into question your judgement. (As can notepad.exe for the past two decades or so)

Re: GNU nano is my editor of choice

#133
post #4

I've been a really big fan of Micro[1]. A single binary with excellent out of the box features. Mouse mode, syntax highlighting, tabs etc [1] https://github.com/zyedidia/micro

The only thing that keeps me from using it as my daily editor is the clipboard functionality in WSL (using Windows Terminal). The first problem was clipboard not working at all, after some updates and tweaks (aliasing xclip to a custom bash script) the clipboard worked. The second problem is yet to be resolved: copy/cut and paste ignores new lines, I haven't found a solution ... Any advice is appreciated!

I am in the same boat. Love micro, but the copy/paste newline issue in WSL/Windows Terminal is annoying.

Re: GNU nano is my editor of choice

#134
post #6

The thesis of this post is roughly that nano, when configured, is enough of an editor for the author. Which is totally fine! People should be happy with their tools and not feel pressured by popularity to use what others use (vim, emacs being prime competitors in this case). Alas, nano (and pico before it) have a certain stigma among more "experienced" Unix users that more or less boils down to gatekeeping and snobbe…

This is my favorite comment. You have stated facts which I totally agree with

Learning tools is an investment when you master tools you can achieve so much in short amount of time.

If a person knows his tools pretty well he can get work done faster and I have experienced this by learning vim and forcing my self to use it for writing code. It has improved my workflow significantly

Re: GNU nano is my editor of choice

#135

Earlier quoted context omitted.

I wish vim had the option for CTRL-K/U behavior rather than having to do the unintuitive (to me) visual block.

I think you're referring to multiple cursors? Visual-Multi [0] is an amazing Vim plugin for this with advanced features like searching by regex, alignment by regex, transposition, duplication, auto-numbering, and more. You can ignore the advanced features at first, it's very intuitive: just `C-n` to find the next occurrence of the word or `\\a` to find all, and then whatever editing operation you want like `cfoobar `…

This is not multiple cursors.

Ctrl+k is cut line, similar to yy

Ctrl+u is paste, similar to p

The difference is hitting Ctrl+k five times will put all those lines into a buffer. And Ctrl+u will paste those five lines.

In vim, this is complicated. You could do 'y5' requiring to know/calculate the number of lines in advance. But more often then not you are going into visual mode, selecting everything, then y, then p. This is complicated series of distinct commands.

It's a matter of preference, but I personally prefer Ctrl+k/u of nano over the vi/vim method.

Re: GNU nano is my editor of choice

#136

Earlier quoted context omitted.

for me personally I noticed that using an IDE started to replace my memory in a way and I didn't like it. I noticed that when I program in languages with an IDE environment (Java in my case) I only really slowly picked up what functions were available in a libraries and I started to really dislike this reliance on constantly looking up things. When I just program without autocomplete or for that matter constantly goo…

To be fair my memory has always been terrible. I loathed times tables at school. I still don't really know them. I just feel like if I need to know I'll use a calculator and if there isn't one available I'll have other problems like clean water and food! Having a general sense of 'size of' numbers was enough and I'm pretty good at maths. I get that it impedes memorization but how does that scale to using new librarie…

I know vi very well - but for programming, these days I use JetBrains, which for me is like having an assistant to do all the rote work that doesn’t actually contribute to the task I’m concentrating on.

Manually adding imports is not virtuous. Renaming a function is not virtuous. Searching across files in a project is not virtuous. They are just chores. That’s what we have computers for.

There are plenty of reasons people choose their editors and I fully respect those choices. But after using IDEs like JetBrains and VSCode for the last few years, vi feels like editing a video file using a hex editor.

Re: GNU nano is my editor of choice

#139
Nano is a great little editor, however one thing I have not figured out yet is to achieve a true cross platform .nanorc file when dealing with paths, windows vs posix, things like include directives and backup dir.

Re: GNU nano is my editor of choice

#140

Earlier quoted context omitted.

How is it better than `sudo vi /path/to/file`?

`sudo vi` runs vi as root, which means 1) it won't have your users configurations, and 2) it's probably way the hell over-privileged for what you are trying to do. `sudoedit` (and equivalently `sudo -e`) makes a copy of the file that you can edit and then copies it back as root iff it's changed.

Thanks!
Post reply on HN