Last active
August 29, 2015 14:09
-
-
Save DavidEGx/29a59f674174d6d1ff5c to your computer and use it in GitHub Desktop.
Mysql vim console with Conque
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" vim:fdm=marker | |
" Info {{{ | |
" Description: | |
" This vimrc starts a new mysql terminal automatically providing syntax | |
" highlighting and other features to the mysql client. | |
" Check the mappings to see some useful stuff. | |
" | |
" Installation: | |
" If you you are using vundle in your normal vim just copy this file to | |
" your ~ directory. Edit the file and change the colorscheme to one you | |
" have installed and then run: | |
" $ vi -u ~/.vimsql | |
" :BundleInstall | |
" :q | |
" $ vi -u ~/.vimsql | |
" | |
" Status: | |
" Works for me. | |
" | |
" Caveats: | |
" Don't use BundleClean. | |
"}}} | |
" Mouse and clipboard {{{ | |
set mouse=a " Enable mouse in all modes | |
set ttymouse=xterm2 | |
set clipboard=unnamedplus " Use system clipboard by default | |
" }}} | |
" Visual improvements {{{ | |
syntax on | |
set number " Show line numbers | |
set cursorline " Highlight line where the cursor is | |
set wildmenu " Improved command line completion | |
set listchars=tab:➟\ ,eol:⤦ " Cool characters when use set list | |
" }}} | |
" Bundle plugins {{{ | |
set rtp+=~/.vim/bundle/vundle/ | |
set nocompatible | |
filetype off | |
call vundle#begin() | |
Bundle 'DavidEGx/VimConqueForVundle' | |
call vundle#end() | |
filetype plugin indent on | |
" }}} | |
" Color scheme {{{ | |
set t_Co=256 | colorscheme xoria256 | |
"set t_Co=256 | colorscheme molokai | |
" }}} | |
" Start MySQL in Conque {{{ | |
" Probably this could be done easily :-\ | |
set updatetime=0 | |
augroup open_conque | |
autocmd! | |
autocmd CursorHold * call Open_conque() | |
function! Open_conque() | |
let g:ConqueTerm_CloseOnEnd = 1 | |
ConqueTerm mysql -u root -p123456 | |
set updatetime=4000 | |
autocmd! open_conque | |
endfunction | |
augroup END | |
" }}} | |
" MySQL specific mappings {{{ | |
" Quick wrap/nowrap switch | |
nnoremap <F2> :set wrap!<CR> | |
inoremap <F2> <esc>:set wrap!<CR>i | |
" Easy horizontal scroll with backspace and space | |
setlocal virtualedit=all | |
nnoremap <backspace> z5h | |
nnoremap <space> z5l | |
" Enters go to insert mode | |
nnoremap <enter> i | |
" }}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment