Posts

Showing posts with the label syntax

Oracle vim config

This page gives a pretty good overview of tweaks you can do, so I just want to re-gurgitate what I have done (from that site). Syntax Highlighting Grab the file:  http://www.datacraft.com/plnet/files/vim/syntax/plsql.vim , and save this in: ~/.vim/syntax/ Then edit your .vimrc file and add the following line (to auto detect the filetype based on the extension): au BufNewFile,BufRead *.fun,*.pks,*.pkb,*.sql,*.pls,*.plsql    set filetype=plsql Auto Indentation Grab the file:  http://www.datacraft.com/plnet/files/vim/indent/plsql.vim , and save this in ~/.vim/indent/ Then edit your .vimrc file and add the following line runtime! indent.vim .. Though, I prefer just to use auto indent - there are some special situations where it wont calculate the indentation correctly using the indentation file above. So this gives me the following in my .vimrc file: au BufNewFile,BufRead *.fun,*.pks,*.pkb,*.sql,*.pls,*.plsql set filetype=plsql au BufNewFile,...

Enhancing gedit for PL/SQL Development

Most text editors allow customisation of syntax highlighting and the like, and having recently moved to using gedit, thought i'd enhance it a bit. In a fresh installation, it already has reasonable support for oracle based keywords, but could do with a bit of an update. The object that does the syntax highlighting is gtksourceview - depending on the version of gedit, either version 2 or 3.  By going to the project page on gnome, you will see the howto for adding a new language:  https://live.gnome.org/Gedit/NewLanguage . (Linux only) Since package source code is typically in files with the extension pks and pkb, it is first necessary to update the system to recognise that those files are of the mime type text/x-sql (or a custom one if you really want). So, create an xml file with the following: <mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info"> <mime-type type="text/x-sql"> <comment>SQL Source including P...