Best Useful Shortcuts for any Programmer:)




Depending on the code editor or IDE you're using (such as Visual Studio Code, Sublime Text, Atom, etc.), these helpful keyboard shortcuts can help you explore code more quickly and automate operations. I'll concentrate on a few popular code editing shortcuts that may work for you while rearranging lines and performing other typical operations.

1. How to move a line of code up and down?

  • Visual Studio Code (VSCode) / Sublime Text / Atom:
    • Move a line up: Alt + ↑ (Windows/Linux) or Option + ↑ (Mac)
    • Move a line down: Alt + ↓ (Windows/Linux) or Option + ↓ (Mac)
Using this short we can directly move the current line of code up and down

2. How to duplicate the present line ?

  • VSCode / Sublime Text / Atom:
    • Duplicate the current line: Ctrl + D (Windows/Linux) or Cmd + D (Mac)

By using this shortcut we can duplicate the present line of code just below the current line 

3. How to directly comment the present line in any programming language?

  • VSCode / Sublime Text / Atom:
    • Comment/Uncomment a line: Ctrl + / (Windows/Linux) or Cmd + / (Mac)

This shortcut is super useful and i personally prefer using this shortcut and this is one of the most used shortcut for me

4. How to go the certain line directly? 

  • VSCode / Sublime Text / Atom:
    • Go to a specific line: Ctrl + G (Windows/Linux) or Cmd + G (Mac)

Using this shortcut we can directly navigate to the specific line of code 

5. How to select the entire line ?

  • VSCode / Sublime Text / Atom:
    • Select the entire line: Ctrl + L (Windows/Linux) or Cmd + L (Mac)

This shortcut selects the entire line of code .Hope you are liking my Blog 


7. Auto Format the Code:

  • Shift + Alt + F (Windows/Linux) or Shift + Cmd + F (Mac) is the auto format code.
    This automatically styles your code using the language's or editor's default style conventions (such appropriate spacing and indentation).

8. Rename Variable or Function:

  • F2 is the rename symbol for Windows, Linux, and Mac.
    This enables you to immediately update all instances of a variable or function in your code and swiftly rename it.

9. Split the Editor Window:

  • Use Ctrl + \ (Windows/Linux) or Cmd + \ (Mac) to split the editor.
    By doing this, you can view and work with two files side by side in the editing window.

10. How to Directly Search and Replace the text?

    • Search: Ctrl + F (Windows/Linux) or Cmd + F (Mac)
    • Search and replace: Ctrl + H (Windows/Linux) or Cmd + H (Mac)

This is the super useful shortcut when our code becomes vast and we want to change somthing!

11. How to Jump Between Open Files in The IDE?:


    • Cycle through open files: Ctrl + Tab (Windows/Linux) or Cmd + Tab (Mac)

We can directly navigate between the files using this shortcut

11. How to Show/Hide the Terminal?:


    • Show/hide terminal: Ctrl + ~ (Windows/Linux) or Cmd + ~ (Mac)
This shortcut will help you to open and close the terminal directly using shortcut

Thanks for reading my Blog!!!:)