EMacs安装

ubuntu8.10 下安装 emacs23

http://blog.chinaunix.net/u2/63367/showart_1674094.html

http://www.ubuntuchina.com/viewthread.php?tid=4823&pid=10269&page=1&extra=#pid10269

1. 准备工作
(1)安装 CVS、SSH
apt-get install ssh cvs

(2)安装texinfo(为了编译man包)
sudo apt-get install texinfo

(3)安装编译所需的支持包
apt-get install libgtk2.0-dev xlibs-dev (GNOME界面相关)
apt-get install xserver-xorg-dev
apt-get install build-essential
apt-get install libncurses5 libncurses5-dev
apt-get build-dep emacs21 (编译emacs21所需)

2.使用cvs下载最新的source(注:
emacs-unicode-2 is now obsolete (merged into the CVS trunk)
set CVS RSH=”ssh”
cvs -z3 -d:pserver:anonymous@cvs.savannah.gnu.org:/sources/emacs co emacs

有关的CVS访问源码仓库的知识。
现在,许多GNU/Linux项目的互联网协作开发模式主要是使用了CVS强大的项目文件管理功能。上面正是利用了CVS工具远程访问
savannah 的CVS仓库。

  • 对于大部分的远程CVS仓库,可以使用pserver或external技术访问。在pserver模式下,CVS在仓库计算机上运行一个服务器进程,所有客户都连接到该进程。在这种方式下,CVS就像一个web服务器或ftp服务器,通常用于客户远程匿名访问。
  • 在cvs中,用户的概念是:访问或修改仓库的人。不管你是用pserver还是external访问,都需要一个id才能访问cvs仓库。
  • cvs 使用类似url的字符串来指示仓库位置。这个字串由访问类型、用户名、服务器名及仓库位置等构成,常称这个字串为CVSROOT。如下载Emacs时,字 串,:pserver:anonymous@cvs.savannah.gnu.org:/sources中,类型是pserver,用户名是 anonymous,服务器名是cvs.savannah.gnu.org:/sources
  • cvs -z3 -d:pserver:anonymous@cvs.savannah.gnu.org:/sources,其中的-d选项用于指示cvs要访问的仓库位置。
  • /sources/emacs co emacs,其中co参数,表示文件签出,前面emacs指定仓库中要签出的项目,后面emacs指明要将文件签出到本地机器目录 ~/emacs 中。


3. 编译、安装
建立目录:/usr/local/emacs23, 将emacs装到这里
mkdir /usr/local/emacs23
注:最好指定一个安装目录,要不然编译出来的binary会被分散装到不同的地方,Emacs的目录结构本来就不简单,这样以来更加让人晕了。

cd  ~/emacs
./configure --prefix=/usr/local/emacs23 --enable-font-backend --with-xft --with-freetype --with-x-toolkit=gtk
    参数解释:
    --prefix=/usr/local/emacs23 指定emacs安装在/usr/local/emacs23
    --enable-font-backend 让emacs支持雅黑字体
    --with-freetype 支持freetype字体
    --with-x-toolkit=gtk 指定环境为gtk


可能会提示下面的内容:
******************************************************************
* *
* The Emacs "emacs-unicode-2" branch has been merged into *
* the CVS trunk, and is now obsolete. You should probably *
* use the CVS trunk instead. *
* *
* To switch a CVS checkout to the trunk, use the command: *
* *
* cvs update -A *
* *
******************************************************************

原因是最近emacs-unicode-2已经移到trunk下了。 按照提示,执行命令

cvs update -A

如果网速慢的话这一步可能会运行半天,慢慢等吧;
更新完成后,重新编译:


./configure --prefix=/usr/local/emacs23 --enable-font-backend --with-xft --with-freetype --with-x-toolkit=gtk


没有错误则继续:
如果是第一次编译从 cvs Repository 中 check out 来的代码,则

make bootstrap
make info
     在src目录下会生成emacs程序,试运行一下 src/emacs -q,成功,然后
make install
make clean

4. 添加你的安装路径

这个Emacs23版本默认的安装路径是/usr/local,它被拆成好几块,分别存在以下目录中:
/usr/local/bin
/usr/local/share/emacs/VERSION/lisp
/usr/local/share/emacs/VERSION/etc
/usr/local/libexec/emacs/VERSION/CONFIGURATION-NAME
/usr/local/info
/usr/local/man/man1
如果你想把它安装到一个目录中,configure的时候使用--prefix=/yourpath 不过最后要在/usr/local/bin做一些链接

到目前为止,终端中直接输入emacs是不能启动emacs的因为/usr/local/emacs23 /bin不在PATH变量中
cd /usr/local/bin
ln -s /usr/local/emacs23/bin/* ./



在终端中输入emacs就可以启动emacs了。

以下是相关的链接:

http://hi.baidu.com/yilinghl/blog/item/f7d0ebdc4ac20da7cc1166d2.html
http://borderjs.blogspot.com/2007/08/emacsemacs.html
http://hi.baidu.com/fanfuns/blog/item/19d14e03686443723812bb55.html
http://forum.ubuntu.org.cn/viewtopic.php?f=68&t=18274&start=0
http://hi.baidu.com/
fanfuns/blog/item/19d14e03686443723812bb55.html
http://hi.baidu.com/davyup/blog/item/5e4c752b340e01ffe6cd4000.html
http://linux.chinaunix.net/techdoc/install/2007/09/01/966866.shtml

附件是一篇参考文献:

文件:Install_Emacs23_on_Ubuntu.pdf
大小:193KB
下载:下载






emacs shotcut


http://rainytooo.javaeye.com/blog/151381

http://ftp.gnu.org/gnu/windows/emacs/emacs-22.3-bin-i386.zip

emacs -nw 启动终端模式
光标移动
C-p   向上一行
C-n   向下一行
C-b   向后
C-f    向前

M-f    向前一个字
或者是单词之类的
M-b   向后一个字或者是单词之类的
M-a   到句首
M-e   到句尾
M-{   到段首
M-}   到段尾
M->   到缓冲首部
M-<   到缓冲尾部

C-l     重绘屏幕,并将光标所在行置于屏幕的中央
M-V   向前滚屏
C-v    向后滚屏
C-a    到行首
C-e    到行尾
C-x [  到页首
C-x ]  到页尾

 

重复执行操作 C-u +数字+操作

编辑操作


C-x u   撤消

C-x b   转到下一个缓冲区

 

区域是Mark和Point之间的部分,Point就是光标的左下角,Mark由命令设置。 `Yanking ring'是一个存放文本的地方,从这里你可以拷贝删除(kill)的文本。 `Yanking'表示插入刚刚删除(kill)的文本。

M-w    复制区域

C-x h   将整个缓冲区设置为区域

C-y      粘贴最后一个区域中的文本到当前缓冲区

M-y     在C-y之后 多次执行M-y粘贴其他区域到缓冲替代当前区域

C-@     设置mark

C-x C-x 交换mark和point

C-o     在光标处增加一行

C-x C-o  删除光标周围的空行 第二次全部删除


 


 

 

窗口和文件操作

 

C-x k   删除缓冲区

C-x 1   删除其他窗口

C-x 2   水平分割窗口

C-x 3   垂直分割窗口

 

C-x o   光标到令一个窗口

C-x 0   去掉此窗口

 

目录操作

 

  [*] 作用在已标记的所有文件(目录)或光标所在当前文件(目录)上。
[p] 用前缀参数表示文件个数,从当前文件开始,正数向下、负数向上。
[u] 用前缀参数改变默认行为。对于设置标记的命令一般变为去掉标记。
[x] 需要加载 dired-x。

C-x d     或者     M-x dired ,可以进入dired-mode

n, p, SPC 上、下移动光标 [p]

C-n, C-p  上、下移动光标 [p]

 

^ 访问目录的父目录,若有前缀参数在另外的窗口中打开 [u]

 

<, > 缓冲中的目录行间上下移动 [p]

C-M-p, C-M-n 缓冲中的子目录间移动 [p]

C-M-u 缓冲中的目录树上移动 [p]

 

http://www.gnu.org/prep/ftp.html

California Mirrors

ftp://mirrors.kernel.org/gnu/emacs/

ftp://ftp.keystealth.org/pub/gnu/gnu/

ftp://mirrors.usc.edu/pub/gnu/

 

Emacs中文化指南

http://man.chinaunix.net/newsoft/Emac/book.html

 

Emacs下配置Java开发环境

http://longgue.javaeye.com/blog/158784

 

Emacs下进行Java开发一般是通过JDEE的lisp软件包的安装定制来完成的,所以需要获取相关的lisp包,并定制.emacs文件;所需的软件包是:

JDEE:
CEDET:
Elib:
ECB:

sudo cd *.gz   /usr/share/emacs22/site-lisp
sudo chmod 755 /usr/share/emacs22/site-lisp
(touch ~/.emacs  第一次使用Emacs可能需要新建这个定制文件)


emacs  ~/.emacs 加入如下的内容:


;; 设置JDK目录
'(jde-jdk-registry (quote (("1.6.0_04" . "/usr/local/lib/jdk1.6.0_04"))))
;;------------------------------------------------------------------------------
;; Java Development Enviroment
;;------------------------------------------------------------------------------
(add-to-list 'load-path (expand-file-name "/usr/share/emacs22/site-lisp/jde-2.3.5.1/lisp"))
(add-to-list 'load-path (expand-file-name "/usr/share/emacs22/site-lisp/cedet-1.0pre4/common"))
(add-to-list 'load-path (expand-file-name "/usr/share/emacs22/site-lisp/elib-1.0"))
(add-to-list 'load-path (expand-file-name "/usr/share/emacs22/site-lisp/ecb-2.32"))
(load-file (expand-file-name "/usr/share/emacs22/site-lisp/cedet-1.0pre4/common/cedet.el"))
(load-file (expand-file-name "/usr/share/emacs22/site-lisp/ecb-2.32/ecb.el"))


;;------------------------------------------------------------------------------
;;(add-hook 'java-mode-hook 'turn-on-font-lock)
;;java 开发环境
(require 'font-lock)
(require 'cedet)
(require 'ecb)
(require 'ecb-autoloads)
(require 'jde)
;;



ctr+x  ctr+s
ctr+x  ctr+c


emacs ~/HelloWorld.java

Java代码 复制代码
  1. public   class  HelloWorld {  
  2.     public   static   void  main(String[] args) {  
  3.             System.out.println("Hello World !" );  
  4.     }  
  5. }  
Java代码
  1. public class HelloWorld {  
  2.     public static void main(String[] args) {  
  3.             System.out.println("Hello World !");  
  4.     }  
  5. }  
public class HelloWorld {
    public static void main(String[] args) {
	        System.out.println("Hello World !");
    }
}



ctr+x  ctr+s

C-c  C-c  C-c
进行编译,JDE提示JDK1.6.0_04不是JDK1.5,是否默认为JDK1.5,点击"yes",编译完成;
C-c   C-v   C-r
在emacs窗口下半部分就能看到"Hello World !"的输入结果了。

the end.

参考资料:

1.  到JDEE站点 下载相关的lisp软件包并参考相关的文档。

2. 到GNU Emacs站点 查阅相关的文档资料。

 

Emacs

Index of ftp://mirrors.kernel.org/gnu/emacs/

Up to higher level directory

Name Size Last Modified
windows 2008年09月07日03时30分00秒
File: emacs-22.3.tar.gz.sig 1 KB2008年09月05日16时34分00秒
File: emacs-22.3.tar.gz 38660 KB2008年09月05日16时34分00秒
File: emacs-22.2-22.3.xdelta.sig 1 KB2008年09月05日16时34分00秒
File: emacs-22.2-22.3.xdelta 1717 KB2008年09月05日16时34分00秒
File: emacs-22.2.tar.gz.sig 1 KB2008年03月26日00时00分00秒
File: emacs-22.2.tar.gz 37788 KB2008年03月26日00时00分00秒
File: emacs-22.1-22.2.xdelta.sig 1 KB2008年03月26日00时00分00秒
File: emacs-22.1-22.2.xdelta 2099 KB2008年03月26日00时00分00秒
File: emacs-22.1.tar.gz.sig 1 KB2007年06月02日00时00分00秒
File: emacs-22.1.tar.gz 37278 KB2007年06月02日00时00分00秒
File: leim-21.4.tar.gz.sig 1 KB2005年02月17日00时00分00秒
File: leim-21.4.tar.gz 3215 KB2005年02月17日00时00分00秒
File: emacs-21.4a.tar.gz.sig 1 KB2005年02月17日00时00分00秒
File: emacs-21.4a.tar.gz 19926 KB2005年02月17日00时00分00秒
File: elisp-manual-21-2.8.tar.gz 2399 KB2002年03月16日00时00分00秒
File: emacs-lisp-intro-README-2nd-edition 6 KB2001年12月17日00时00分00秒
File: emacs-lisp-intro-2.04.tar.gz 488 KB2001年12月17日00时00分00秒
File: README.olderversions 1 KB2001年01月25日00时00分00秒

 

asdfasdfdsafsa

 

Index of ftp://ftp.kernel.org/pub/

Up to higher level directory

Name Size Last Modified
RCS 2008年09月23日23时53分00秒
File: README 2 KB2007年08月05日00时00分00秒
File: README_ABOUT_BZ2_FILES 1 KB2003年03月18日00时00分00秒
dist 2005年07月22日00时00分00秒
File: index.html 3 KB2008年09月23日23时53分00秒
linux 2008年06月25日00时37分00秒
lost+found 1998年10月27日00时00分00秒
media 2008年09月23日23时35分00秒
scm 2008年06月02日18时27分00秒
site 2003年11月05日00时00分00秒
software 2005年04月17日00时00分00秒
tools 2008年04月30日22时31分00秒

 

asdfdasfsdfds

 

http://yingjacky.bloghome.cn/posts/46916.html

 

nano、gedit、kwrite、OpenOffice

 

dos 里 edit 工具


VIM

http://www.linuxsir.org/bbs/showthread.php?t=48231

lindows@ubuntu:~$ vi --version
...

系统 vimrc 文件: "$VIM/vimrc"
     用户 vimrc 文件: "$HOME/.vimrc"
      用户 exrc 文件: "$HOME/.exrc"
         $VIM 预设值: "/usr/share/vim"

...

http://forum.ubuntu.org.cn/viewtopic.php?f=50&t=130085&p=1088816#p1088816

标题: 为什么我的vi没有彩色显示?

解答: 装个VIM然后编写~/.vimrc文件,里面添加syntax enable或者 syntax on就有颜色了。

 

http://www.vim.org/download.php

ftp://ftp.vim.org/pub/vim/pc/gvim72.exe

ftp://ftp.vim.org/pub/vim/unix/vim-7.2.tar.bz2

ftp://ftp.vim.org/pub/vim/extra/vim-7.2-lang.tar.gz

进入vi的命令
vi filename :打开或新建文件,并将光标置于第一行首
vi +n filename :打开文件,并将光标置于第n行首
vi + filename :打开文件,并将光标置于最后一行首
vi +/pattern filename:打开文件,并将光标置于第一个与pattern匹配的串处
vi -r filename :在上次正用vi编辑时发生系统崩溃,恢复filename
vi filename....filename :打开多个文件,依次编辑

移动光标类命令
h :光标左移一个字符
l :光标右移一个字符
space:光标右移一个字符
Backspace:光标左移一个字符
k或Ctrl+p:光标上移一行
j或Ctrl+n :光标下移一行
Enter :光标下移一行
w或W :光标右移一个字至字首
b或B :光标左移一个字至字首
e或E :光标右移一个字j至字尾
) :光标移至句尾
( :光标移至句首
}:光标移至段落开头
{:光标移至段落结尾
nG:光标移至第n行首
n+:光标下移n行
n-:光标上移n行
n$:光标移至第n行尾
H :光标移至屏幕顶行
M :光标移至屏幕中间行
L :光标移至屏幕最后行
0:(注意是数字零)光标移至当前行首
$:光标移至当前行尾

屏幕翻滚类命令
Ctrl+u:向文件首翻半屏
Ctrl+d:向文件尾翻半屏
Ctrl+f:向文件尾翻一屏
Ctrl+b;向文件首翻一屏
nz:将第n行滚至屏幕顶部,不指定n时将当前行滚至屏幕顶部。

插入文本类命令
i :在光标前
I :在当前行首
a:光标后
A:在当前行尾
o:在当前行之下新开一行
O:在当前行之上新开一行
r:替换当前字符
R:替换当前字符及其后的字符,直至按ESC键
s:从当前光标位置处开始,以输入的文本替代指定数目的字符
S:删除指定数目的行,并以所输入文本代替之
ncw或nCW:修改指定数目的字
nCC:修改指定数目的行

删除命令
ndw或ndW:删除光标处开始及其后的n-1个字
do:删至行首
d$:删至行尾
ndd:删除当前行及其后n-1行
x或X:删除一个字符,x删除光标后的,而X删除光标前的
Ctrl+u:删除输入方式下所输入的文本

搜索及替换命令 :
/pattern:从光标开始处向文件尾搜索pattern
?pattern:从光标开始处向文件首搜索pattern
n:在同一方向重复上一次搜索命令
N:在反方向上重复上一次搜索命令
:s/p1/p2/g:将当前行中所有p1均用p2替代
:n1,n2s/p1/p2/g:将第n1至n2行中所有p1均用p2替代
:g/p1/s//p2/g:将文件中所有p1均用p2替换

选项设置
all:列出所有选项设置情况
term:设置终端类型
ignorance:在搜索中忽略大小写
list:显示制表位(Ctrl+I)和行尾标志($)
number:显示行号
report:显示由面向行的命令修改过的数目
terse:显示简短的警告信息
warn:在转到别的文件时若没保存当前文件则显示NO write信息
nomagic:允许在搜索模式中,使用前面不带“/”的特殊字符
nowrapscan:禁止vi在搜索到达文件两端时,又从另一端开始
mesg:允许vi显示其他用户用write写到自己终端上的信息

最后行方式命令
:n1,n2 co n3:将n1行到n2行之间的内容拷贝到第n3行下
:n1,n2 m n3:将n1行到n2行之间的内容移至到第n3行下
:n1,n2 d :将n1行到n2行之间的内容删除
:w :保存当前文件
:e filename:打开文件filename进行编辑
:x:保存当前文件并退出
:q:退出vi
:q!:不保存文件并退出vi
:!command:执行shell命令command
:n1,n2 w!command:将文件中n1行至n2行的内容作为command的输入并执行之,若不指
定n1,n2,则表示将整个文件内容作为command的输入
:r!command:将命令command的输出结果放到当前行 。

 


A free source code editing component for Win32 and GTK+ 

 

Scintilla SciTE

http://blog.donews.com/tinylee/archive/2005/10/26/602987.aspx

 

http://www.scintilla.org/SciTE.html

http://scintilla.sourceforge.net/index.html

windows version download

http://prdownloads.sourceforge.net/scintilla/wscite176.zip?download

 

 

 

Windows    GTK+/Linux   

Download

The license for using Scintilla or SciTE is similar to that of Python containing very few restrictions.

Release 1.76

Source Code

The source code package contains all of the source code for Scintilla and SciTE but no binary executable code and is available in

  • zip format (1720K) commonly used on Windows
  • tgz format (1500K) commonly used on Linux and compatible operating systems

Instructions for building on both Windows and Linux are included in the readme file.

Windows

Windows Executables

A full download (820K) includes the SciTE executable, any required DLLs, configuration files and documentation. After downloading the file, unzip it, and run SciTE.EXE. The files required to run SciTE are SciTE.EXE, SciLexer.DLL, and SciTEGlobal.properties and these are best located in one directory on the path.

A single file executable called Sc1 (510K) does not need any DLL or properties files as these are linked into the executable. You may still create properties files if you wish. Sc1.exe has been compressed with the UPX compressor so that it is a fast download. It does not need to be decompressed to be used.

Windows Installers

An installer that includes extensions contributed by Bruce Dodson.

An installer for SciTE on Windows that includes several languages. Part of the GNUWin project.

A distribution based on SciTE CVS snapshots which includes C++, Perl, PHP, Java and nncron APIs. Syntax highlighting for Perl, PHP and C++ differs from the original distribution and there are other cosmetic changes. Contributed by Serge Baranov.

GTK+ / Linux

Linux executable for Intel compatible processors

This binary release requires GTK+ 2.8 or later and was tested on Fedora Core 5. If you are using a Linux distribution more than a year old you probably need to install GTK+ 2.8 or rebuild SciTE to use your existing version of GTK+.

A full download (740K) includes the SciTE executable, configuration files and documentation. After downloading the file, gunzip and untar it, and run SciTE. The files required to run SciTE are SciTE which is best located on the path (I put it in /usr/local/bin) 40 properties files which should be located in the /usr/share/scite directory, and Sci48M.png which should be copied to /usr/share/pixmaps.

Debian Packages

Official Debian Packages are available from Apt. There is a package page .

Contributed by Aubin Paul.

Linux RPMs

Available from this site or from the SourceForge Scintilla project files .

Contributions by Tony Puglisi, Victor Soroka, Eran Man.

SciTE localised for other languages

SciTE can be and has been translated into other languages .

Previous versions can be downloaded from the history page .

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值