An easy approach to understand tech specs
Feedback ? Send it to admin@fullchipdesign.com or join me at fullchip@gmail.com
GVIM command to duplicate columns
This command executes line by line and the explanation of the regular expression above is discussed below for unix.
:%s/.*/& &/
Explanation:-
:%s - do a global search in the file opened in gvim.
.* - matches everything in a line
& & - places every match twice in the same line.
Input text
aaa
bbb
ccc
ddd
eee
After running regular expression :%s/.*/& &/
We have:
aaa aaa
bbb bbb
ccc ccc
ddd ddd
eee eee
As an example we discussed set of five lines in a text file below.
You can do :set nohl to remove any highlights
How to move up and down from current line by a fixed number?
GVIM has some short-cuts to move/jump inside files in increment/decrement of numbers.
You can simply type.
:+10 to jump down by 10 lines
:-23 to go up by 23 lines
Goto first line in gvim
:1
Goto last line in gvim
:$
>> How to Remove highlights or color from text file? Simply do :nohls
>> How to Search in a text file ?
Simply do /<search_pattern>
Anything after / will be search pattern to find in file.
>> How to set Ignore case in text file for search? :set ic
>> How to open multiple files in GVIM?
Use :split <path_of_file>
>> How to switch between multiple files using only keyboard in GVIM editor?
When multiple files are open in gvim editor, use ctrl+w 2 times to jump in-between files.
>> How to merge the line with line below? Shift+j or capital J
>> How to change text to lowercase or uppercase?
gu{motion} - As you move the up/down arrows the lines will change to all lower case.
gU{motion} - As you move the up/down arrows the line will change to all upper case.