Sponsored Content
Full Discussion: A trick to avoid ESC in vim
Top Forums UNIX for Dummies Questions & Answers A trick to avoid ESC in vim Post 302488697 by vistastar on Tuesday 18th of January 2011 08:19:19 AM
Old 01-18-2011
Hammer & Screwdriver A trick to avoid ESC in vim

Hello, I find a trick to avoid pressing ESC without key-maping in vim. I am pleasure using this method, because ALT key is very comfortble for thumb to press.

What's the trick? the ALT key.

When you are in INSERT mod, press
Code:
ALT+l                              switch to COMMAND mod without cursor moving.
ALT+h                              switch to COMMAND mod with cursor moving foward two char.
ALT+d                              switch to COMMAND mod without cursor moving up one line.
ALT+k                              switch to COMMAND mod without cursor moving down one line.
ALT+dd                             remove current line.
ALT+shift+ZZ                       save and quit vim.
...
...

Now, I think you have grasped this simple trick:
ALT+somekey = ESC then somekey.
PS: In GUI terminals, you should disable ALT as shortcut key for menu.
This User Gave Thanks to vistastar For This Post:
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Stupid find trick

At work, we use a software development product (from a company that will remain nameless, but whose name may be considered a synonym for "logical"). The development trees are organized beneath a top directory, let's call it "$rat". The first level under $rat contains the major system names, and... (2 Replies)
Discussion started by: criglerj
2 Replies

2. UNIX for Dummies Questions & Answers

Looking for tips ant trick extend vi

Hello im looking for sites or tutorials how to extend vi (not vim) for programming and scripting beyond simple editing . Thanks allot (0 Replies)
Discussion started by: umen
0 Replies

3. UNIX for Dummies Questions & Answers

How to invoke ESC+K

How to invoke ESC+K to get recent commands in Korn Shell. In some of the unix machine ESC+K is available and in some machines, it does not work. All of the machines that I work have Korn shell. (5 Replies)
Discussion started by: bobbygsk
5 Replies

4. Shell Programming and Scripting

Any trick to speed up script?

Hi Guys, I have a script that I am using to convert some text files to xls files. I create multiple temp. files in the process of conversion. Other than reducing the temp. files, are there any general tricks to help speed up the script? I am running it in the bash shell. Thanks. (6 Replies)
Discussion started by: npatwardhan
6 Replies

5. Shell Programming and Scripting

Esc - key

hi i remember sometime back working in unix, when u dont recall a complete file name..u hit ESC key couple of times and actual complete name of that file which u looking for , gets visible For this to be enabled , do we need to make any entry in .profile file. In my current project, am... (3 Replies)
Discussion started by: sureshg_sampat
3 Replies

6. Solaris

Very Importan - Vim Settings - Error while opening a File using vim

I downloaded vim.7.2 and compiled the vim source . Added the vim binary path to PATH (Because iam not the root of the box) when i load the file using vim it throws me an error Error detected while processing /home2/e3003091/.vimrc: line 2: E185: Cannot find color scheme darkblue line... (0 Replies)
Discussion started by: girija
0 Replies

7. UNIX for Dummies Questions & Answers

alternative to the grep trick

Hi, We used to use the below commands often. ps -ef|grep bc ps -ef|grep abc|grep -v grep Both fairly returns the same result. For example, the process name is dynamic and we are having the process name in a variable, how we can apply the above trick. For example "a" is the... (11 Replies)
Discussion started by: pandeesh
11 Replies

8. Programming

Oracle TRICk Question

HI Guys , Below are the two columns ITEMS and STATE of table . ITEMS STATE '2345','ggdh','k5tg','dgyt','hFF' DF '1234','ghyt','DDD','GHTD','ABF' PQ Can we get output in PL/SQL in below way ?... (7 Replies)
Discussion started by: Perlbaby
7 Replies

9. UNIX for Beginners Questions & Answers

UNIX trick or command

Hi, Is there any command to do this -- Input is -- Ant Bat Cat Dog Output is -- A_Ant B_Ant A_Bat B_Bat A_Cat B_Cat A_Dog B_Dog (12 Replies)
Discussion started by: Indra2011
12 Replies
CONSOLE(4)						     Kernel Interfaces Manual							CONSOLE(4)

NAME
console, keyboard, log - system console DESCRIPTION
The TTY device driver manages two devices related to the main user interface, the system screen and the keyboard. These two together are named "the Console". The Screen The screen of a PC can be managed by a Monochrome Display Adapter, a Hercules card, a Color Graphics Adapter, an Enhanced Graphics Adapter, or a Video Graphics Array. To the console driver these devices are seen as a block of video memory into which characters can be written to be displayed, an I/O register that sets the video memory origin to the character that is to be displayed on the top-left position of the screen, and an I/O register that sets the position of the hardware cursor. Each character within video memory is a two-byte word. The low byte is the character code, and the high byte is the "attribute byte", a set of bits that controls the way the character is displayed, character and background colours for a colour card, or intensity/underline/reverse video for monochrome. These are the characteristics of the adapters in text mode: Adapter Usable memory Mono/Colour MDA 4K M Hercules 4K M CGA 16K C EGA 32K M or C VGA 32K M or C MDA and Hercules are the same to the console driver, because the graphics mode of the Hercules is of no use to Minix. EGA and VGA are also mostly seen as the same in text mode. An EGA adapter is either a monochrome or a colour device depending on the screen attached to it. A VGA adapter can run in either monochrome or colour (grayscale) mode depending on how the Boot Monitor has initialized it. The driver uses the video origin to avoid copying the screen contents when scrolling up or down. Instead, the origin is simply moved one line. This is named "hardware scrolling", as opposed to copying memory: "software scrolling". The video origin is also used to implement several virtual consoles inside the video memory of the adapter. Each virtual console gets a segment of video memory. The driver chooses which console to display by moving the video origin. Note that an MDA or Hercules adapter can only support one console. CGA can support up to four 80x25 consoles, and EGA and VGA can have eight. It is best to configure one less console to leave some video memory free so that hardware scrolling has some space to work in. Character codes are used as indices into a display font that is stored in the adapter. The default font is the IBM character set, which is an ASCII character set in the low 128 codes, and a number of mathematical, greek, silly graphics, and accented characters in the upper 128 codes. This font is fixed in the MDA, Hercules and CGA adapters, but can be replaced by a user selected font for the EGA and VGA adapters. A number of control characters and escape sequences are implemented by the driver. The result is upward compatible with the ANSI standard terminal. The termcap(5) type is minix. Normal characters written to the console are displayed at the cursor position and the cursor is advanced one column to the right. If an entire line is filled then the cursor wraps to the first column of the next line when the next character must be displayed. The screen is scrolled up if needed to start a new line. Some characters have special effects when sent to the console. Some even have arguments in the form of comma separated decimal numbers. These numbers default to the lowest possible value when omitted. The top-left character is at position (1, 1). The following control characters and escape sequences are implemented by the console: Sequence Name Function ^@ Null Ignored (padding character) ^G Bell Produce a short tone from the speaker ^H Backspace Move the cursor back one column, wrapping from the left edge up one line to the right edge ^I Horizontal Tab Move to the next tab stop, with each tab stop at columns 1, 9, 25, etc. Wrap to the next line if necessary. ^J Line Feed Move one line down, scrolling the screen up if necessary ^K Vertical Tab Same as LF ^L Form Feed Same as LF ^M Carriage Return Move to column 1 ^[ Escape Start of an escape sequence ^[M Reverse Index Move one line up, scrolling the screen down if necessary ^[[nA Cursor Up Move the cursor up n lines ^[[nB Cursor Down Move the cursor down n lines ^[[nC Cursor Forward Move the cursor right n columns ^[[nD Cursor Backward Move the cursor left n columns ^[[m;nH Cursor Position Move the cursor to line m, column n ^[[sJ Erase in Display Clear characters as follows: s = 0: From cursor to end of screen s = 1: From start of screen to cursor s = 2: Entire screen ^[[sK Erase in Line Clear characters as follows: s = 0: From cursor to end of line s = 1: From start of line to cursor s = 2: Entire line ^[[nL Insert Lines Insert n blank lines ^[[nM Delete Lines Delete n lines ^[[n@ Insert Characters Insert n blank characters ^[[nP Delete Characters Delete n characters ^[[nm Character Attribute Set character attribute as follows: n = 0: Normal (default) attribute n = 1: Bold (mono) / Yellow (colour) n = 4: Underline (M) / Light green (C) n = 5: Blinking (M) / Magenta (C) n = 7: Reverse Video n = 30: Black foreground colour n = 31: Red n = 32: Green n = 33: Orange n = 34: Blue n = 35: Magenta n = 36: Light blue n = 37: White n = 40 - 47: Same for background colour The console device implements the following ioctl to copy a font into font memory on EGA and VGA adapters: ioctl(fd, TIOCSFON, u8_t font[256][32]); Font memory consists of 256 character definitions of 32 lines per character and 8 pixels per line. The first line is the topmost line of the character. The leftmost pixel is lit if the most significant bit of a line is set, etc. The 80x25 video mode used by Minix has an 8x16 character cell, which means that only the first 16 lines of a character are displayed. The Keyboard The keyboard produces key codes for each key that is pressed. These keys are transformed into character codes or sequences according to the current keyboard translation table. The format of this table is described in keymap(5). The character codes can be read from the con- sole device unless they map to special hotkeys. The hotkeys are as follows: Name KeyFunction CTRL-ALT-DEL Send an abort signal to process 1 (init). Init then halts the system CTRL-ALT-KP-. Likewise for keypad period F1 Process table dump F2 Show memory map F3 Toggle software/hardware scrolling F5 Show network statistics CTRL-F7 Send a quit signal to all processes connected to the console CTRL-F8 Send an interrupt signal CTRL-F9 Send a kill signal. If CTRL-F8 or CTRL-F7 don't get 'em, then this surely will. These keys are for disaster recovery. You would normally use DEL and CTRL- to send interrupt and quit signals. ALT-F1 Select virtual console 0 (/dev/console) ALT-F2 Select virtual console 1 (/dev/ttyc1) ALT-F(n+1) Select virtual console n (/dev/ttycn) ALT-Left Select previous virtual console ALT-Right Select next virtual console The keyboard map is set with the KIOCSMAP ioctl whose precise details are currently hidden in the loadkeys utility. Log device The log device can be used by processes to print debug messages onto the console. The console is a terminal type device, so it is taken from processes when a session leader exits. This does not happen with the log device. SEE ALSO
tty(4), loadkeys(1), keymap(5), boot(8). NOTES
Output processing turns Line Feeds into CR LF sequences. Don't let this surprise you. Either turn off output processing or use one of the synonyms for LF. AUTHOR
Kees J. Bot (kjb@cs.vu.nl) CONSOLE(4)
All times are GMT -4. The time now is 07:06 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy