Delete Key Mac Map To Backspace For Vi Editor

brownscout
7 min readJun 29, 2021

Download here

Introduction to Linux — A Hands on Guide This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter. Backspace is the keyboard key that originally pushed the typewriter carriage one position backwards, and in modern computer systems moves the display cursor one position backwards, deletes the character at that position, and shifts back the text after that position by one position. The Apple Mac “Delete” key and the Windows “Backspace” key are located in the same (approximate) location on the keyboard; and both keys even function the same on a Windows computer compared to a Mac.

Active2 years, 8 months ago

I am new to vi, actually I have started learning vi from today and I have got stuck at the behavior of the backspace key. Actually when I fired up vi on my Ubuntu 12.04 for the first time my backspace key was working normally but after that it has started behaving strangely. Whenever I press the backspace in the insert mode it just moves one place to the left instead of erasing the character. How can I get back the default backspace functionality? Please note that I don’t want to install vim or set nocompatibilty.

Braiam

24.7k2020 gold badges8282 silver badges147147 bronze badges

Saprativa BhattacharjeeSaprativa Bhattacharjee

5 Answers

Sometimes the vi command is an alias for vim and when called as vi enables its vi-mode.

Even in traditional mode backspace is deleting the character, but does not display it as deleted immediately. (After pressing ESC the characters are gone.)

Guess you have to choose between using vi which comes with the described behavior or using vim which is able to do it the way you expect it. Best sound effect editor for machine.

michasmichas

16.3k33 gold badges4040 silver badges7373 bronze badges

  1. Checkout whether your are actually using plain vi via
  2. $ vi --version | head -n 1 Picasa photo editor for mac.
  3. Best Javascript Editors for Mac In this roundup, we categorized different text editors for Mac users. Some of them are for the everyday editing and are free of cost. UltraEdit is a powerful HTML and Code editor available for Mac, Windows, and Linux. It comes with a built-in file comparison utility, autocompletion, advanced layout, multi-tab, multi-pane editors, and syntax highlighting for the most popular programming languages. Best code editor for mac.
  4. This gives on my machine (Debian 7)
  5. VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Feb 10 2013 02:27:59)
  6. vim can be made to behave more like vi. This can be done by giving the command vi instead of vim from the commandline, where vi is only a sym-link to vim, in which case vim is opened in vi mode.You can check this with :set compatible?.
  7. As mentioned by the previous answer, the effect of the backspace becomes only visible after leaving in insert mode when set compatible is enabled.

Delete Key Mac Map To Backspace For Vi Editor Cheat

Note:In vi-compatible mode, you cannot backspace over text which was previously entered (before entered insert mode) or eol's or indentation in insert mode. see :help 'bs'

Try out the different settings to understand their meaning: Enter characters/line breaks and indentation in insert mode, exit and reenter insert mode and then try backspacing.

Users who are not familiar with vi behaviour and don’t insist on using plain vi (not recommened anyway) should :set backspace=indent,eol,start. Afaik on Debian there is usually a system-wide config file installed with this setting.

You can get the current setting via :set bs?.

Delete Key Mac Map To Backspace For Vi Editor Linux

Tyler Durden

1,81355 gold badges2727 silver badges5656 bronze badges

HotschkeHotschke

Create a new file in the user home directory called .vimrc if it’s not already there. Here we’ll create and edit at the same time with vi

Add the following commands, which include turning off compatibility mode and backspace key erase functionality:

Save and exit file using

Turning off compatibility mode allows the use of arrow keys us old vi guys are used to.

Since we sudo’d when creating the file, the ownership of the file will probably be root. You can chown the file to the user.

In my case this was for a raspberry pi, so the user and group is pi:

Now fire up vi again and enjoy!

recurserecurse

I think the best way would be to look at VI/VIM cheatsheet : http://www.viemu.com/vi-vim-cheat-sheet.gif

Enter normal mode (ESC) and then SHIFT + X.

BlackPioterBlackPioter

jhvarasjhvaras

Not the answer you’re looking for? Browse other questions tagged vi or ask your own question.

This article is part of the VIM User Guide series:

  • Vim Keyboard Shortcuts Cheatsheet

The Vim editor is a command-line based tool that’s an enhanced version of the venerable vi editor. Despite the abundance of graphical rich text editors, familiarity with Vim will help every Linux user — from an experienced system administrator to a newbie Raspberry Pi user.

The light-weight editor is a very powerful tool. In the hands of an experienced operator, it can do wonders. Besides regular text editing functions, the editor also supports advanced features such as find & replace based on regular expressions and encoding conversion as well as programming features such as syntax highlighting and code folding.

