" File: jvim.vim " Author: P.I.Julius (julius AT solutions-i DOT org) " Version: 1.0 " Last Modified: May 19, 2006 " " The "jVim plugin is a try to make vim a bit compatible with other source " editors. For e.g. in insert mode you'll have CTRL+C, CTRL+V, CTRL+Y, " SHIFT+ARROWS to select texts, and the best :) the auto complete popup menu " which is shown as you type. I like this feature, this one was the only " one which kept me from using vim, but now I'm a big vim fan :) " " You can get more info about the plugin here: " http://pijulius.blogspot.com/2006/05/jvimvim.html " " Installation " ------------ " Just copy the jvim.vim to your .vim/plugin/ directory and or restart vim or type: " :source ~/.vim/plugin/jvim.vim " Thats it. Enjoy and don't forget this is my first attempt to write a plugin, so any " feedback is more than welcome. " NOTE: I use a BMP font because I prefer to have sharp fonts when I code, so you may " have to change the guifont= below. " Startup settings " ---------------- set laststatus=2 set guifont=BmpCour\ 12 set foldcolumn=2 set foldenable set foldmethod=indent set nu set nowrap set ignorecase set lines=63 set columns=120 set guioptions-=T set spell " Load our color scheme " --------------------- "color jvim color blackdust " Some function definitions " ------------------------- function JNextBuffer() set hidden bn endfunction function JPrevBuffer() set hidden bp endfunction function JNewBuffer() set hidden enew endfunction function JVisual(command, mode) if a:mode == "i" normal v if a:command == "home" normal g0 elseif a:command == "end" normal g$ elseif a:command == "up" normal k elseif a:command == "down" normal j elseif a:command == "right" normal l elseif a:command == "left" normal h elseif a:command == "pageup" normal H elseif a:command == "pagedown" normal L endif elseif a:mode == "v" if a:command == "up" normal gv normal gk elseif a:command == "down" normal gv normal gj elseif a:command == "right" normal gv normal l elseif a:command == "left" normal gv normal h endif endif endfunction function JVisualCopy() normal gv normal "+y endfunction function JVisualPaste() normal p endfunction function JVisualDelete() normal gv normal x endfunction " Map some keys for better navigation " ----------------------------------- map :call JNextBuffer() map :call JPrevBuffer() map :call JNewBuffer() map :bdelete imap :d map map map imap :u imap :red imap vmap :call JVisualCopy() imap :call JVisualPaste() vmap :call JVisualDelete() vmap :call JVisualDelete() nmap :normal za " Maps for selection with shift " ----------------------------- imap :call JVisual("home", "i") imap :call JVisual("end", "i") imap :call JVisual("up", "i") imap :call JVisual("down", "i") imap :call JVisual("left", "i") imap :call JVisual("right", "i") imap :call JVisual("pageup", "i") imap :call JVisual("pagedown", "i") vmap :call JVisual("up", "v") vmap :call JVisual("down", "v") vmap :call JVisual("left", "v") vmap :call JVisual("right", "v") " Map all keys to Auto complete " ----------------------------- set complete=.,w,b,u,t let letter = "0" while letter <= "9" execute "imap " letter letter . "" let letter = nr2char(char2nr(letter)+1) endwhile let letter = "a" while letter <= "z" execute "imap " letter letter . "" let letter = nr2char(char2nr(letter)+1) endwhile