Unix/Linux Go Back    


UNIX for Beginners Questions & Answers If you're not sure where to post a Unix or Linux question, post it here. All unix and Linux beginners welcome in this forum!

Vim tips and tricks

UNIX for Beginners Questions & Answers


Reply    
 
Thread Tools Search this Thread Display Modes
    #29  
Old Unix and Linux 11-28-2016   -   Original Discussion by ungalnanban
Howie Vahedi's Unix or Linux Image
Howie Vahedi Howie Vahedi is offline
Registered User
 
Join Date: Nov 2016
Last Activity: 28 November 2016, 10:05 PM EST
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Now I have to figure out how to switch from Insertion Mode to Command Mode Linux
Sponsored Links
    #30  
Old Unix and Linux 11-28-2016   -   Original Discussion by ungalnanban
Don Cragun's Unix or Linux Image
Don Cragun Don Cragun is offline Forum Staff  
Administrator
 
Join Date: Jul 2012
Last Activity: 23 April 2018, 12:57 AM EDT
Location: San Jose, CA, USA
Posts: 11,209
Thanks: 633
Thanked 3,903 Times in 3,341 Posts
Quote:
Originally Posted by Howie Vahedi View Post
Now I have to figure out how to switch from Insertion Mode to Command Mode Linux
It is simple; just hit the escape key.
Sponsored Links
    #31  
Old Unix and Linux 02-02-2017   -   Original Discussion by ungalnanban
ctsgnb's Unix or Linux Image
ctsgnb ctsgnb is offline Forum Advisor  
Registered User
 
Join Date: Oct 2010
Last Activity: 3 April 2018, 6:42 AM EDT
Location: France
Posts: 2,967
Thanks: 88
Thanked 640 Times in 610 Posts
Just another usefull vim tip, to customize your own skin :

To just view the setting, just use it with no argument :


Code:
:highlight

also shortened as


Code:
:hi

This will display the current settings.

To display the current setting of the Comment class, just enter:


Code:
:hi Comment

For example, if your comment lines appear in a Dark blue and you expect a lightblue instead (0,255,255) or #00ffff try :



Code:
:hi Comment ctermfg=6

You could then set your own settings in your $HOME/.vimrc ... activate :set syntax=on if necessary)

The different classes (Comment, Title, Constant, Special, ...) and much more, are documented at :
Vim documentation: syntax

Just play with the :highlight command , get use to it and enjoy !

Last edited by ctsgnb; 02-02-2017 at 05:54 AM..
    #32  
Old Unix and Linux 02-02-2017   -   Original Discussion by ungalnanban
bakunin's Unix or Linux Image
bakunin bakunin is offline Forum Staff  
Bughunter Extraordinaire
 
Join Date: May 2005
Last Activity: 22 April 2018, 4:54 PM EDT
Location: In the leftmost byte of /dev/kmem
Posts: 5,742
Thanks: 112
Thanked 1,667 Times in 1,226 Posts
Quote:
Originally Posted by ctsgnb View Post
cW:change the Whole line from the current cursor position (same as C )
not quite: The difference is what "word" means. "cw" (or any other command using "w" as a range assignment) will treat special characters as the end of the word, whereas "cW" will treat only whitespace (or line ends) as word delimiters. In the following text:



Code:
typeset foo=bar        # comment

if the cursor is under the "f" of "foo", then "cw" will replace "foo" with what you type afterwards, whereas "cW" will replace "foo=bar". To change the line from the cursor position to the line end use "C".

I hope this helps.

bakunin
The Following User Says Thank You to bakunin For This Useful Post:
ctsgnb (02-13-2017)
Sponsored Links
    #33  
Old Unix and Linux 02-13-2017   -   Original Discussion by ungalnanban
ctsgnb's Unix or Linux Image
ctsgnb ctsgnb is offline Forum Advisor  
Registered User
 
Join Date: Oct 2010
Last Activity: 3 April 2018, 6:42 AM EDT
Location: France
Posts: 2,967
Thanks: 88
Thanked 640 Times in 610 Posts
Ok fixed ... Thanks bakunin for noticing this point Linux
Sponsored Links
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Very Importan - Vim Settings - Error while opening a File using vim girija Solaris 0 08-13-2010 08:37 AM
Sed Tricks siba.s.nayak UNIX for Dummies Questions & Answers 3 10-20-2009 03:01 AM
Solaris tips and tricks solaris_user Post Here to Contact Site Administrators and Moderators 1 09-24-2009 01:02 PM



All times are GMT -4. The time now is 01:52 AM.