Nano has had that capability from day one (1999), when it was a clone of pico (which also had that capability since the early 90s).
Position the cursor where you want the text region to begin, then hit Ctrl-6 (this is the default shortcut for the 'Mark Set' command). Then use the arrow keys to move the cursor to the end of the text region you want. Use Ctrl-k to cut the region, or use Esc-6 to copy the region. You can then use Ctrl-u to paste that region anywhere you want.
If you put 'set mouse' in your ~/.nanorc, then you could also use the mouse in your terminal (via gpm if you're in a console, otherwise in X) to set the mark by double-clicking where you want the region to begin.
All this is explained in Sections 4.3 and 4.4 of the nano manual.
> Always
I remember a time where this wasn't true so I had to look it up.
Pico does not have syntax highligting.
Nano introduced syntax highlighting at the end of 2001 for v1.1.4. ChangeLog
>Who are David Ramsey (the author of this missive), and Benno?
https://www.nano-editor.org/who.php
The other two are probably people who want or wanted to contribute to the development of nano.
>Does nano offer the same features as vi
No. However, Nano offers significantly more functions than those displayed in the bottom line (https://www.nano-editor.org/dist/latest/cheatsheet.html and https://www.nano-editor.org/dist/latest/nanorc.5.html).
>or should I really replace it with vi?
I your are satisfied with nano, why switch? Instead of nano, you can take a look at micro. This editor has more features than nano (but less than vim).
>How can I start to like it?
I could have been asking myself that question for about 20 years. But for me personally the answer is "not at all". Therefore I simply use an editor that suits me more. The world will not end if you don't use vim.
> You can work around this problem with sshfs, for example.
Only sometimes.
I access quite a lot of systems over serial connection. SSHFS obviously cannot work there, the only option I have is to use console applications.
> You should have a look at the documentation of nano. Nano offers much more than what is shown in the bottom bar. https://www.nano-editor.org/dist/latest/cheatsheet.html and https://www.nano-editor.org/dist/latest/nanorc.5.html for example.
Sure. In facts, nano is my console editor of choice, I do use some of its less known features.
But it is not even comparable with vim or emacs.
> What's to substantiate? Nano is woefully lacking in features compared to other editors.
Which one do you think that would be? Because what is displayed at the bottom of the screen on nano are only the most used functions. The functional range of nano is much more extensive (https://www.nano-editor.org/dist/latest/cheatsheet.html and https://www.nano-editor.org/dist/latest/nanorc.5.html).
Apart from that, why is an editor terrible if it has fewer functions than other editors? Not everyone needs countless functions. Many users probably only edit their configuration files from time to time by commenting on certain lines or changing certain entries from "false" to "true". You really don't need an editor with 2000 functions for this. Nano or Micro would suffice for such cases.
>You may get by with it sure, but you will be more productive if you use more powerful tools.
How would you know that? Take vim for example. After countless attempts to learn vim, I have decided that I cannot remember how to use it. For one thing because I edit files too rarely and too irregularly. And secondly because vim would be the only program on my computers to be operated this way. For all other programs I can use the widely used shortcuts like Ctrl + S etc. So experience has shown that I am faster with any editor than with vim in what I do.
And yes, there are use cases where the use of vim can be useful. For example, when you regularly make larger and more complex changes to files. But not everyone does that. So you can't say nano is generally terrible. Just as I, as someone who doesn't like vim, would not say vim is generally terrible. Vim is just not suitable for me. Or I'm not suitable for vim.
As someone else pointed out, ctrl+S already saves in nano, it just doesn't exit. It also has all shortcuts clearly labelled at the bottom so new users can just follow the steps listed there. There's more that aren't shown explicitly, but you can see a list here: https://www.nano-editor.org/dist/latest/cheatsheet.html
>Me, who used nano 6.1 yesterday: what are you talking about?
Are you sure you were using GNU nano and not some fork by some random person?
Do check once because it could be a potential security risk
Their news site does not mention 6.1
Those files are created by your editor (nano) when it crashes.
Nginx reads all files in sites-enabled so obviously this crashed file will be read too.
You can avoid this problem by properly exiting nano (no idea what you're doing for it to crash but you're doing something). Or you can edit files in sites-available instead (the proper way to use these folders is to put files in sites-available and put symlinks to them in sites-enabled).
Nano is actually a bad example, since nano offers significantly more functions than most people think.
https://www.nano-editor.org/dist/latest/cheatsheet.html https://www.nano-editor.org/dist/latest/nano.html https://www.nano-editor.org/dist/latest/nanorc.5.html
The problem with many pros is that they don't seem to read documentation. If they would, they would notice that nano offers much more features than those listed in the bar.
https://www.nano-editor.org/dist/latest/cheatsheet.html https://www.nano-editor.org/dist/latest/nano.html https://www.nano-editor.org/dist/latest/nanorc.5.html
GNU/Linux distributions normally do not need a lot of RAM. You can reduce the PCs memory footprint by switching to a non-IDE like nano. I have been using a 10 year old corebooted Thinkpad X230 and it runs very well for the activity you just described. I got it from https://mostlyharmless.io who will soon be stocking T440p Thinkpads.
Why not? This editor offers significantly more functions than those displayed at the bottom of the screen. For example, https://www.nano-editor.org/dist/latest/cheatsheet.html or https://www.nano-editor.org/dist/latest/nanorc.5.html.
For more info on configuring nano, check out the nanorc man page:
https://www.nano-editor.org/dist/latest/nanorc.5.html
This lets you define config details like that to be set by default.
As for command-line math, bc is the mother of all cli math commands. It isn't quite as simple as your example, but it is capable of basically any arithmetic you could ever want.
Matter of opinion. Nano is easier to use (especially for people who only edit files from time to time). And the functionality of nano, which goes well beyond what is displayed at the bottom of the screen, should be absolutely sufficient for many users (https://www.nano-editor.org/dist/latest/cheatsheet.html https://www.nano-editor.org/dist/latest/nanorc.5.html).
> Just for the hell of it, I compiled the oldest version of Nano hosted there, 0.7.4 that will be 22 years old next month and it still compiles. > > So much simplicity in 2,682 SLOCs of ANSI C.
And so fewer features.
> Nano 6.0 has 62,421 SLOCs of ANSI C. > > Any worth while features in the past 22 years that justifies a 23x increase in code density?
Unicode support is a big one. Not all world speaks English. Actually, a rather small part of the world speaks English, the vast majority needs Unicode.
Aside from that, many more features were added over time. Syntax highlighting, user-level configuration, spell checking, undo/redo support, regular expressions...
https://www.nano-editor.org/history.php
Just on this page, there are several improvements that I think are useful and that version 0.7.4 does not offer. Therefore, yes we need new versions. But with "we" not everyone is meant. If version 0.7.4 is enough for you, just use this version. Whereby I am not sure if security vulnerabilities have not been closed in the meantime. Torvalds for example uses the editor MicroEMACS as far as I know whose last version was published in 1996.
> Sometimes you do not have a graphical interface, so you need to use one of those
You can work around this problem with sshfs, for example.
>Some of these editors have advanced features (nano not so much
You should have a look at the documentation of nano. Nano offers much more than what is shown in the bottom bar. https://www.nano-editor.org/dist/latest/cheatsheet.html and https://www.nano-editor.org/dist/latest/nanorc.5.html for example.
> learning the basics of vim is useful, since some programs require you to use it,
Do you have a few examples? Spontaneously, I can't think of any tool that actually requires vim.
Tools like visudo use vim by default, but you can use EDITOR=/usr/bin/nano visudo
to specify a different editor.
>I usually use micro, which is like nano, but has syntax highlighting
Nano also has syntax highlighting. However, that of micro is better.
https://www.nano-editor.org/dist/latest/nano.html#Syntax-Highlighting
They're all the legend for shortcuts, Ctrl being the symbol for ^. See these & correlate: https://www.nano-editor.org/dist/latest/cheatsheet.html
Also, consider learning Vim too, that's what the big girls use. :)
> nano is shit
Why do you think nano is shit? The editor may have fewer functions than vim but it has many more than those shown in the line at the bottom of the screen (for example https://www.nano-editor.org/dist/latest/cheatsheet.html or https://www.nano-editor.org/dist/latest/nanorc.5.html).
Then your terminal editor probably overwrites the shortcuts of nano. One solution would be to change the shortcuts of nano (https://www.nano-editor.org/dist/latest/nanorc.5.html#REBINDING%20KEYS) or those of the terminal emulator.
Why should that not be possible with nano? The editor offers many more functions than those displayed at the bottom of the screen. For example, https://www.nano-editor.org/dist/latest/cheatsheet.html and https://www.nano-editor.org/dist/latest/nano.html.
Edit your bashrc or create it with:
nano .nanorc
The line you want to have is set line numbers, but here's a couple useful settings I have set up.
Alt+N will toggle line numbers if you haven't set up a .nanorc
set tabsize 4 set tabstospaces set autoindent set smooth set morespace set linenumbers
Here is a nice online man page for nano
I've used Nano for nearly 20 years and I find it to be just right for me. You will find lot's of 'l33t' nix folk who say just use Vim or Emacs, but ignore them and use what ever you feel comfortable with.
Of course everyone can and should try it out. And whoever likes vim should use vim. Just like I would like to have the possibility not to use vim.
But what I don't understand is why some users of vim have to missionize in some way. In every thread under /r/linux that talks about a different editor, you can assume that sooner rather than later you will be able to read comments like "why not vim?", "nano is an editor with support wheels", "you are only productive with vim" or "vim is installed everywhere" (which doesn't matter if you only work with your own computers). Why?
I don't know this behavior from users of other editors. For example, I use micro in the terminal emulator, because there the common shortcuts like "Ctrl+S" work and because the range of functions is enough for me. It would never occur to me to make a sweeping comment like "why not micro?" in a thread about vim. Or I wouldn't try to convince a satisfied user of vim to use micro either. Usually I only react to the nonsense some users spread (for example that nano has only a few functions. Apparently most people don't even know that nano only lists the most important commands in the bottom bar and that nano has a much larger range of functions (for example https://www.nano-editor.org/dist/latest/cheatsheet.html and https://www.nano-editor.org/dist/latest/nanorc.5.html)).
What speaks against nano on your own computers? The editor offers considerably more functions than those displayed in the bottom bar (for example https://www.nano-editor.org/dist/latest/cheatsheet.html).
Why? Firstly, nano offers significantly more functions than those displayed in the line at the bottom of the screen (for example https://www.nano-editor.org/dist/latest/cheatsheet.html). And why should I be more efficient with vim? I am familiar with nano, micro, and sublime text, and I rarely change files. And when I do, these are mostly minor changes. With vim I would not be more efficient in any way, because the handling is too different. Since I change files irregularly, I hardly remember any vim shortcuts. Spontaneously I can only think of :wq!
>I'm unable to do with nano most of the things I do in vim.
What would this be, for example? Nano should not be underestimated, as the editor offers considerably more functions than those displayed in the bottom line (for example https://www.nano-editor.org/dist/latest/cheatsheet.html)
Except nano does have a configuration file. You can use it to rebind keys, enable syntax highlighting, enable mouse support, and set other nice features. Nano is more powerful than most of us give it credit for.
Though perhaps not as much as something like Vim, nano is surprisingly powerful. A quick read through its documentation will reveal a lot of hidden features, including mouse support.
>Out of the box I think it's weak
Even without adjustments, nano is by no means to be underestimated. Many people think that nano only offers the functions that are displayed at the bottom of the screen. But these are only the most used functions. Nano offers much more (for example https://www.nano-editor.org/dist/latest/cheatsheet.html).
>Any thoughts?
The best editor is the one that suits you the most.
> vim has uncountably more features and is extensible
But one should ask oneself whether one needs the functionality at all. In addition, nano, for example, has considerably more functions than many people think. The bar at the edge of the screen shows only the most important functions. If one reads the documentation (e.g. https://www.nano-editor.org/dist/latest/cheatsheet.html and https://www.nano-editor.org/dist/latest/nanorc.5.html), one will quickly notice that nano does have some functions.
For my part, I decided a long time ago that I don't need the countless functions of vim. Therefore I prefer to use alternatives with less different usage. So currently micro.
uname -r
nano -V
wget https://www.nano-editor.org/dist/v4/nano-4.5.tar.gz
tar xvzf nano-4.5.tar.gz
cd nano-4.5
./configure
make
sudo make install
nano
I wouldn't call nano or micro a basic editor. Both have a range of functions that should not be underestimated. With nano, for example, only the most important commands are displayed in the lower bar. In fact, there are some more functions (for example https://www.nano-editor.org/dist/latest/cheatsheet.html). And micro should have a few more functions.
Regarding Mirco there is a restructuring for version 2.0. I'm already looking forward to it.
> If all you need is to add a line to a file nano is fine, but it's not realistically suitable for anything else.
How many times have you really used nano? Apparently not often yet. The editor offers more functions than those mentioned in the bar at the bottom of the screen.
> Using nano just means you might be losing some productivity.
Depends. Why should one generally be more productive with vim? Not everyone has to do tasks like "delete every third word in every second line if it starts with an and". And nano offers significantly more functions than those mentioned in the line at the bottom of the screen (https://www.nano-editor.org/dist/latest/cheatsheet.html https://www.nano-editor.org/dist/latest/nano.html).
According to the Comparison of Text Editors article on wikipedia it does, but I'm having a hard time finding any instructions on how. Though the man page says it has basic abilities to move around the file system, so that combined with the command you listed might be what the wikipedia contributors were referring to.
> nano = A simple text editor.
Nano is not that simple. It doesn't have the functionality of vim but it has much more features than the ones listed in the lower bar.
>The more I see people use vim/emacs, the more I realize how much easier life would be if I was familiar with these programs.
What makes you think so?
>Which one should I learn?
Use the tools you like. Not the tools that others like. For example, were there things you couldn't do with nano so far? If no, then I would stay with nano. Especially since the editor offers significantly more functions than those shown in the bar.
https://www.nano-editor.org/dist/latest/cheatsheet.html https://www.nano-editor.org/dist/latest/nano.html
oh, another nano user in the wild.\ have you tried playing around with the .nanorc yet? there are actually some cool settings that can be changed to make it better than the default config (like line numbers, which I personally love, or making the top bar colors match the rest of the text).
Sorry if this is a silly question. Docs say that
> Valid names for the foreground and background colors are: white, black, blue, green, red, cyan, yellow, magenta, and normal -- where normal means the default foreground or background color. The name of the foreground color may be prefixed with bright.
I see you use Monokai palette. How did you achieve that?
In Gentoo Linux, 2.9 is the standard.
zeta /home/xxx # eix -I nano [I] app-editors/nano Available versions: 2.9.8 ~3.1 ~3.2 **9999 {debug justify +magic minimal ncurses nls slang +spell static unicode} Installed versions: 2.9.8(10:18:53 AM 02/23/2019)(magic ncurses nls spell unicode -debug -justify -minimal -slang -static) Homepage: https://www.nano-editor.org/ https://wiki.gentoo.org/wiki/Nano/Basics_Guide Description: GNU GPL'd Pico clone with more functionality
zeta /home/xxx #
If you're a new student in CS/SE next year, you'll be taking a new course called CIS1300 which is meant for CS/SE majors. Nano or Notepad++ will be good for either one, and you can customize some setting in nano with a .nanorc file. If you are not a CS/SE major, then nano will be more than enough for CIS1500.
read all please.
important parts about $PATH;
type
echo $PATH
or
env | grep PATH
in terminal, you'll get the same output from either; /bin and /usr/bin
if you
sudo echo $PATH
you see more directories.
when you see
user@computer:~$
and type
user@computer:~$ firefox
it looks for an executable in /bin and /usr/bin
You can add directories to $PATH, im assuming your using bash as your terminal;
RootFury@reddit:~$ echo "export PATH=$PATH:/path/to/dir" >> /home/RootFURY/.bash_profile
export PATH=$PATH:/path/to/dir, change /path/to/dir to /home/RootFury/"Firestorm Viewer directory"
/home/RootFURY/.bash_profile, replace RootFury with your user name
RootFury@reddit:~$ echo "export PATH=$PATH:/path/to/dir" >> /home/RootFURY/.bash_profile
Dissassembled in parts because you shouldn't be blind going in;
RootFury@reddit = user@computername
:~$ = current directory is /home/user, $ = logged in with non elevated privileges. if you sudo, $ will become a #
echo means repeat the following
>> tells the echo to be append to the end of /home/RootFURY/.bash_profile file.
if you accidentally type a single >, it will overwrite the file.
MUCH EASIER OPTION FOR YOU, PROBABLY
you could also
RootFury@reddit:~$nano /home/RootFURY/.bash_profile
nano is like notepad, but in terminal, w/no mouse
and add
export PATH=$PATH:/path/to/dir
as the last line