Skip to main content

👨🏻‍💻 Useful Shortcuts For Nano While Coding 👨🏻‍💻

GNU Nano is text editor uses the command-line interface. We are unable to use cursor in Nano Text Editor. So, here are some keyboard shortcuts mostly filtered for Coding......

Intro

We can see all shortcuts by pressing CTRL + G which will show help menu. In this help menu, all keyboard shortcuts are present. You can use them at your convenience. But this help menu seems to be very complicated, So I am filtering some commands which are frequently useful for any programmer while coding with Nano.



Shortcuts 

Basic

  • CTRL + G  or   F1   >>>>  Displays help menu
  • CTRL + X  or   F2   >>>>  Close / Exit from Nano
  • CTRL + O  or   F3   >>>>  Write current file to disk

Code Navigation

  • CTRL + F    >>>>  Move forward
  • CTRL + B    >>>>  Move backward
  • CTRL + W   >>>>  Search for string
  • CTRL + P    >>>>  Move to previous line
  • CTRL + N   >>>>  Move to next line
  • CTRL + A   >>>>  Move to beginning of line 
  • CTRL + E   >>>>  Move to end of line 
  • CTRL + Y   >>>>  Move to previous screen
  • CTRL + V   >>>>  Move to next screen
  • CTRL + L   >>>>  Refresh current screen
  • CTRL + Space   >>>>  Move Forward one word

Code Editing

  • ALT + U   >>>>  Undo
  • ALT + E   >>>>  Redo
  • ALT + ^   >>>>  Copy current line
  • CTRL + K   >>>>  Cut current line
  • CTRL + U   >>>>  Paste current line
  • CTRL + C   >>>>  Display position of cursor
  • CTRL + R   >>>>  Insert another file into current file
  • CTRL + I    >>>>  Insert tab at current cursor position 
  • CTRL + M   >>>> Insert new line at current cursor position
  • CTRL + D   >>>>  Delete character under cursor
  • CTRL + H   >>>>  Delete character at the left side of cursor
  • CTRL + T   >>>>   Invoke spell checker

These commands are very useful for navigating & editing the code. If you want to learn more about nano, please check this blog. If you like this post, please share with new aspiring coders/programmers. 

Connect with me on LinkedIn - DHANRAJ CHAVAN

Thank You !!!


Comments

Popular

How to { Compile + Run } a C Program Using Nano

Hello Everyone !!! If you don't have an IDE or Software with you to run your code, then don't worry !!! We have Hulk. Oops !! Sorry that was Tony Stark's dialogue... We have Nano to Compile & Run the program. At the end of this tutorial, you will be able to compile & run a C program using Nano Text Editor on the Terminal. Intro In the previous tutorial, we learned about the basic functions of Nano Text Editor using Command Line. If you haven't seen the previous tut, then click here . I found this feature of running C program with Nano while Code Blocks Software on my Mac was continuously crashing. So, when you don't have any IDE (Integrated Development Environment), you should use Nano. Let's Get Started Let's open up the Terminal. We can use (Ctrl + Alt + T) shortcut to open the terminal. The terminal is a very powerful tool of the operating system. Creating a new file DCs-MacBook-Air:~ Dhanraj$ nano fileName.c Here, ...

NANO | Command Line Text Editor

In this tutorial, you will learn to open, view & edit text files using the "Nano Text Editor" by running amazing commands in the terminal. Index Intro  Why Use Text Editors?  Let's Get Started  Open Text Editor  Create a New File  Open Existing File  Editing The File  Saving The File  Useful Cheats  Final Touch  What's Next?  Intro If you want features like undo/redo, syntax highlighting, line numbers, multiple files at once, replace at all locations, file locking, file backup with simple commands, then definitely you need Nano Text Editor. Nano is quite an old text editor written in C. Text Editor is a program which allows you open, view, edit text files. Text Editors can handle many different programming languages like C, Python, Ruby, HTML, CSS, etc. There are some Softwares like Microsoft Word, Pages, Google Docs. But, we can't use them to code. Text Editors are not IDE (Integrated Development Envi...

int main inside int main()

Hello Everyone!!! In this module, we are going to try one experiment with Recursion. Intro Do you know what happens when we call the main inside main()?? If yes, you are welcome & if no, we are going to try the main inside main() experiment now. Let's Go!!! Code Here, I have used pointer of main & assigned an integer of 7 to it. Finally printed the main. Let's see the output. Output Here we go!! It prints the integer value stored at the address of the "main" pointer. Outro If you like this experiment with recursion, share with your friends & leave your valuable suggestions and reviews below. Thank You!!!