vim中oracle数据库使用,[20141024]使用emacs连接使用oracle数据库

[20141024]使用emacs连接使用oracle数据库.txt

--前一阵子跟别人学习了使用emacs连接数据库.自己做一个简单记录.

1.首先需要安装emacs.这个步骤忽略.

2.使用emacs打开文件.

--我使用它在命令行没有文件.当然也可以有文件.

--首先学习如何退出,+x,+c,以免出错不知道如何出来,我不会使用它来编辑文件.

--                 +x,+s,保存文件.

3.连接oracle数据库:

有两种方法连接,实际上都是一样的调用sqlplus命令.

方法1: x,接着输入shell,出现shell提示符号.打入sqlplus命令就可以使用了.

方法2:

--x 接着输入sql-oracle,打入sql-o按键可以使用命令补全功能的.

--根据提示输入user,pass,database等信息.但是不能使用scott/tiger@orcl这样的格式.数据库格式可以使用ezconnect格式.

4.连接上后出现2个分离的屏幕.

--方法2会出现两个分离的窗口.

--按ctrl+x 1 关闭上面的屏幕.这样就好像putty登录linux,进入sqlplus的界面.3个也可以.

--现在开始使用了.

--设置linesize避免折行.避免sqlplus输出出现折行情况:

set linesize 2000

--打入x toggle-truncate-lines,关闭emacs的折行功能.好像再执行一个返回原样.

--也可以输入在.emacs文件中:(我不懂这些)

(setq-default truncate-lines t)

(setq truncate-partial-width-windows nil) ;; for vertically-split windows

5.打入命令就可以了.可以上下移动重复执行命令.

6.编辑想换行可以使用+j ,这样可以命令可以重复使用。如果你使用回车,再次执行会报错,使用+j写sql语句就没有问题.

7.如何退出:

+x ctrl+s 保存文件.

+x ctrl+c 退出.

--这样可以把操作的内容保存为一个文件.

--我个人还有一个小技巧,保存的文件可以使用vim打开这样查看非常方便,如果在emacs再次保存,在vim里面再次加载就ok了.

8.优点和缺点:

--缺点

--不能在里面使用edit命令,会出现乱码,调用emacs也没用.linux下。windows下没有这种问题。

--实际上没有rlwrap+sqlplus方便。

--优点

--可以使用编辑器上下左右移动。查看显示结果。输出的命令也可以回车执行。例子:

SCOTT@test01p> select 'select * from emp;' from dual ;

'SELECT*FROMEMP'

-----------------

select * from emp;

SCOTT@test01p> select * from emp;

....

9.感觉emacs太复杂了.我的.emacs设置:(保存在C:\Users\Administrator\AppData\Roaming目录下)

(custom-set-variables

;; custom-set-variables was added by Custom.

;; If you edit it by hand, you could mess it up, so be careful.

;; Your init file should contain only one such instance.

;; If there is more than one, they won't work right.

'(custom-enabled-themes (quote (manoj-dark)))

'(inhibit-startup-screen t))

(custom-set-faces

;; custom-set-faces was added by Custom.

;; If you edit it by hand, you could mess it up, so be careful.

;; Your init file should contain only one such instance.

;; If there is more than one, they won't work right.

'(default ((t (:family #("新宋体" 0 3 (charset chinese-gbk)) :foundry "outline" :slant normal :weight normal :height 115 :width normal)))))

;; add by lfree ,no wrap.

;; for vertically-split windows

(setq-default truncate-lines t)

(setq truncate-partial-width-windows nil)

;; set windows size

(setq default-frame-alist

'((height . 60) (width . 220) (menu-bar-lines . 20) (tool-bar-lines . 0)))

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
vim数据库连接插件,便于数据库SQL调试,支持几乎所有的常见数据库, For instructions on installing this file, type :help add-local-help |add-local-help| inside Vim. Homepage: http://vim.sourceforge.net/script.php?script_id=356 SourceForge: $Revision: 1.23 $ *dbext* *dbext.vim* *db_ext* *db_ext.vim* *database-extension* *pgsql* *mysql* *asa* *ase* *ingres* *interbase* *sqlite* *sqlsrv* *ora* *db2* 1. Overview |dbext-overview| 2. Installation |dbext-install| 3. Configuration |dbext-configure| 3.1 Displaying Results |dbext-configure-results| 3.2 Script Variables |dbext-configure-variables| 3.3 Database Specific Options |dbext-configure-options| 3.4 DB2 Modes |dbext-configure-db2| 4. Mappings and commands |dbext-mappings| 5. Adding new database types |dbext-newdb| 6. Prompting for input parameters |dbext-prompting| 7. Setting up connection information |dbext-connect| 7.1 Connection Parameters |dbext-connect-parameters| 7.2 Prompting for Parameters |dbext-connect-prompting| 7.3 Connection profiles |dbext-connect-profiles| 7.4 Connection information in modelines |dbext-connect-modelines| 7.5 Asking for connection parameters |dbext-connect-ask| 8. Creating mappings using dbext commands |dbext-in-mappings| 9. Object Completion |dbext-completion| 10. Listing Objects in the Database |dbext-list-objects| 11. Plugin integration |dbext-integration| 11.1 OMNI completion integration |dbext-omni-completion| 11.2 Intellisense integration |dbext-intellisense| 12. Filetype support |dbext-filetypes| 12.1 Using filetype support |dbext-filetypes-using| 12.2 Adding new filetypes |dbext-filetypes-adding| 13. Using SQL History |dbext-history| 14. Open Source |dbext-sourceforge| 15. Tutorial |dbext-tutorial| {Vi does not have any of this} ------------------------------------------------------------------------------ What's New *dbext-new* Version 4.20 New Features ------------ - Improved support for Cygwin. If you are using a Cygwin compiled Vim (on Windows) and are accessing Windows compiled binaries (i.e. sqlplus.exe) the binary will complain since it does not understand Unix path names. Added the option g:dbext_default_use_win32_filenames which allows you to indicate the binaries must use translated Windows paths instead. (Richard) - DBGetOption displays more information. Bug Fixes ------------ - SQL Server support had issues with the queries when running DBCompleteTable, DBCompleteProcedure, DBCompleteView which also affected the sqlcomplete.vim plugin included with Vim7 (Albie Janse van Rensburg). Version 4.10 New Features ------------ - Updated DBGetOption to additionally display a list of all database profiles and their types. All dbext options that have been overriden via the vimrc are also displayed. Bug Fixes ------------ - db2 support had issues with the queries when running DBCompleteTable, DBCompleteProcedure, DBCompleteView which also affected the sqlcomplete.vim plugin included with Vim7 (Peter Princz). - The documentation was still indicating there was a plugin dependency which has been removed with Vim7. Version 4.00 New Features ------------ - dbext.vim now requires Vim7. - dbext.vim required 2 additional plugins multvals and genutil to operate. These dependencies have been removed by taking advantage of the new Vim7 features (Lists and Dictionaries). - When using the DBCompleteTable, DBCompleteProcedure, DBCompleteView commands errors are displayed instead of silently ignored. This makes them more useful with the sqlComplete plugin (see |sql.txt|). - Added new option, dbext_default_MYSQL_version, for MySQL to indicate the version you using. - You can optionally define a function, DBextPostResult, in your .vimrc, this function will be called each time the result window is updated. This function can be used to do anything, for example, syntax highlighting the result set in the result window.

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值