An easy approach to understand tech specs
Feedback ? Send it to admin@fullchipdesign.com or join me at fullchip@gmail.com
How to drop blank characters at end of the line in vi / vim / GVIM text editor ?
Most common expression used to remove blank characters at end of line in GVIM is shown below:
:%s:\s*$::
Explanation of above expression
:%s - will do global search in generic expression
:%s:RegEx:Replace_value:confirm?
\s*$ - is the RegEX from generic expression to find lines with blank characters. This falls in category of gvim regular expressions.
In our example Replace_Value in none. Confirm is also none which is equivalent to not ask before executing the global search.
The above command can be modified to add the capability to add check before execute.
:%s:\s*$::gc
With this command, gvim will ask for permission to execute for every finds in the file.
How to drop blank characters in a range of lines?
The command discussed above will do global search and delete in the file. We can limit the command to a specific region of file by following approach.
First do esc on the the keyboard to go into Visual mode. While in Visual mode select the line to edit using V (capital v) and up/down arrow keys. Once the lines are highlighted and then on keyboard type :
Next , following command will show-up automatically for the range of files.
:`<,`.>
Append the command to drop blank characters to above prompt:
:`<,`.>s:\s*$::
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.