jiayi Rss

OpenSolaris vim 配置

Posted by jiayi | Posted in OpenSolaris | Posted on 29-09-2008

3

OpenSolarisvim 配了将近2个小时。比搭samp还难。。。

OpenSolaris 自带 vim 7,1,按说版本不低,但用上去相当崩溃,backspace 键行为古怪,只能撤销一次操作,语法高亮效果极次,等等等……今晚把openSUSE 11.0 里自己的 .vimrc 文件拽到 OpenSolaris 上,其他的问题都解决了,唯独彩色的语法高亮始终没有出现(当时所提供的语法高亮只是将关键字加粗,一些符号加下滑线)…不带高亮的 vim 用个P 哦…

Baidu 得知,在 .vimrc 中加上 term=sun-color,这样确实解决了问题,漂亮的语法高亮出现,但随后又有了新的问题:退出vim 后文本还停留在终端上,打开vim时终端的提示符会将文本覆盖,等等等…继续求索,google 英文得到正解,终端设成 term=xtermc。最初设成 xterm 没成功,xtermc 便搞定…恩,这时vim 和终端行为一切正常~

还有个小挠头的问题,退出时光标的位置不能被vim记录,下次打开文本光标又回到首行…
同样google解决…在 .vimrc 中加入

" Tell vim to remember certain things when we exit
"  ‘10 : marks will be remembered for up to 10 previously edited files
"  "100 : will save up to 100 lines for each register
"  :20 : up to 20 lines of command-line history will be remembered
"  % : saves and restores the buffer list
"  n… : where to save the viminfo files
set viminfo=’10,"100,:20,%,n~/.viminfo

" when we reload, tell vim to restore the cursor to the saved position
augroup JumpCursorOnEdit
au!
autocmd BufReadPost *
if expand("<afile>:p:h") !=? $TEMP |
if line("’"") > 1 && line("’"") <= line("$") |
let JumpCursorOnEdit_foo = line("’"") |
let b:doopenfold = 1 |
if (foldlevel(JumpCursorOnEdit_foo) > foldlevel(JumpCursorOnEdit_foo – 1)) |
let JumpCursorOnEdit_foo = JumpCursorOnEdit_foo – 1 |
let b:doopenfold = 2 |
endif |
exe JumpCursorOnEdit_foo |
endif |
endif
" Need to postpone using "zv" until after reading the modelines.
autocmd BufWinEnter *
if exists("b:doopenfold") |
exe "normal zv" |
if(b:doopenfold > 1) |
exe "+".1 |
endif |
unlet b:doopenfold |
endif
augroup END

从用 openSUSE 10.1 以来,vim 配置月来越傻瓜,我也月来越傻瓜了……

总结起来,最关键的是在 .vimrc 中加上 term=xtermc,至于为什么,谁用 OpenSolaris 谁知道。。。



Linux Grub 引导 OpenSolaris

Posted by jiayi | Posted in OpenSolaris | Posted on 28-09-2008

2

最近和Sun打交道比较多,耳濡目染他们力推的OpenSolaris…..于是借 SuSE gnome-terminal 出现故障的机会,将硬盘彻底格掉重做系统。OpenSolaris就在这些系统的行列。。。

先装XP…木办法,有些特殊场合离不了。。。然后装OpenSolaris,现在的OpenSolaris应用的 Gnu Grub 0.95,可以自动引导XP。木有Linux 的电脑显然是不完整的…接下来装了openSUSE 11.0,清车熟路~ 还有10G的地方留给LFS,鉴于此系统不太好装,放到最后,十一再折腾。。。

先装OpenSolaris后装openSUSE,觉得openSUSE 11.0的grub应该更牛X些,搞不好可以自动引导OpenSolaris…结果显示,openSUSE的grub木有这么强大…

openSUSE grub 引导OpenSolaris 的步骤很简单,不过需要不断 reboot …

1.fdisk -l 查看硬盘
jiayi只有一块硬盘,分区如下

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1        2554    20514973+   7  HPFS/NTFS
/dev/sda2            2555        3771     9775552+  83  Linux
/dev/sda3   *        3772        4988     9775521   bf  Solaris
/dev/sda4            4989       14593    77152162+   f  W95 Ext’d (LBA)
/dev/sda5            4989        9589    36957501    7  HPFS/NTFS
/dev/sda6            9590       12358    22241961    7  HPFS/NTFS
/dev/sda7           12359       14322    15775798+  83  Linux
/dev/sda8           14323       14566     1959898+  82  Linux swap / Solaris
/dev/sda9           14567       14580      112423+  83  Linux
/dev/sda10          14581       14593      104391   83  Linux

2.编辑/boot/grub/menu.lst
添加

title Sun OpenSolaris
    rootnoverify (hd0,2) #这里的分区从0开始算,所以/dev/sda3 的编号为2
    chainloader +1
    makeactive
    boot

经实验,如下添加同样成功

title Sun OpenSolaris
    rootnoverify (hd0,2)
    chainloader (hd0,2)+1
    boot

grub指令语法参见:http://www.gnu.org/software/grub/manual/html_node/Chain_002dloading.html#Chain_002dloading

最后show张OpenSolaris 3D截图(我显卡RP好,恩~)