One important thing to note when using Vim, is that the function of a key depends on the “mode” the editor is in. For example, pressing the alphabet “j” will move the cursor down one line in the “command mode”. You’ll have to switch to the “insert mode” to make the keys input the character they represent.

Here’s a cheatsheet to help you get the most out of Vim.

How can the answer be improved? Note: In this article, we are focusing on the best text editors for coding but if you are looking for a text editor for your writing purposes, you can check out our article on the best writing apps for Mac. Sublime Text 3. Sublime Text is probably one of the most famous text editors available for Mac and for all the right reasons. Hence owning best text editors will do half of your work. Every operating system has in built text editor like for Windows OS it is Notepad; OS X has Text Edit whereas in iOS you have Notes. And when we talk about Mac, then we have huge options of Best Text Editors for MAC to choose from. Whats the best textt editor for mac. Text editors are an entirely different story. Text editors are much more helpful if you’re editing code, creating web pages, doing text transformation or other things for which a word processor is just overkill. Here’s a roundup of the best ones you can get for your Mac at the moment. The Best Free Text Editors for Windows, Linux, and Mac Lori Kaufman April 28, 2012, 12:00pm EDT We all use text editors to take notes, save web addresses, write code, as well as other uses.

Shortcut KeysFunction

Main

Escape keyGets out of the current mode into the “command mode”. All keys are bound of commands.i“Insert mode” for inserting text. Keys behave as expected.:“Last-line mode” where Vim expects you to enter a command such as to save the document.

Navigation keys

hmoves the cursor one character to the left.j or Ctrl + Jmoves the cursor down one line.k or Ctrl + Pmoves the cursor up one line.lmoves the cursor one character to the right.0moves the cursor to the beginning of the line.$moves the cursor to the end of the line.^moves the cursor to the first non-empty character of the linewmove forward one word (next alphanumeric word)Wmove forward one word (delimited by a white space)5wmove forward five wordsbmove backward one word (previous alphanumeric word)Bmove backward one word (delimited by a white space)5bmove backward five wordsGmove to the end of the fileggmove to the beginning of the file.

Navigate around the document

(jumps to the previous sentence)jumps to the next sentence{jumps to the previous paragraph}jumps to the next paragraph[[jumps to the previous section]]jumps to the next section[]jump to the end of the previous section][jump to the end of the next section

Insert text

aInsert text after the cursorAInsert text at the end of the lineiInsert text before the cursoroBegin a new line below the cursorOBegin a new line above the cursor

Special inserts

:r [filename]Insert the file [filename] below the cursor:r ![command]Execute [command] and insert its output below the cursor

Delete text

xdelete character at cursordwdelete a word.d0delete to the beginning of a line.d$delete to the end of a line.d)delete to the end of sentence.dggdelete to the beginning of the file.dGdelete to the end of the file.dddelete line3dddelete three lines

Simple replace text

r{text}Replace the character under the cursor with {text}RReplace characters instead of inserting them

Copy/Paste text

yycopy current line into storage buffer[‘x]yyCopy the current lines into register xppaste storage buffer after current linePpaste storage buffer before current line[‘x]ppaste from register x after current line[‘x]Ppaste from register x before current line

Undo/Redo operation

uundo the last operation.Ctrl+rredo the last undo.

Search and Replace keys

/search_textsearch document for search_text going forward?search_textsearch document for search_text going backwardnmove to the next instance of the result from the searchNmove to the previous instance of the result:%s/original/replacementSearch for the first occurrence of the string “original” and replace it with “replacement”:%s/original/replacement/gSearch and replace all occurrences of the string “original” with “replacement”:%s/original/replacement/gcSearch for all occurrences of the string “original” but ask for confirmation before replacing them with “replacement”

Bookmarks

m {a-z A-Z}Set bookmark {a-z A-Z} at the current cursor position:marksList all bookmarks`{a-z A-Z}Jumps to the bookmark {a-z A-Z}

Select text

vEnter visual mode per characterVEnter visual mode per lineEscExit visual mode

Modify selected text

~Switch caseddelete a word.cchangeyyank>shift right<shift left!filter through an external command

Save and quit

:qQuits Vim but fails when file has been changed:wSave the file:w new_nameSave the file with the new_name filename:wqSave the file and quit Vim.:q!Quit Vim without saving the changes to the file.ZZWrite file, if modified, and quit VimZQSame as :q! Quits Vim without writing changes

Download VIM Keyboard Shortcuts Cheatsheet

Delete Key Mac Map To Backspace For Vi Editor

Can’t get enough of this? We have prepared a downloadable cheat sheet for you so you can access to it when you need it.

Is this article useful?

Ebooks

Download here

--

--