Vim tips and tricks


Login or Register to Reply

 
Thread Tools Search this Thread
# 30  
Old 11-28-2016
Quote:
Originally Posted by Howie Vahedi
Now I have to figure out how to switch from Insertion Mode to Command Mode Smilie
It is simple; just hit the escape key.
# 31  
Old 02-02-2017
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 02-02-2017
Quote:
Originally Posted by ctsgnb
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
This User Gave Thanks to bakunin For This Post:
ctsgnb (02-13-2017)
# 33  
Old 02-13-2017
Ok fixed ... Thanks bakunin for noticing this point Smilie
# 35  
Old 3 Weeks Ago
in vim
set
:set ic
switch (toggle)
:set ic!
unset
:set noic

--- Post updated at 08:39 ---

I always use only one command (toggle), for example
:set nu!
Print line numbers
:set nu!
Print line nonumbers
This User Gave Thanks to nezabudka For This Post:
Neo (3 Weeks Ago)
Login or Register to Reply

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
Any tricks on excluding a set of strings from a file? newbie_01 UNIX for Dummies Questions & Answers 3 05-22-2013 02:22 AM
Basic VI tricks cokedude UNIX for Advanced & Expert Users 3 08-05-2011 04:11 PM
tips xerox UNIX for Dummies Questions & Answers 1 02-24-2011 08:01 AM
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
need couple of ksh tricks please JamesByars Shell Programming and Scripting 4 02-23-2008 02:07 PM
Set prompt, problems and tricks HybridLogic UNIX for Dummies Questions & Answers 6 09-26-2007 08:05 PM
tar tricks neked UNIX for Advanced & Expert Users 2 08-14-2006 03:14 PM