239

If you don't already have a .vimrc file in your home directory, create one using this: vim ~/.vimrc Add this line to the top of the file: set nocompatible Save the file and this should fix the problem for you. :)


218

Just simply run select-editor, this will let you choose any editor you want.


184

For short files: cat <path/your_file> directly shows a text file in the terminal. For longer files: less <path/your_file> lets you scroll and search (/ text to search Enter) in the file; press q to exit. e.g. cat /home/john/RESULTS.txt less /home/john/RESULTS.txt


126

These instructions assume that you have installed Sublime Text 3 using the .deb file provided for Ubuntu. If you downloaded the tarball and installed it manually, you will need to change the paths below to your install location. First, make sure that /usr/share/applications/sublime_text.desktop exists (sublime-text.desktop on some systems): ls /usr/share/...


98

Installing the vim package will fix the problem: sudo apt-get install vim There are many good vim/vi tutorials on YouTube, or the web generally. For your problem, see the article 8 Essential Vim Editor Navigation Fundamentals. Then continue to open files as usual: vi desired-file


77

xxd This tool is the most commonly available I have found for this type of task (available by default on both latest Ubuntu and macOS). You can remove the ascii readable part on the right if needed using -p and you can revert (change ascii input to binary data) using the -r function. Here are some simple example uses: Converting to hex with ascii view: ...


76

Actually you can install Notepad++ by installing wine first: sudo apt-get update; sudo apt-get install wine But some good alternatives are: Vim Emacs Geany kate (in KDE, running in unity with the installation of the proper KDE dependences) Sublime (free, unlimited trial version/ or $70.00 US Dollars) GEdit Komodo Edit (in KDE) Editra Of these, Geany ...


70

