Planet MySQL Planet MySQL: Meta Deutsch Español Français Italiano 日本語 Русский Português 中文
Showing entries 1 to 4

Displaying posts with tag: vim (reset)

Executing MySQL queries within VIM
+1 Vote Up -0Vote Down

I haven’t been using vim for very long, but I’ve gotten over the initial learning curve of getting used to the different editing modes. With some help from the guys in #vim on irc.freenode.net, I managed to get this gem:

map <C-d> :call SwitchDB()<CR>
:function SwitchDB()
: let g:current_db = input("Database > ")
:endfunction

map <C-m> :call Doquery()<CR>
:function Doquery()
: if !exists("g:current_db")
: call SwitchDB()
: endif
: let query_string = input(g:current_db . " > " )
: if query_string != ""
: exe "!mysql " . …









  [Read more...]
How To Add A File Extension To vim Syntax Highlighting
+1 Vote Up -0Vote Down

Today I was asked a question about defining custom extensions for vim syntax highlighting such that, for example, vim would know that example.lmx is actually of type xml and apply xml syntax highlighting to it. I know vim already automatically does it not just based on extension but by looking for certain strings inside the text, like <?xml but what if my file doesn't have such strings?

After digging around I found the solution. Add the following to ~/.vimrc (the vim configuration file):

…  [Read more...]
Trip to Zurich
+0 Vote Up -0Vote Down

I spent Thursday and Friday in Zurich, Switzerland visiting my friends Marcus and Caitlin and attending the Google Open Source Jam.

On Thursday, I arrived in the early afternoon in Zurich. Getting to Zurich from Siegburg is easy and takes less than five …

  [Read more...]
MySQL syntax highlighting in Vim
+1 Vote Up -0Vote Down

I didn't know such a thing exists.

kostja@bodhi:/usr/share/vim/vim70/syntax> ls -al mysql.vim 
-rw-r--r-- 1 root root 16078 2006-05-24 20:16 mysql.vim

kostja@bodhi:/usr/share/vim/vim70/syntax> head -7 mysql.vim 
" Vim syntax file
" Language:     mysql
" Maintainer:   Kenneth J. Pronovici <pronovic@ieee.org>
" Last Change:  $Date: 2004/06/13 20:12:39 $
" Filenames:    *.mysql
" URL:          ftp://cedar-solutions.com/software/mysql.vim
" Note:         The definitions below are taken from the mysql user manual as of April 2002, for version 3.23

To enable it in the editor:

:set filetype=mysql


Or, in your .vimrc to …



  [Read more...]
Showing entries 1 to 4

Planet MySQL © 1995, 2014, Oracle Corporation and/or its affiliates   Legal Policies | Your Privacy Rights | Terms of Use

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.