OT: colors for vi on Linux (Debian - ubuntu)
Bill Campbell
bill at celestial.com
Sun Jul 27 10:58:25 PDT 2008
On Fri, Jul 25, 2008, John Esak wrote:
>Hi,
>
>Okay, I know I'll take the flack for using this great forum to ask a
>question that seems non-filePro related.... I'll ask uit at the end of the
>next couple paragraphs.... let me try and attach some filePro basis for the
>question though... :-) it will be lame, but hopefully informative??
>
>Okay, so OT:, and just in case anyone cares. We have just put a great
>filePro app on "ubuntu" Linux. This is a Debian derivative. Everyone knows
>I have felt Linux to be not ready for prime time for a long time now...
You mean we shouldn't have been using Linux for production systems now for
a decade or so? We used it for customer desktops for quite a while as well
until we started moving their desktops to Macs about four years ago.
>Well, releases like this latest ubuntu will change not only my mind, but the
>minds of lots of folks who think like me. I mean for the Linux crowd to
>have been working for so many years and still have not come up with a decent
>"color" setup a la "setcolor" from SCO... it is just crazy.
One of the first things I did when moving to Linux from SCO years ago was
to do everything in monochrome xterms, even on SCO boxes. I find the color
selections of many programs horrible, and much prefer a simple light
background with black text and a red cursor (so that reverse video
characters are visible).
>Okay, the ubuntu, you download a file, burn it to a CD, use the CD on just
>about any P"C (server, etc.)... it asks you about 4 questions like "do you
>want to use the whole disk for Linux?" even if it is a multi-disk FAID5
>that you want, and so forth.... the simple questions done in seconds, the
>thing loads itself completely on your box and it's ready to go. From this
>point you can get or (unget) any package you want with a simple command
>like:
As Mark said in another post, the Ubuntu/Debian systems are too much a
Stallman/GNU religious cult for my liking.
We install CentOS using kickstart network installs. Burn a tiny network
install CD with a few kickstart configuration files (an interactive and
non-interactive file for installation on VMware virtual machines and the
same for real hardware). It requires typing an option at the boot prompt,
then goe away and forget it for the remainder of the installation.
Once that install is complete, we install about 240 packages built under
the OpenPKG portable package management system which have all the servers,
and our own management software. When installation from our OpenPKG ISO
image is complete, a low-level tech can then set the network parameters,
and configure all systems, e-mail, apache, mysql, postgresql, horde, imp,
kronolith, etc. in less than five minutes at the keyboard to arrive at a
fully configured server.
>Sudo apt-get install package-name
>
>And
>
>Sudo apt-get remove package-name
sudo yum install packagename
sudo yum remove packagename
...
>The bottom line is that filePro works dead easy on this box. (you really
>just need to copy over the "ansi" terminfo from your working SCO box... and
>the ansi termcap defs from it as well. And if you use FacetWin, make sure
>that "inetd" is working properly. (an apt-get package thing only.) If you
>use Bob's anzio product to get to the Linux server, I don't think much of
>anything would be required. Printing just works out of the box... even
>local printing (PFPT=ON). You can even use the "useradd" command to
>duplicate your old Unix users, ID, directory and all.
That's no different from any of the Linux systems I've used for years.
I have written a script that will read the /etc/{passwd,group,shawod} files
from a SCO box, and create the users on a Linux box including creating the
appropriate smb.passwd file for Samba, users for jive_messenger, and
OpenLDAP user information. This script migrates user home directories from
/usr/usrname or /u/usr/usrname to /home/usrname as well. The openldap
/home/usrname home directories are mapped to /homes/usrname to avoid
conflicts on other systems using nss_ldap for authentication from the
central server.
>Just a point of info for all you folks who don't have any other easy means
>of hearing stuff like this. You can load a server version of ubuntu, or
>just load the desktop version and add the server things you need, same
As much as I like Linux for servers, I rarely use it for a desktop since
moving to Mac OS X where everything Just Works(tm), and it has all sorts of
neat tools to do multi-media things without having to worry about getting
all the bits and pieces to work together.
I am typing this on an old PPC Titanium Powerbook running Leopard running
mutt in an xterm on our primary server which is running SuSE Enterprise
Linux 10 which has been running since July 2006 with a single reboot due to
an equipment move. My main desktop machine is a 3-year old PPC Mac Mini,
and I gave my wife a similar Mac Mini so I wouldn't have to deal with her
old Windows machine.
...
>Now for my question.
>
>The ls command does a lot of color changing for lots of different
>reasons.... directories, executable files, etc. It is beyond annoying... If
>you have a black background like me... it is IMPOSSIBLE.
>
>I have gotten the great help from various folks and made the "ls" command to
>work like the "l" command I know and love (skipping the color thing) by
>doing this in my .profile....
You can either set up an aliase in your ~/.bash_login or ~/.bashrc file,
``alias l='ls -la --color=none'' or write a one line shell script that does
the same thing.
The ls colors output is controlled by and environment variable, LS_COLORS
which has all sorts of options for different types of files, directories,
etc.. As I have said, I prefer a simple monochrome output so just ``unset
LS_COLORS'' to get rid of this.
...
>It stops the program from doing any color shifting.... great. Now, I have
>to stop "vi" from doing it as well. On this Linux, "vim" is the choice for
>vi... it is an improved vi and great for editing any kind of file including
>binary files and things with unprintable characters like pcl files. So,
>anyway, I start off by doing this in the .profile.
>
>alias vi="vim -T ansi $* -u /root/.vimrc"
Why not just ``alias vi=vim'' as the terminal type is autotically taken
from the TERM variable and it uses ~/.vimrc by default?
On CentOS systems I use ``alias vi='vim'' to insure that it really uses the
full vim, and not the stripped down /bin/vi version which doesn't do split
windows. I also set ``VISUAL=vim'' so that ``less'' uses vim, and not
/bin/vi as well. This was something I did not have to do on SuSE.
>This gets me using vim and pointing to an initialization file for it
>".vimrc". so what do I put in this .vimrc to STOP the damn color shifting
>in vi????? I have read the info about "syntax" and tried
As mark said, this is simply ``syntax off''. I have attached my ~/.vimrc
file which has the settings I use, many are ``vi'' compatible even on SCO
systems. FWIW, the difference between F5 and F6 is that I wrote a ``fmt''
script that runs input through ``nroff'' years before the ``fmt'' command
became standard so F6 forces the system's version.
The ``set mps+=<:>'' line causes the ``%'' matching to work on HTML, XML,
etc. markup languages.
Mark uses some more sophisticated color shemes than I do.
>Ultimately, I would LOVE to be able to govern the color of my screen so I
>could do what I so easily do on SCO, change my foreground and background
>based on my PFDIR... live, or dev, etc.
The only thing I really do with color is to set the background of some
xterm windows, particularly for accounting applications where I want to be
sure I'm running the right system. Here are some examples to run
our Unify based accounting application on an OpenServer system
# this one runs our main accounting
#!/bin/sh
user=csllc
system=accting.example.com
xterm=/csoft/bin/xterm
ssh -f $system $xterm \
-xrm \"*title: CSLLC Accountin\" \
-bg LightSkyBlue -e /usr/local/ubin/unrun $user
#end of script
# This is for my personal stuff:
#!/bin/sh
user=bill
system=accting.example.com
xterm=/csoft/bin/xterm
ssh -f $system $xterm \
-xrm \"*title: BILL Accounting\" \
-bg AntiqueWhite3 -e /usr/local/ubin/unrun $user
#end of script
These scripts run the OpenPKG version of xterm on a SCO server (actually an
OSR 5.0.6a VMware virtual machine running on a CentOS 5.1 host), executing
the command to run the accounting application in that xterm. The different
background colors make it easy to see which system I'm in, and they show
the same color when minimized in the OS X Dock.
The attached ~/XTerm file can be put in your $HOME directory to
automatically set things in xterms and has some settings including:
+ Set a large font as default.
+ Set the cursor color to red,
+ The XTerm*charClass is magic to make double left mouse click usually
highlight the interesting parts of path names, etc.
+ The XTerm*ttyModes is very similar to ``stty'' to set the interrupt to
ctrl-C as $DEITY intended, use ctrl-H as backspace instead of the
DECish DEL character and be sure that ctrl-U clears the current line.
Bill
--
INTERNET: bill at celestial.com Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/ PO Box 820; 6641 E. Mercer Way
Voice: (206) 236-1676 Mercer Island, WA 98040-0820
Fax: (206) 232-9186
There is no distinctly native American criminal class save Congress
-- Mark Twain
-------------- next part --------------
set shell=/bin/sh
set showmode
set autoindent
set nonumber
set autowrite
set ignorecase
set showmatch
set wrapscan
set mesg
set ai sw=4 ts=4 aw ic shell=/bin/sh sm wm=15
map :!sh -x %
map mrGme:w!
:r !Lint %
map :!cc -c $CFLAGS %
map Gme:w!
:r !ulint %
map :!putcvs %
set tags=tags\ ../util/utiltags\ ../util/libtags
map <F5> {!}fmt
map <F6> {!}/usr/bin/fmt
set ruler
set mps+=<:>
syntax off
-------------- next part --------------
!
!!
!! SAMPLE .Xdefaults / app-defaults RESOURCE SPECIFICATIONS FOR XTERM
!!
!
!
!
!!
!! set default tty mode.
!!
!
!XTerm*ttyModes: intr ^? erase ^H kill ^U
!
!
!
!!
!! modify mouse functionality so that "Shift <Btn1Down>" has the same
!! functionality as "<Btn2Down>".
!!
!! The Ctrl<Btn2Down> xterm window menu CANNOT be popped up using
!! Shift Ctrl<Btn1Down>
!!
!
!*VT100*translations: #override\
! Shift <Btn1Down>: insert-selection(PRIMARY, CUT_BUFFER0) \n\
! Button1 <Btn3Down>: insert-selection(PRIMARY, CUT_BUFFER0)
!
!*VT100*Scrollbar*translations: #override\
! Shift <Btn1Down>: StartScroll(Continuous) MoveThumb() NotifyThumb() \n\
! Shift <Btn1Motion>: MoveThumb() NotifyThumb() \n\
! Button1 <Btn3Down>: StartScroll(Continuous) MoveThumb() NotifyThumb() \n\
! Button1 <Btn3Motion>: MoveThumb() NotifyThumb()
!
!
!
!!
!! menu resources
!!
!
!*SimpleMenu*BackingStore: NotUseful
!*SimpleMenu*menuLabel.font: -adobe-helvetica-bold-r-normal--*-120-*-*-*-*-iso*-*
!*SimpleMenu*menuLabel.vertSpace: 100
!*SimpleMenu*HorizontalMargins: 16
!*SimpleMenu*Sme.height: 16
!
!*SimpleMenu*Cursor: left_ptr
!*mainMenu.Label: Main Options
!*mainMenu*securekbd*Label: Secure Keyboard
!*mainMenu*allowsends*Label: Allow SendEvents
!*mainMenu*logging*Label: Log to File
!*mainMenu*redraw*Label: Redraw Window
!*mainMenu*suspend*Label: Send STOP Signal
!*mainMenu*continue*Label: Send CONT Signal
!*mainMenu*interrupt*Label: Send INT Signal
!*mainMenu*hangup*Label: Send HUP Signal
!*mainMenu*terminate*Label: Send TERM Signal
!*mainMenu*kill*Label: Send KILL Signal
!*mainMenu*quit*Label: Quit
!
!*vtMenu.Label: VT Options
!*vtMenu*scrollbar*Label: Enable Scrollbar
!*vtMenu*jumpscroll*Label: Enable Jump Scroll
!*vtMenu*reversevideo*Label: Enable Reverse Video
!*vtMenu*autowrap*Label: Enable Auto Wraparound
!*vtMenu*reversewrap*Label: Enable Reverse Wraparound
!*vtMenu*autolinefeed*Label: Enable Auto Linefeed
!*vtMenu*appcursor*Label: Enable Application Cursor Keys
!*vtMenu*appkeypad*Label: Enable Application Keypad
!*vtMenu*scrollkey*Label: Scroll to Bottom on Key Press
!*vtMenu*scrollttyoutput*Label: Scroll to Bottom on Tty Output
!*vtMenu*allow132*Label: Allow 80/132 Column Switching
!*vtMenu*cursesemul*Label: Enable Curses Emulation
!*vtMenu*visualbell*Label: Enable Visual Bell
!*vtMenu*marginbell*Label: Enable Margin Bell
!*vtMenu*altscreen*Label: Show Alternate Screen
!*vtMenu*softreset*Label: Do Soft Reset
!*vtMenu*hardreset*Label: Do Full Reset
!*vtMenu*tekshow*Label: Show Tek Window
!*vtMenu*tekmode*Label: Switch to Tek Mode
!*vtMenu*vthide*Label: Hide VT Window
!
!*fontMenu.Label: VT Fonts
!*fontMenu*fontdefault*Label: Default
!*fontMenu*font1*Label: 6x10
!*VT100*font1: 6x10
!*fontMenu*font2*Label: 6x12
!*VT100*font2: 6x12
!*fontMenu*font3*Label: 9x15
!*VT100*font3: 9x15
!*fontMenu*font4*Label: 10x20
!*VT100*font4: 10x20
!*fontMenu*fontescape*Label: Escape Sequence
!*fontMenu*fontsel*Label: Selection
!!fontescape and fontsel overridden by application
!
!*tekMenu.Label: Tek Options
!*tekMenu*tektextlarge*Label: Large Characters
!*tekMenu*tektext2*Label: #2 Size Characters
!*tekMenu*tektext3*Label: #3 Size Characters
!*tekMenu*tektextsmall*Label: Small Characters
!*tekMenu*tekpage*Label: PAGE
!*tekMenu*tekreset*Label: RESET
!*tekMenu*tekcopy*Label: COPY
!*tekMenu*vtshow*Label: Show VT Window
!*tekMenu*vtmode*Label: Switch to VT Mode
!*tekMenu*tekhide*Label: Hide Tek Window
!
*tek4014*fontLarge: 10x20
*tek4014*font2: 9x15
*tek4014*font3: 6x13
*tek4014*fontSmall: 6x10
XTerm*font: 10x20
XTerm*pointerShape: arrow
XTerm*termName: xterm
XTerm*blink: true
XTerm*loginShell: true
XTerm*scrollBar: true
! XTerm*cursorColor: SlateBlue
XTerm*cursorColor: red3
XTerm*backarrowKeyIsErase: false
!XTerm*termName: xterm-color
XTerm*background: Grey95
!XTerm*background: AntiqueWhite
!XTerm*background: seashell2
!XTerm*background: ivory2
XTerm*charClass: 33:48,37:48,43:48,45-47:48,64:48,126:48,95:48
XTerm*ttyModes: intr ^C erase ^H kill ^U
More information about the Filepro-list
mailing list