Quantcast
This blog will be deleted soon!
Nabble has scheduled this blog to be deleted on due to its inactivity.
Click on the button below if you want to save this blog from deletion.

Sharing from Brook

brookhong by brookhong @
kv.zip

K.vim features VIM with key-value instant search from external dictionary(in StarDict format) using an external command line tool -- `kv`, thus with it you can

* translate word from an oxford english dictionary
* get a quick referrence to some function of some kind of programming langugae
* get a quick help from you own dictionary, which you can build from a plain text file by `kv`


# Installation

1. get and build `kv` tool from https://github.com/brookhong/kv
1. put k.vim to your .vim/plugin folder
1. build or download dictionaries you need to some folder, and tell VIM where it is

    let g:kdbDir = $HOME.'/kdb'

I have shared some of my dictionaries here https://www.dropbox.com/sh/75leolu1dso27qn/lG7VSrv1l7

# Configuration

    " the plugin will scan this directory to create key mapping globally or specially for some type of file.
    let g:kdbDir = $HOME.'/kdb'
    " when press `<leader>,`, will translate word under the cursor, works for all kinds of files.
    let g:globalDBkeys = {
          \ 'oxford-gb' : '<leader>,',
          \ }
    " when press `K` in normal mode or `C-j` in insert mode, will get referrence of function under the cursor, works only for php file.
    " for file-type dictionaries, they must be named same as the file type.
    let g:localDBkeys = {
          \ 'php' : ['K', '<C-j>'],
          \ }

# Usage

For global dictionaries, with cursor on a word, press the key you set in `g:globalDBkeys` to search.
For file-type dictionaries, open a file, with cursor on a word, press the key you set in `g:localDBkeys` to search.
The result is displayed in a split window, you can close it by `<Space>,` in normal mode.


brookhong by brookhong @
brookhong by brookhong @
A command line tool to read text with Microsoft Speech API (SAPI), written by Brook Hong in 2008.
tts.zip

    tts [options] [text_to_read]
        -h       show this message.
        -I       interactive mode.
        -F       list all formats supported.
        -V       list all voices installed.
        -f <format index>        use the indexed format.
        -v <voice index>         use the indexed voice.
        -i <filename>    read from the file.
        -o <filename>    output to the .wav file.
        -l       output .lrc files.
        -t       convert to .mp3 file.
        -s <minutes>     split the output every X minutes, default by 5.

brookhong by brookhong @
brookhong by brookhong @
1. install grub2 on your MBR
    mount /dev/sda5 /mnt
    sudo /usr/sbin/grub-install --root-directory=/mnt/ /dev/sda

2. put linux mint iso file to C:

3. reboot and enter grub2, run command

    loopback loop (hd0,1)/linuxmint-201204-mate-cinnamon-dvd-64bit.iso
    linux (loop)/casper/vmlinuz fromiso=/dev/sda1/linuxmint-201204-mate-cinnamon-dvd-64bit.iso boot=live config live-media-path=/casper noeject --
    initrd (loop)/casper/initrd.lz
    boot
brookhong by brookhong @
I have learned and used many powerful tools of sorts, and VIM must be one the best and the most helpful tools for me. Many of them dispeared as time went by. But VIM lives, and still has its charm.

I started to use VIM from 2002. Now I can claim to be experienced user. I'd like to know what else tools that can help one(as programmer/software engineer) like VIM, except text editor, since I already have VIM.

Here I can list some other tool that helps me almost much as VIM --

GIT source code management
DiffMerge Diff tool with a nice GUI, on console, I used vimdiff.
Google Chrome I like its Console in developer tools, and its built-in support to userscript.

The tool must be used across platforms at least like Windows, Linux and Mac, and should be helpful to every developer regardless of what industry he/she works on.

What else can you list?
brookhong by brookhong @
For example, there is a function --

function s:Files()
...
endfunction

To set breakpoint for s:Files, you can use command --

:breakadd func 1 *Files

Here *File to match something like "<SNR>99_Files".
brookhong by brookhong @
Debug_PHP_with_Vim_and_XDebug.pdf

F5 to start debugger engine -- PHP-bap-LISN, means debugger engine has started, and being listening for incoming connection, bap means Break only At breakPoints, press F8 to toggle it.

* bap -- Break only At breakPoints
* bae -- Break At Entry

Press F5 to pick up one connection in queue to debug.


You are in debug mode now.


Press F1 to toggle help window.






brookhong by brookhong @
Issue --
cygwin warning:
 MS-DOS style path detected: c:/
 Preferred POSIX equivalent is: /cygdrive/c
 CYGWIN environment variable option "nodosfilewarning" turns off this warning.
 Consult the user's guide for more details about POSIX paths:
 http://cygwin.com/cygwin-ug-net/using.html#using-pathnames

Solution --
:debug Gdiff

https://github.com/tpope/vim-fugitive/issues/164
Debugging_Vim_Scripts
brookhong by brookhong @
export HISTCONTROL=ignoredups
New Post
feeds Feeds
brookhong RayDanille RogelioBauer FidelLe
DeonAnthony evelinfjacobson3 CamilaCase EarlWolfe
isalia TonyLynch VenusiStrickland KerrieVilla