Home Register Members List Search Today's Posts Mark Forums Read

Go Back   TechFuels Forum > Technology Jargons - What is ....? > Everything Else

Reply
 
LinkBack Thread Tools
Diego Tylor
Member
 

Diego Tylor is offline  
Old 07-01-2009, 01:19 PM
  #1 (permalink)
To open file with Vim

To open files with Vim, use the following command: vim file. To open multiple files as split windows, type: $ vim -0 file1 file2. To open a file from the Vim command-line, use the following: :efile II Auto complete is supported by pressing TAB.

To save the changes to the currently opened file, press ESC to switch to the command mode from the editing mode, then type :w and press ENTER. To exit Vim after saving a file, type :wq. To just quit without saving, use :q! To save the current file as a new file, use the command line.

Manipulating files
Cut, copy and paste are essential features of any text editor. To cut the current word, place the cursor at the starting character of the word and use 'cw'. To cut the current line, use 'cc' in the command mode. To copy the current word, place the cursor at the starting letter and use 'yw', while to copy an entire line, use 'yy'. To paste content, place the cursor at the position where the contents of the buffer need to be placed, and press 'p'.

Name:  To open file with Vim.jpg
Views: 127
Size:  34.4 KB

To remove a word, place the cursor at the starting letter of the word, and press 'dw', while to remove a line, press 'dd', and to remove a character, press 'x'. To undo the previous action, press 'u', while to redo an action, 'Ctrl + r'. To repeat a previously performed task, press ': To list the available undo tasks, ':undolist'.

To search, substitute and replace
To search for a word/sentence while in the command mode, type Iword and press ENTER, where 'word' is the word you're searching for. To repeat the search
in the forward direction, press n, while to reverse the direction of the search, press?

To replace a part of the text, use:%s/word_pattern/replacement_text/ - replaces the first word of every line
•:%s/word_pattern/replacement_text/ - global replacement of t,he word
•:%s/word_pattern/replacement_text/ gc - replacement with interactive Yes/No confirmation %s represents the entire text in the file. It is also possible to use a range of lines for replacement. In case we want to use a replacement only between the lines 1 and 25, the above command can be used.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot Open a PDF File Attachment on a Website Link George kertzen Windows XP 0 06-15-2009 02:19 PM
Your System Has No Paging File or the Paging File is Too Small Emanuel George Windows XP 0 06-15-2009 01:40 PM
Unable to copy file and read it from the cause file or disk ronchi Windows 2000/NT 0 05-06-2009 11:39 AM
XP User file is protected file prevail dr. franklin house Windows XP 1 05-04-2009 11:27 AM
XP User file is protected file prevail warner20 Windows XP 1 05-02-2009 10:51 AM


All times are GMT +1. The time now is 05:37 PM.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.0
Copyright Techfuels


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143