atomcoder


Ⅰ. 插件描述

Atomcoder Development Environment

Ⅱ. 基本信息

创建日期:  2002-08-09
使用用户:  1
Github星:  1
插件作者:  Simon Chiu

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin '/atomcoder-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle '/atomcoder-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug '/atomcoder-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/vim-scripts/atomcoder-vim

Ⅳ. 文档说明

Atomcoder Vim Scripts

Problem:

  • with Vim map we cannot map "ab" if "a" is already mapped.
  • with Vim map there is no chance for correction if we made a typo.
  • with Vim map we need to prefix with Vim mapleader key as a lot of single characters are already mapped by default.

Solution:

  • rename the mappings using underscore "_" as prefix and suffix.
  • call a Vim command using argument like "java" or "javac" which in turns call a Vim function which calls the respective mapping.
  • map the Vim command to a special key like Enter key <CR>
  • after entering the argument like "java", press Enter key <CR> again to execute it
  • we may be able extend this to allow passing parameters like "build" to execute an external "ant build" command instead of mapping each Ant target.

Enter Vim commands like game cheat codes, press Enter then type command. Commands are entered in command line and not as maps. This means you could correct typing mistakes before invoking the command.

Just my various Vim settings, mappings, functions for Java Programming.

Press Enter (<CR>) invokes ":Vim" prompt in command line. ":Vim" calls the "Vim" function. Then type "lc<CR>" to line comment the current line (or highlighted lines) of Java, Vim, XML code. "<CR>nlc<CR>" will uncomment it.

Some ":Vim" commands:

  • tt - toggle tomcat
  • tr - tomcat shutdown tomcat startup
  • te - tomcat shutdown
  • cvsd - cvs diff on current file
  • cvsci - cvs ci
  • cvsru - :del % then cvs up
  • cvstF - cvs tag -F with hardcoded tag
  • cvsup - cvs up
  • cvsv - cvs up -p
  • cvslga - cvs log
  • cd - cd to directory containing current file

Some maps:

  • <F8> - :!ant work-webapp
  • <F9> - :!ant work-compile
  • p - works more like mswin <C-V> when text is highlighted
  • g/ - put current word in the "/ register so that a substring that matches it gets highligthed
  • g? - put current word in the "/ register so that a word that matches it gets highligthed
  • ZR :e!<CR>
  • ZU :up<CR>
  • ZZ <Nop>
  • ZD :bd!<CR>
  • ZC :bd<CR>

Java

  • typing "sout" in insert mode will expand to "System.out.println();" with cursor put in between "()"
  • "vmain" -> "public static void main(String[] args)"
  • "pst" -> "printStackTrace()"

添加新评论