VI - in need of configs/scripts


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers VI - in need of configs/scripts
# 1  
Old 10-30-2010
VI - in need of configs/scripts

Hi,

I'm somewhat new to unix OS
and I'm at course for programmers in my country.
and in the course we learn unix and how to script in unix. of course we just started and we learned only the very basic, but I'm a really computer freak and I looking for a way to make the course easier on all of my course mates.
we are allowed to write scripts and map the programs as we wish as long as we do not "hack" or damage the server or its accounts ( :P )
any way we will only be using VI as an text editor and nothing else, and well I'm sure you all know how primitive it is. I'm looking for configs and mappings that will make my life and my life of my course mates easier a lot easier.
I'm looking for stuff like a config full of mapping for the vi to make it "act" like VS (Visual Studio). by that I mean coloring the text, using normal keys like delete and CTRL+C and CTRL+V...
I know how to map and stuff but my level is only on how to do very basic mapping, if some one can provide me with scripts and configuration that I can download (as a text files, the server is local only we cannot download stuff from the net)
and see for myself, read and learn. and please don't direct me to sites where I can learn stuff... I do that in the course.
configs and scripts will be a learnedly experience too.

Thank you in advance!
# 2  
Old 10-30-2010
You want examples of useful ~/.exrc file entries?
# 3  
Old 10-30-2010
yes very much!
all that I found so far are so helpful but they are all for VIM and not VI (as I said we will be only use VI for scripting in my course so no VIM...)
# 4  
Old 10-30-2010
Well, I like to put a private subdir of /var/tmp as my temp dir. I think if you type :se it tells you all the options and their settings. I recall you can adjust the tab stop, and there is a stupid little auto% thing going on at my latest site when I close ]]) I would like to remove. Read man vi and man ex, as vi is visual ex.
# 5  
Old 10-31-2010
how does that help me? I requested configs/scripts that are already made for the vi...
I know how to change the vi settings and map it, I just don't have the time to do all the advance stuff... that's why I need a public config that does all that stuff for me.
# 6  
Old 11-01-2010
See man cat:
Code:
$ cat -vte .exrc                                      
set autowrite showmatch wrapmargin=0 report=1 directory=/var/tmp/dgp$
map  ^W   :set wrapmargin=8$
map  ^X   {!}sort -b$
map  ^[h  1G$
map  ^[H  1G$
map  ^[F  G$
map  ^[V  ^B$
map  ^[U  ^F$
map  ^[T  ^Yk$
map  ^[S  ^Ej$
map  ^[Q   i$
map  ^[P   x$
map  ^[L   O$
map  ^[M   dd$
map  ^[K   D$
map  ^[J   DjdG$$
map! ^[A  ^[ka$
map! ^[D  ^[ha$
map! ^[C  ^[la$
map! ^[B  ^[ja$
map! ^[L  ^M$
map! ^[Q  ^[$
map! ^[R  ^[$
$

# 7  
Old 11-01-2010
The .exrc file is designed to map what happens when you press a key on the keyboard to what key vi expects.

We need to know what type of terminal (or terminal emulator) you have.
We also need to know some base information about the current configuration and which keys work at the moment:
Code:
echo $TERM
stty -a
cat -v .extrc
sed -n l .exrc


Ps. The keys I find most useful are the four arrow keys, page up/down, and insert.

I assume by ctrl/c ctrl/v you mean M$ Windows copy/paste.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

Chef client on VIOs? How do you manage your VIO configs?

I know the VIOs are generally to be treated as an appliance and one should never drop down to oem_setup_env. In reality however, oem is a very useful tool to get the job done. So that leads me into the question of using the Chef client on a VIO. Currently a big push to manage all our *nix... (4 Replies)
Discussion started by: RecoveryOne
4 Replies

2. Shell Programming and Scripting

Expect script to show cisco configs

I know there are better ways to do this. I prefer snmp. I do not have the proper perl modules loaded on the platorm. Snmp isnt loaded on the platform. Telnet is not an option. I need to write an expect script to pull cisco equipment configs. The following code is executed once I gain... (0 Replies)
Discussion started by: popeye
0 Replies

3. Linux

Packages that monitor OS configs and service/ports?

I have several Redhat servers and workstations that I need to be able to monitor for any changes and be notified of any changes to the OS. The features I need to specifically monitor are: ports - opening of new ports that are not already in a whitelist services - any starting or attempts to start... (1 Reply)
Discussion started by: JCDinPGH
1 Replies

4. Red Hat

Sudo command configs

I am wondering how to use SUDO command to allow only my account to run mount command as root. I have root privilege.:confused: (4 Replies)
Discussion started by: almirzaee
4 Replies

5. Shell Programming and Scripting

KSH - How to call different scripts from master scripts based on a column in an Oracle table

Dear Members, I have a table REQUESTS in Oracle which has an attribute REQUEST_ACTION. The entries in REQUEST_ACTION are like, ME, MD, ND, NE etc. I would like to create a script which will will call other scripts based on the request action. Can we directly read from the REQUEST_ACTION... (2 Replies)
Discussion started by: Yoodit
2 Replies

6. Shell Programming and Scripting

loop through configs

hi All, is there a way in linux to loop thru all variables sourced? i have a set configs like A=100 b=200 c=400 i can add the above lines to a file and source - so that $A will be 100 .. like wise now when i do a cut -c 1-2 file.txt |sort | uniq -c on a file it returns me A 100 B 50 c... (1 Reply)
Discussion started by: arun1401
1 Replies

7. Infrastructure Monitoring

Script to sort Cisco configs

Hi everyone :), I need sort Cisco configs to report but i cannot do the script to made this: #### INPUT ##### config-register 0x2102 version 12.2 ! hostname Router ! interface Ethernet0 description Red LAN ip address 192.168.1.1 255.255.255.0 no cdp enable ! interface Serial0... (6 Replies)
Discussion started by: azrael75
6 Replies

8. Shell Programming and Scripting

Changing the Bash Scripts to Bourne Scripts:URGENT

Hi, I have to write a program to compute the checksums of files ./script.sh I wrote the program using bash and it took me forever since I am a beginner but it works very well. I'm getting so close to the deadline and I realised today that actually I have to use normal Bourne shell... (3 Replies)
Discussion started by: pgarg1989
3 Replies

9. Shell Programming and Scripting

Running scripts within scripts from cron

Hi all, I have set up a cron job which calls another shell script shell script which in turn calls a Java process. The cron tab looks so. 0,30 7-18 * * 1-5 /u01/home/weblogic/brp/bin/checkstatus.sh >> /u01/home/weblogic/logs/checkstatus.log The checkstatus.sh scripts looks like this. ... (4 Replies)
Discussion started by: sirbrian
4 Replies

10. UNIX for Dummies Questions & Answers

mail configs and linux suse 9

Hello, I am needing to find what smtp server we are using on our linux box that run suse 9 when ever we mail out from the box using the mail command.... I have searched the board and see references to sendmail.cf but can't find this file on our box... I see alot of mail configs in /etc/postfix... (2 Replies)
Discussion started by: benefactr
2 Replies
Login or Register to Ask a Question