Thanks to the work of Daniel Di Sardi there is an editor inspired to Notepad++ for Linux: Notepadqq is a Notepad++-like editor for the Linux desktop. It has a nice PPA (the home page says it's for 14.04, but the launchpad has versions from Utopic to Xenial), so you can install easily by sudo add-apt-repository ppa:notepadqq-team/notepadqq sudo apt-get ...


65

That's ed By default its prompt is the empty string. If you want to quit, just enter q. Don't prefix with :. If you have unsaved changes, it will reply with ?. You can interpret that as "are you sure?", and confirm by commanding q again. By the way any command it doesn't understand will also cause it to reply ?. That's the only error message it knows. Its ...


56

If you want a text editor, there is no such a thing as bold. Plain text is plain text. The bold, italic, colored thing you see in a programming editor like gedit, geany, kate, etc. is syntactic highlight, added by the editor to facilitate the reading and writing of programs or whatever --- it is not stored with the text. Now, you can leverage this to see ...


50

So, vim.basic is just plain vanilla Vim (as you can check with apt-file vim.basic or dpkg -S /usr/bin/vim.basic). While vim.tiny, as the name implies, is a trimmed-down version of Vim (this question explains it further). Kudos for @terdon at comments for sorting that out.


43

I think Answers by Muzaffar and Terrance serves your need. One thing to note is that you can install any of these text editors in any flavors. GUI Text Editors Gedit Default in: Ubuntu Unity Ubuntu Gnome Ubuntu Kylin Ubuntu Budgie Gedit is certainly the most famous text editor in the Ubuntu world. Gedit is also available for Windows and MacOS. To ...


43

Don't use a text editor for viewing text. There are better tools: View files with less (Scroll with Space, End, Home, PageUp, PageDown; Search with "/something" ; Leave with q). From less manual: Less does not have to read the entire input file before starting, so with large input files it starts up faster than text editors like vi (1). Usage: less ...


39

Try joe. I just used it to edit a ~5G SQL dump file. It took about a minute to open the file and a few minutes to save it, with very little use of swap (on a system with 4G RAM).


39

How to find out what this editor is Press Ctrl+Z. This suspends the editor and gives you a shell prompt. At the prompt, run ps to see what processes are running in this terminal. bash-4.3$ crontab -e 1077 ^Z [1]+ Stopped crontab -e bash-4.3$ ps PID TTY TIME CMD 26295 pts/10 00:00:00 bash 26297 pts/10 00:00:00 crontab 26298 ...


34

Another alternative is vim. vim RESULTS.txt Once you opened a file with vim you can insert text by typing i, for instance. If you want to save your file use :w (write) or :q (quit) or :wq (for write and quit) or :q! (quit and do not save). Sometimes you need to hit the ESC key to be able to type the commands. Vim requires some learning, but is widely ...


34

There is also DHEX apt-cache show dhex ncurses based hex editor with diff mode This is more than just another hex editor: It includes a diff mode, which can be used to easily and conveniently compare two binary files. Since it is based on ncurses and is themeable, it can run on any number of systems and scenarios. With its utilization of ...


33

It is actually possible to install Notepad++ on Ubuntu. Just run the following commands: sudo apt-get update sudo apt-get install wine Then, download the Notepad++ Windows installer, right click it, and select Open With -> Wine Windows Program Loader. Follow the typical installation process and you should be able to open Notepad++ from your Dash.


33

Option 1: use vim, emacs, geany, and many more! In vim and use :!bash file.sh or just create a shortcut for it in .vimrc In Emacs, you use M-!. So you hold down Alt and then press !. You can even pass text in your current buffer to a command by selecting what you want to pass to a command and then pressing M-|. So you can highlight your code and pass it to ...


30

Flavors of Ubuntu can change all the time and so can the default GUI editors. Instead of trying to remember all the default GUI editors of each distro, as long as the xdg-utils are installed you can run a simple command of xdg-open so you know what the default editor is and can launch it editing a text file: xdg-open /path/to/textfile xdg-open can also ...


27

The stream editor,sed, is a powerful utility for this kind of work and is my first choice, however, if you want to do this from an ordinary text editor using an Ubuntu based native application, I would suggest you take a look at Jedit, It is available in the repositories and can be installed by typing in your console: sudo apt-get install jedit Start ...


27

With vi, when clicking on i you activate the command to Insert text. This command allows you to insert text in your file. And right, when clicking : on ↑ it will insert a "A", on ↓ it will insert a "B", ... Till you deactivate this command. To deactivate a command in vi : just click on Esc And then you will get back normal use of your arrow keys: ↑ to go ...


27

Run sudo update-alternatives --config editor and choose for vim. After this, sudoedit /etc/hosts should open /etc/hosts using vim. Alternatively you can use sudo vim /etc/hosts.


26

My personal preference... cd /bin mv nano nano_must_die ln -s /usr/bin/vim nano


26

You might be able to use vi/vim as a hex editor too (it can call xxd). Enter hex mode: :%!xxd Exit hex mode: :%!xxd -r Source: Using vi as a hex editor


26

You can't select with mouse and delete text using nano editor. For faster delete you can use Ctrl + K to delete(cut) the present line of text. Note : Ctrl + K will cut the line of text. Using Ctrl + U you can paste it. EDIT: Additional Info from steeldriver You can select and cut something other than the current line using Ctrl-^ to mark the start of ...


26

Geany Geany is a small and lightweight integrated development environment. It was developed to provide a small and fast IDE, which has only a few dependencies from other packages. It is using only the GTK2 toolkit and therefore you need only the GTK2 runtime libraries to run Geany. As a long time Gedit user, I shifted to Geany last year as my main ...


24

emacs has a hexl-mode for hex editing.


23

Unlike Unix where a new line is represented by a LF character we need a combination CR/LF for files in DOS/Windows: Gedit We can let Gedit save text documents with Windows-style line endings in the File -> Save as dialog. Adjust the settings for Line Endings in the drop down menu to Windows. Nano To make nano write text files in DOS format we have to ...


Only top voted, non community-wiki answers of a minimum length are eligible