Skip to content

Instantly share code, notes, and snippets.

@w3dg
Created June 6, 2024 15:35
Show Gist options
  • Select an option

  • Save w3dg/c0a5e1ad34230287e9605a3401521503 to your computer and use it in GitHub Desktop.

Select an option

Save w3dg/c0a5e1ad34230287e9605a3401521503 to your computer and use it in GitHub Desktop.
Text editing and keyboard shortcuts for keyboard junkies. Ditch the mouse!

Text editors

  • Can be as plain and simple and as high tech as you want
  • Some sane first time recommendations

GUI

  • Sublime Text - subl <filename> or subl <directoryname from the terminal will open the file up. However, use the GUI to do everything from open/creating the file if you want to.
  • VSCode - code <filename> or code <directoryname from the terminal will get you in VScode
  • Gedit (Gnome Edit on Linux, comes by default on flagship Ubuntu). Install sudo apt install gedit. Open a file, gedit <filename>. If that doesnt work, as the gedit command is not found, try to use gnome-text-editor <filename> or the shorter version gted <filename.

Terminal

  • nano - GNU Nano. https://nano-editor.org/ or the actual way, look at the man pages! man nano. To open a file using nano (yes you see a pattern from the above now) nano <filename>
  • micro - https://micro-editor.github.io/ "a modern and intuitive terminal-based text editor". Another very easy to use and modern terminal friendly with scrolling, copy pasting and more capabilities! My go to! To use it, micro <filename>
  • vim - For beginners, it may have a steep learning curve. All you really need to know if you "accidentally" open vim or get into vim as a part of some other process as the default text editor, [Esc] :wq will quit out from vim while saving changes. [Esc] :q! to exit without saving changes. Now vim is a very powerful text editor, I am not throwing a ny shade or saying its bad. As a total beginner, you might not even be able to exit if you are dropped into vim without absolutely knowing anything. Heres another small cheatsheet :) https://gist.github.com/w3cj/16bd4c9514a5522298f8
  • If you now really want to go into Vim and use it for absolutely everything, go for it at your own pace! vimtutor and the internet, will be your friend.

Keyboard shortcuts while editing, Get Around FASTER

MacOS keyboard shortcuts were taken from https://gist.github.com/w3cj/022081eda22081b82c52

These keyboard shortcuts will work in most, if not all text editing places in macOS. (Form input, text editors, web browsers etc.) These keyboard shortcuts will also work on Windows (replace CMD with CTRL).

Jump Over Words

ALT + Left/Right

Go to end of line

CMD + Right

Go to beginning of line

CMD + Left

Go to the top of a file

CMD + Up

Go to the bottom of a file

CMD + Down

Select by Word

SHIFT + ALT + Left/Right

Select the rest of a line from current cursor

SHIFT + CMD + Left/Right

Select everything above/below the current cursor

SHIFT + CMD + Up/Down

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment