﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-New-最新评论</title><link>http://www.blogjava.net/cuke/CommentsRSS.aspx</link><description /><language>zh-cn</language><pubDate>Thu, 15 Dec 2011 05:35:38 GMT</pubDate><lastBuildDate>Thu, 15 Dec 2011 05:35:38 GMT</lastBuildDate><generator>cnblogs</generator><item><title>re: java笔记</title><link>http://www.blogjava.net/cuke/archive/2011/11/24/364758.html#364761</link><dc:creator>H.C</dc:creator><author>H.C</author><pubDate>Thu, 24 Nov 2011 10:07:00 GMT</pubDate><guid>http://www.blogjava.net/cuke/archive/2011/11/24/364758.html#364761</guid><description><![CDATA[JRadioButton 二选一<br><br>加入Buttongroup<br><br><br>触发组件的监听<br>   public void actionPerformed(ActionEvent e){<br>if(jrbBox.isSelected()){<br>System.out.println(&quot;你选择了：&quot;+jrbBox.getText());<br>}<br>if(jrbGirl .isSelected()){<br>System.out.println(&quot;你选择了：&quot;+jrbGirl .getText());<br>} <img src ="http://www.blogjava.net/cuke/aggbug/364761.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/cuke/" target="_blank">H.C</a> 2011-11-24 18:07 <a href="http://www.blogjava.net/cuke/archive/2011/11/24/364758.html#364761#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: ubuntu 中文乱码</title><link>http://www.blogjava.net/cuke/archive/2011/11/12/363565.html#363567</link><dc:creator>H.C</dc:creator><author>H.C</author><pubDate>Sat, 12 Nov 2011 02:16:00 GMT</pubDate><guid>http://www.blogjava.net/cuke/archive/2011/11/12/363565.html#363567</guid><description><![CDATA[Ubuntu里面的环境配置文件：<br><br>（1）/etc/enviroment 是系统的环境变量。<br><br>（2）/etc/profile： 是所有用户的环境变量。当用户第一次登录时,该文件被执行. 并从/etc/profile.d目录的配置文件中搜集shell的设置。<br><br>（3）/etc/bashrc: 为每一个运行bash shell的用户执行此文件.当bash shell被打开时,该文件被读取。<br><br>（4）~/.bash_profile: 每个用户都可使用该文件输入专用于自己使用的shell信息,当用户登录时,该文件仅仅执行一次!默认情况下,他设置一些环境变量,执行用户的.bashrc文件。<br><br>（5）~/.bashrc: 该文件包含专用于你的bash shell的bash信息,当登录时以及每次打开新的shell时,该该文件被读取。<br><br>（6） ~/.bash_logout:当每次退出系统(退出bash shell)时,执行该文件. 另外,/etc/profile中设定的变量(全局)的可以作用于任何用户,而~/.bashrc等中设定的变量(局部)只能继承 /etc/profile中的变量,他们是”父子”关系。<br><br>（7）~/.bash_profile 是交互式、login 方式进入 bash 运行的~/.bashrc 是交互式 non-login 方式进入 bash 运行的通常二者设置大致相同，所以通常前者会调用后者。<img src ="http://www.blogjava.net/cuke/aggbug/363567.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/cuke/" target="_blank">H.C</a> 2011-11-12 10:16 <a href="http://www.blogjava.net/cuke/archive/2011/11/12/363565.html#363567#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: VIM for java IDE</title><link>http://www.blogjava.net/cuke/archive/2011/11/11/362411.html#363539</link><dc:creator>H.C</dc:creator><author>H.C</author><pubDate>Fri, 11 Nov 2011 08:25:00 GMT</pubDate><guid>http://www.blogjava.net/cuke/archive/2011/11/11/362411.html#363539</guid><description><![CDATA[需要用到的插件:<br><br>taglist需要ctags支持<br><br>ctags.exe：<a href="http://ctags.sourceforge.net/" target="_new">http://ctags.sourceforge.net/</a><br><br>taglist显示tag列表<br><br>taglist：<a href="http://www.vim.org/scripts/script.php?script_id=273" target="_new">http://www.vim.org/scripts/script.php?script_id=273</a><br><br>显示buf列表：<br><br>bufexplorer：<a href="http://www.vim.org/scripts/script.php?script_id=42" target="_new">http://www.vim.org/scripts/script.php?script_id=42</a><br><br>Nerd_Tree文件浏览<br><br>Nerd_tree：<a href="http://www.vim.org/scripts/script.php?script_id=1658" target="_new">http://www.vim.org/scripts/script.php?script_id=1658</a><br><br>界面管理插件：<br><br>winmanager：<a href="http://www.vim.org/scripts/script.php?script_id=95" target="_new">http://www.vim.org/scripts/script.php?script_id=95</a><br><br> <br><br>一、ctags：<br><br>下载解压后是源码，感觉就那个exe文件有点用。直接放到一个目录里，D:\ctags58。<br><br>设置一下环境变量。path=D:\ctags58。这样可以直接运行目录下面的ctags.exe文件。或者直接把ctags.exe放入windows的目录里。<br><br>vimrc中的设置：<br>view sourceprint?<br>1	&quot;生成一个tags文件<br>2	nmap &lt;F9&gt; &lt;Esc&gt;:!ctags -R *&lt;CR&gt;<br><br> <br><br>二、taglist设置：<br><br>下载解压到相应的vim文件夹中。<br><br>vimrc中设置：<br>view sourceprint?<br>01	&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br>02	 <br>03	&quot;设置Taglist<br>04	 <br>05	&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br>06	 <br>07	&quot; 这项必须设定，否则出错,配置taglist的ctags路径<br>08	 <br>09	let Tlist_Ctags_Cmd = 'D:\ctags58\ctags.exe'<br>10	 <br>11	  <br>12	 <br>13	&quot; 不同时显示多个文件的 tag ，只显示当前文件的<br>14	 <br>15	let Tlist_Show_One_File=1<br>16	 <br>17	  <br>18	 <br>19	&quot; 如果 taglist 窗口是最后一个窗口，则退出 vim<br>20	 <br>21	let Tlist_Exit_OnlyWindow=1<br>22	 <br>23	  <br>24	 <br>25	&quot;让当前不被编辑的文件的方法列表自动折叠起来<br>26	 <br>27	let Tlist_File_Fold_Auto_Close=1<br>28	 <br>29	  <br>30	 <br>31	&quot;把taglist窗口放在屏幕的右侧，缺省在左侧<br>32	 <br>33	let Tlist_Use_Right_Window=1<br>34	 <br>35	  <br>36	 <br>37	&quot;显示taglist菜单<br>38	 <br>39	let Tlist_Show_Menu=1<br>40	 <br>41	  <br>42	 <br>43	&quot;启动vim自动打开taglist<br>44	 <br>45	&quot;let Tlist_Auto_Open=1<br><br>启动自动打开这个选项暂时不设置。后面要让winmanager调用taglist。<br><br> <br><br>三、bufexplorer：<br><br>下载解压，没啥说的。<br><br> <br><br>四、winmanager：<br><br>下载解压，vimrc中的设置：<br>view sourceprint?<br>01	&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br>02	 <br>03	&quot;&quot; winManager setting<br>04	 <br>05	&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br>06	 <br>07	&quot;设置界面分割<br>08	 <br>09	&quot;let g:winManagerWindowLayout = &quot;BufExplorer,FileExplorer|TagList&quot;<br>10	 <br>11	let g:winManagerWindowLayout = &quot;TagList|FileExplorer,BufExplorer&quot;<br>12	 <br>13	  <br>14	 <br>15	&quot;设置winmanager的宽度，默认为25<br>16	 <br>17	let g:winManagerWidth = 30<br>18	 <br>19	  <br>20	 <br>21	&quot;定义打开关闭winmanager按键<br>22	 <br>23	nmap &lt;silent&gt; &lt;F8&gt; :WMToggle&lt;cr&gt;<br><br> <br><br>以上3个插件安装设置完毕后，基本的界面功能就可以实现了。按F8可以打开/关闭界面。同时显示taglist和fileexplorer。在fileexplorer窗口中按&lt;c-n&gt;可以切换到bufexplorer窗口。<br><br>上述设置好后，有3个问题：<br><br>1 我想让插件显示在右侧，但是winmanager里面没有此选项<br><br>2 进入vim时候不能自动打开winmanager，winmanager不像taglist支持该功能<br><br>3 退出时不会像只有taglist时候那样，退出当前文件就会退出vim了<br><br> 经过多次修改代码终于实在了上述3个功能。<br><br> <br><br>五、将插件显示在右侧<br><br>打开winmanager.vim，在function! &lt;SID&gt;StartWindowsManager()函数中修改：<br><br>将：wincmd H 修改为wincmd L：<br>view sourceprint?<br>1	&quot; for now assume that the explorer windows always stay on the left.<br>2	 <br>3	&quot; TODO: make this optional later<br>4	 <br>5	&quot; make the explorers window always stay on the right ---by chenyong<br>6	 <br>7	&quot;        wincmd H<br>8	 <br>9	wincmd L<br><br>  <br><br>六、进入vim自动打开winmanager<br><br>这个功能作为可选功能，我们可以在vimrc中设置：<br>view sourceprint?<br>1	&quot;在进入vim时自动打开winmanager<br>2	 <br>3	let g:AutoOpenWinManager = 1<br><br> 就可以让winmanager自动打开。<br><br>在winmanager.vim中修改：<br><br>view sourceprint?<br>1	&quot;set auto open Winmanager<br>2	 <br>3	if g:AutoOpenWinManager<br>4	 <br>5	autocmd VimEnter * nested call s:StartWindowsManager()|1wincmd w <br>6	 <br>7	endif<br><br> <br><br> 七、退出缓冲区时，自动退出vim<br><br>这个功能是参考了taglist的自动退出功能，在taglist.vim中修改的。<br><br>函数：function! s:Tlist_Window_Exit_Only_Window()中的winbunr(2)改为winbunr(3)，即只剩2个窗口时关闭，考虑到2个窗口肯定是同时存在，所以这样还是可行的：<br>view sourceprint?<br>01	function! s:Tlist_Window_Exit_Only_Window()<br>02	 <br>03	    &quot; Before quitting Vim, delete the taglist buffer so that<br>04	 <br>05	    &quot; the '0 mark is correctly set to the previous buffer.<br>06	 <br>07	    if v:version &lt; 700<br>08	 <br>09	    if winbufnr(3) == -1<br>10	 <br>11	        bdelete<br>12	 <br>13	        quit<br>14	 <br>15	    endif<br>16	 <br>17	    else<br>18	 <br>19	    if winbufnr(3) == -1<br>20	 <br>21	        if tabpagenr('$') == 1<br>22	 <br>23	           &quot; Only one tag page is present<br>24	 <br>25	           bdelete<br>26	 <br>27	           quit<br>28	 <br>29	        else<br>30	 <br>31	           &quot; More than one tab page is present. Close only the current<br>32	 <br>33	           &quot; tab page<br>34	 <br>35	           close<br>36	 <br>37	        endif<br>38	 <br>39	    endif<br>40	 <br>41	    endif<br>42	 <br>43	endfunction<br><br>同时在vimrc中需要设置：<br>view sourceprint?<br>1	let Tlist_Exit_OnlyWindow=1<br> <br><br> winmanager自带的fileexplorer这个插件实在是比较差。最重要的一点是fileexplorer不能自动更新，如果通过其他的途径修改了文件夹中的内容，fileexplorer是不会显示的。相对而言Nerd_Tree 功能就比较强大了。下面要把Nerd_Tree加入winmanager。<br><br>四、Nerd_tree：<br><br>下载解压，打开NERD_tree.vim，按照winmanager的说明，在最后加入下面代码：<br>view sourceprint?<br>01	&quot;Used by winmanager {{{1<br>02	 <br>03	let g:NERDTree_title = &quot;[NERDTree]&quot;<br>04	 <br>05	function! NERDTree_Start()<br>06	 <br>07	    exe 'NERDTree'<br>08	 <br>09	endfunction<br>10	 <br>11	  <br>12	 <br>13	 function! NERDTree_IsValid()<br>14	 <br>15	return 1<br>16	 <br>17	endfunction<br><br>同时把在vimrc中：<br>view sourceprint?<br>1	let g:winManagerWindowLayout='NERDTree|TagList,BufExplorer'<br><br>原来的设置注释掉。加好后，发现每次打开winmanager都会出现一个空白的buffer。试验了好多次，但是Nerd_tree调用的函数就是会打开一个新窗口。因为如此，将bufExplorer和NERD_Tree放在一起会显示不正常。NERD_Tree放在下面的窗口也会出错，实在比较郁闷。。。。看了下NERD_Tree的代码，没看懂，只好再次改winmanager的代码了。<br><br>打开winmanager.vim，找到函数function! &lt;SID&gt;ToggleWindowsManager()，加入两行，修改后整个函数如下：<br><br> <br><br> <br>view sourceprint?<br>01	&quot; toggle showing the explorer plugins.<br>02	function! &lt;SID&gt;ToggleWindowsManager()<br>03	    if IsWinManagerVisible()<br>04	        call s:CloseWindowsManager()<br>05	    else<br>06	        call s:StartWindowsManager()<br>07	&quot;        NERD_tree need this. 打开时会有一个空白窗口，要把他关闭。<br>08	        exe '1wincmd w'<br>09	        exe 'q'<br>10	    end<br>11	endfunction<br><br>  <br><br>加个注释，以免以后忘掉了，如果不想用nerd_Tree了，这2句话还得删掉。<br><br> <br><br>另外打开时的命令和关闭时的命令也得同时修改了，试验了很多次：<br><br>taglist.vim中，找到下面的代码：<br><br> <br>view sourceprint?<br>1	        &quot; Exit Vim itself if only the taglist window is present (optional)<br>2	&quot;        if g:Tlist_Exit_OnlyWindow<br>3	&quot;        autocmd BufEnter __Tag_List__ nested<br>4	&quot;            \ call s:Tlist_Window_Exit_Only_Window()<br>5	&quot;        endif<br><br>  <br><br>将这段代码修改为：<br><br> <br>view sourceprint?<br>01	&quot; Exit Vim itself if only the taglist window is present (optional)<br>02	 let s:NERDTreeBufName = 'NERD_tree_'<br>03	 if g:Tlist_Exit_OnlyWindow<br>04	     augroup Exit_onlywindow<br>05	         &quot;当进入Nerd_Tree的buffer时也检测是否需要退出<br>06	         exec &quot;autocmd BufEnter &quot;. s:NERDTreeBufName .<br>07	                     \&quot;* call s:Tlist_Window_Exit_Only_Window()&quot;<br>08	         autocmd BufEnter __Tag_List__ nested<br>09	             \ call s:Tlist_Window_Exit_Only_Window()<br>10	     augroup end<br>11	 endif<br><br> <br><br>winmanager中：刚才添加的自动执行命令要改为：<br><br> <br>view sourceprint?<br>1	&quot;set auto open Winmanager<br>2	if g:AutoOpenWinManager<br>3	&quot;    autocmd VimEnter * nested call s:StartWindowsManager()|1wincmd w <br>4	    autocmd VimEnter * nested call s:StartWindowsManager()|1wincmd w|q<br>5	endif<br><br>这样所有的功能就实现了。在taglist窗口使用ctrl+n可以转换到bufexplorer窗口。<img src ="http://www.blogjava.net/cuke/aggbug/363539.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/cuke/" target="_blank">H.C</a> 2011-11-11 16:25 <a href="http://www.blogjava.net/cuke/archive/2011/11/11/362411.html#363539#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: VIM for java IDE</title><link>http://www.blogjava.net/cuke/archive/2011/11/09/362411.html#363350</link><dc:creator>H.C</dc:creator><author>H.C</author><pubDate>Wed, 09 Nov 2011 13:52:00 GMT</pubDate><guid>http://www.blogjava.net/cuke/archive/2011/11/09/362411.html#363350</guid><description><![CDATA[&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br>&quot; Maintainer: amix the lucky stiff<br>&quot;             <a href="http://amix.dk" target="_new">http://amix.dk</a> - amix@amix.dk<br>&quot;<br>&quot; Version: 3.6 - 25/08/10 14:40:30<br>&quot;<br>&quot; Blog_post: <br>&quot;       <a href="http://amix.dk" target="_new">http://amix.dk</a>/blog/post/19486#The-ultimate-vim-configuration-vimrc<br>&quot; Syntax_highlighted:<br>&quot;       <a href="http://amix.dk" target="_new">http://amix.dk</a>/vim/vimrc.html<br>&quot; Raw_version: <br>&quot;       <a href="http://amix.dk" target="_new">http://amix.dk</a>/vim/vimrc.txt<br>&quot;<br>&quot; How_to_Install_on_Unix:<br>&quot;    $ mkdir ~/.vim_runtime<br>&quot;    $ svn co svn://orangoo.com/vim ~/.vim_runtime<br>&quot;    $ cat ~/.vim_runtime/install.sh<br>&quot;    $ sh ~/.vim_runtime/install.sh &lt;system&gt;<br>&quot;      &lt;sytem&gt; can be `mac`, `linux` or `windows`<br>&quot;<br>&quot; How_to_Upgrade:<br>&quot;    $ svn update ~/.vim_runtime<br>&quot;<br>&quot; Sections:<br>&quot;    -&gt; General<br>&quot;    -&gt; VIM user interface<br>&quot;    -&gt; Colors and Fonts<br>&quot;    -&gt; Files and backups<br>&quot;    -&gt; Text, tab and indent related<br>&quot;    -&gt; Visual mode related<br>&quot;    -&gt; Command mode related<br>&quot;    -&gt; Moving around, tabs and buffers<br>&quot;    -&gt; Statusline<br>&quot;    -&gt; Parenthesis/bracket expanding<br>&quot;    -&gt; General Abbrevs<br>&quot;    -&gt; Editing mappings<br>&quot;<br>&quot;    -&gt; Cope<br>&quot;    -&gt; Minibuffer plugin<br>&quot;    -&gt; Omni complete functions<br>&quot;    -&gt; Python section<br>&quot;    -&gt; JavaScript section<br>&quot;<br>&quot;<br>&quot; Plugins_Included:<br>&quot;     &gt; minibufexpl.vim - <a href="http://www.vim.org/scripts/script.php?script_id=159" target="_new">http://www.vim.org/scripts/script.php?script_id=159</a><br>&quot;       Makes it easy to get an overview of buffers:<br>&quot;           info -&gt; :e ~/.vim_runtime/plugin/minibufexpl.vim<br>&quot;<br>&quot;     &gt; bufexplorer - <a href="http://www.vim.org/scripts/script.php?script_id=42" target="_new">http://www.vim.org/scripts/script.php?script_id=42</a><br>&quot;       Makes it easy to switch between buffers:<br>&quot;           info -&gt; :help bufExplorer<br>&quot;<br>&quot;     &gt; yankring.vim - <a href="http://www.vim.org/scripts/script.php?script_id=1234" target="_new">http://www.vim.org/scripts/script.php?script_id=1234</a><br>&quot;       Emacs's killring, useful when using the clipboard:<br>&quot;           info -&gt; :help yankring<br>&quot;<br>&quot;     &gt; surround.vim - <a href="http://www.vim.org/scripts/script.php?script_id=1697" target="_new">http://www.vim.org/scripts/script.php?script_id=1697</a><br>&quot;       Makes it easy to work with surrounding text:<br>&quot;           info -&gt; :help surround<br>&quot;<br>&quot;     &gt; snipMate.vim - <a href="http://www.vim.org/scripts/script.php?script_id=2540" target="_new">http://www.vim.org/scripts/script.php?script_id=2540</a><br>&quot;       Snippets for many languages (similar to TextMate's):<br>&quot;           info -&gt; :help snipMate<br>&quot;<br>&quot;     &gt; mru.vim - <a href="http://www.vim.org/scripts/script.php?script_id=521" target="_new">http://www.vim.org/scripts/script.php?script_id=521</a><br>&quot;       Plugin to manage Most Recently Used (MRU) files:<br>&quot;           info -&gt; :e ~/.vim_runtime/plugin/mru.vim<br>&quot;<br>&quot;     &gt; Command-T - <a href="http://www.vim.org/scripts/script.php?script_id=3025" target="_new">http://www.vim.org/scripts/script.php?script_id=3025</a><br>&quot;       Command-T plug-in provides an extremely fast, intuitive mechanism for opening filesa:<br>&quot;           info -&gt; :help CommandT<br>&quot;           screencast and web-help -&gt; <a href="http://amix.dk" target="_new">http://amix.dk</a>/blog/post/19501<br>&quot;<br>&quot;<br>&quot;  Revisions:<br>&quot;     &gt; 3.6: Added lots of stuff (colors, Command-T, Vim 7.3 persistent undo etc.)<br>&quot;     &gt; 3.5: Paste mode is now shown in status line  if you are in paste mode<br>&quot;     &gt; 3.4: Added mru.vim<br>&quot;     &gt; 3.3: Added syntax highlighting for Mako mako.vim <br>&quot;     &gt; 3.2: Turned on python_highlight_all for better syntax<br>&quot;            highlighting for Python<br>&quot;     &gt; 3.1: Added revisions ;) and bufexplorer.vim<br>&quot;<br>&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br><br><br>&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br>&quot; =&gt; General<br>&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br>&quot; Sets how many lines of history VIM has to remember<br>set history=700<br><br>&quot; Enable filetype plugin<br>filetype plugin on<br>filetype indent on<br><br>&quot; Set to auto read when a file is changed from the outside<br>set autoread<br><br>&quot; With a map leader it's possible to do extra key combinations<br>&quot; like &lt;leader&gt;w saves the current file<br>let mapleader = &quot;,&quot;<br>let g:mapleader = &quot;,&quot;<br><br>&quot; Fast saving<br>nmap &lt;leader&gt;w :w!&lt;cr&gt;<br><br>&quot; Fast editing of the .vimrc<br>map &lt;leader&gt;e :e! ~/.vim_runtime/vimrc&lt;cr&gt;<br><br>&quot; When vimrc is edited, reload it<br>autocmd! bufwritepost vimrc source ~/.vim_runtime/vimrc<br><br><br>&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br>&quot; =&gt; VIM user interface<br>&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br>&quot; Set 7 lines to the curors - when moving vertical..<br>set so=7<br><br>set wildmenu &quot;Turn on WiLd menu<br><br>set ruler &quot;Always show current position<br><br>set cmdheight=2 &quot;The commandbar height<br><br>set hid &quot;Change buffer - without saving<br><br>&quot; Set backspace config<br>set backspace=eol,start,indent<br>set whichwrap+=&lt;,&gt;,h,l<br><br>set ignorecase &quot;Ignore case when searching<br>set smartcase<br><br>set hlsearch &quot;Highlight search things<br><br>set incsearch &quot;Make search act like search in modern browsers<br>set nolazyredraw &quot;Don't redraw while executing macros <br><br>set magic &quot;Set magic on, for regular expressions<br><br>set showmatch &quot;Show matching bracets when text indicator is over them<br>set mat=2 &quot;How many tenths of a second to blink<br><br>&quot; No sound on errors<br>set noerrorbells<br>set novisualbell<br>set t_vb=<br>set tm=500<br><br><br>&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br>&quot; =&gt; Colors and Fonts<br>&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br>syntax enable &quot;Enable syntax hl<br><br>&quot; Set font according to system<br>if MySys() == &quot;mac&quot;<br>  set gfn=Menlo:h14<br>  set shell=/bin/bash<br>elseif MySys() == &quot;windows&quot;<br>  set gfn=Bitstream\ Vera\ Sans\ Mono:h10<br>elseif MySys() == &quot;linux&quot;<br>  set gfn=Monospace\ 10<br>  set shell=/bin/bash<br>endif<br><br>if has(&quot;gui_running&quot;)<br>  set guioptions-=T<br>  set t_Co=256<br>  set background=dark<br>  colorscheme peaksea<br>  set nonu<br>else<br>  colorscheme zellner<br>  set background=dark<br><br>  set nonu<br>endif<br><br>set encoding=utf8<br>try<br>    lang en_US<br>catch<br>endtry<br><br>set ffs=unix,dos,mac &quot;Default file types<br><br><br>&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br>&quot; =&gt; Files, backups and undo<br>&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br>&quot; Turn backup off, since most stuff is in SVN, git anyway...<br>set nobackup<br>set nowb<br>set noswapfile<br><br>&quot;Persistent undo<br>try<br>    if MySys() == &quot;windows&quot;<br>      set undodir=C:\Windows\Temp<br>    else<br>      set undodir=~/.vim_runtime/undodir<br>    endif<br><br>    set undofile<br>catch<br>endtry<br><br><br>&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br>&quot; =&gt; Text, tab and indent related<br>&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br>set expandtab<br>set shiftwidth=4<br>set tabstop=4<br>set smarttab<br><br>set lbr<br>set tw=500<br><br>set ai &quot;Auto indent<br>set si &quot;Smart indet<br>set wrap &quot;Wrap lines<br><br><br>&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br>&quot; =&gt; Visual mode related<br>&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br>&quot; Really useful!<br>&quot;  In visual mode when you press * or # to search for the current selection<br>vnoremap &lt;silent&gt; * :call VisualSearch('f')&lt;CR&gt;<br>vnoremap &lt;silent&gt; # :call VisualSearch('b')&lt;CR&gt;<br><br>&quot; When you press gv you vimgrep after the selected text<br>vnoremap &lt;silent&gt; gv :call VisualSearch('gv')&lt;CR&gt;<br>map &lt;leader&gt;g :vimgrep // **/*.&lt;left&gt;&lt;left&gt;&lt;left&gt;&lt;left&gt;&lt;left&gt;&lt;left&gt;&lt;left&gt;<br><br><br>function! CmdLine(str)<br>    exe &quot;menu Foo.Bar :&quot; . a:str<br>    emenu Foo.Bar<br>    unmenu Foo<br>endfunction<br><br>&quot; From an idea by Michael Naumann<br>function! VisualSearch(direction) range<br>    let l:saved_reg = @&quot;<br>    execute &quot;normal! vgvy&quot;<br><br>    let l:pattern = escape(@&quot;, '\\/.*$^~[]')<br>    let l:pattern = substitute(l:pattern, &quot;\n$&quot;, &quot;&quot;, &quot;&quot;)<br><br>    if a:direction == 'b'<br>        execute &quot;normal ?&quot; . l:pattern . &quot;^M&quot;<br>    elseif a:direction == 'gv'<br>        call CmdLine(&quot;vimgrep &quot; . '/'. l:pattern . '/' . ' **/*.')<br>    elseif a:direction == 'f'<br>        execute &quot;normal /&quot; . l:pattern . &quot;^M&quot;<br>    endif<br><br>    let @/ = l:pattern<br>    let @&quot; = l:saved_reg<br>endfunction<br><br><br><br>&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br>&quot; =&gt; Command mode related<br>&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br>&quot; Smart mappings on the command line<br>cno $h e ~/<br>cno $d e ~/Desktop/<br>cno $j e ./<br>cno $c e &lt;C-\&gt;eCurrentFileDir(&quot;e&quot;)&lt;cr&gt;<br><br>&quot; $q is super useful when browsing on the command line<br>cno $q &lt;C-\&gt;eDeleteTillSlash()&lt;cr&gt;<br><br>&quot; Bash like keys for the command line<br>cnoremap &lt;C-A&gt;      &lt;Home&gt;<br>cnoremap &lt;C-E&gt;      &lt;End&gt;<br>cnoremap &lt;C-K&gt;      &lt;C-U&gt;<br><br>cnoremap &lt;C-P&gt; &lt;Up&gt;<br>cnoremap &lt;C-N&gt; &lt;Down&gt;<br><br>&quot; Useful on some European keyboards<br>map &#189; $<br>imap &#189; $<br>vmap &#189; $<br>cmap &#189; $<br><br><br>func! Cwd()<br>  let cwd = getcwd()<br>  return &quot;e &quot; . cwd <br>endfunc<br><br>func! DeleteTillSlash()<br>  let g:cmd = getcmdline()<br>  if MySys() == &quot;linux&quot; || MySys() == &quot;mac&quot;<br>    let g:cmd_edited = substitute(g:cmd, &quot;\\(.*\[/\]\\).*&quot;, &quot;\\1&quot;, &quot;&quot;)<br>  else<br>    let g:cmd_edited = substitute(g:cmd, &quot;\\(.*\[\\\\]\\).*&quot;, &quot;\\1&quot;, &quot;&quot;)<br>  endif<br>  if g:cmd == g:cmd_edited<br>    if MySys() == &quot;linux&quot; || MySys() == &quot;mac&quot;<br>      let g:cmd_edited = substitute(g:cmd, &quot;\\(.*\[/\]\\).*/&quot;, &quot;\\1&quot;, &quot;&quot;)<br>    else<br>      let g:cmd_edited = substitute(g:cmd, &quot;\\(.*\[\\\\\]\\).*\[\\\\\]&quot;, &quot;\\1&quot;, &quot;&quot;)<br>    endif<br>  endif<br>  return g:cmd_edited<br>endfunc<br><br>func! CurrentFileDir(cmd)<br>  return a:cmd . &quot; &quot; . expand(&quot;%:p:h&quot;) . &quot;/&quot;<br>endfunc<br><br><br>&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br>&quot; =&gt; Moving around, tabs and buffers<br>&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br>&quot; Map space to / (search) and c-space to ? (backgwards search)<br>map &lt;space&gt; /<br>map &lt;c-space&gt; ?<br>map &lt;silent&gt; &lt;leader&gt;&lt;cr&gt; :noh&lt;cr&gt;<br><br>&quot; Smart way to move btw. windows<br>map &lt;C-j&gt; &lt;C-W&gt;j<br>map &lt;C-k&gt; &lt;C-W&gt;k<br>map &lt;C-h&gt; &lt;C-W&gt;h<br>map &lt;C-l&gt; &lt;C-W&gt;l<br><br>&quot; Close the current buffer<br>map &lt;leader&gt;bd :Bclose&lt;cr&gt;<br><br>&quot; Close all the buffers<br>map &lt;leader&gt;ba :1,300 bd!&lt;cr&gt;<br><br>&quot; Use the arrows to something usefull<br>map &lt;right&gt; :bn&lt;cr&gt;<br>map &lt;left&gt; :bp&lt;cr&gt;<br><br>&quot; Tab configuration<br>map &lt;leader&gt;tn :tabnew&lt;cr&gt;<br>map &lt;leader&gt;te :tabedit<br>map &lt;leader&gt;tc :tabclose&lt;cr&gt;<br>map &lt;leader&gt;tm :tabmove<br><br>&quot; When pressing &lt;leader&gt;cd switch to the directory of the open buffer<br>map &lt;leader&gt;cd :cd %:p:h&lt;cr&gt;<br><br><br>command! Bclose call &lt;SID&gt;BufcloseCloseIt()<br>function! &lt;SID&gt;BufcloseCloseIt()<br>   let l:currentBufNum = bufnr(&quot;%&quot;)<br>   let l:alternateBufNum = bufnr(&quot;#&quot;)<br><br>   if buflisted(l:alternateBufNum)<br>     buffer #<br>   else<br>     bnext<br>   endif<br><br>   if bufnr(&quot;%&quot;) == l:currentBufNum<br>     new<br>   endif<br><br>   if buflisted(l:currentBufNum)<br>     execute(&quot;bdelete! &quot;.l:currentBufNum)<br>   endif<br>endfunction<br><br>&quot; Specify the behavior when switching between buffers <br>try<br>  set switchbuf=usetab<br>  set stal=2<br>catch<br>endtry<br><br><br>&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br>&quot; =&gt; Statusline<br>&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br>&quot; Always hide the statusline<br>set laststatus=2<br><br>&quot; Format the statusline<br>set statusline=\ %{HasPaste()}%F%m%r%h\ %w\ \ CWD:\ %r%{CurDir()}%h\ \ \ Line:\ %l/%L:%c<br><br><br>function! CurDir()<br>    let curdir = substitute(getcwd(), '/Users/amir/', &quot;~/&quot;, &quot;g&quot;)<br>    return curdir<br>endfunction<br><br>function! HasPaste()<br>    if &amp;paste<br>        return 'PASTE MODE  '<br>    else<br>        return ''<br>    endif<br>endfunction<br><br><br>&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br>&quot; =&gt; Parenthesis/bracket expanding<br>&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br>vnoremap $1 &lt;esc&gt;`&gt;a)&lt;esc&gt;`&lt;i(&lt;esc&gt;<br>vnoremap $2 &lt;esc&gt;`&gt;a]&lt;esc&gt;`&lt;i[&lt;esc&gt;<br>vnoremap $3 &lt;esc&gt;`&gt;a}&lt;esc&gt;`&lt;i{&lt;esc&gt;<br>vnoremap $$ &lt;esc&gt;`&gt;a&quot;&lt;esc&gt;`&lt;i&quot;&lt;esc&gt;<br>vnoremap $q &lt;esc&gt;`&gt;a'&lt;esc&gt;`&lt;i'&lt;esc&gt;<br>vnoremap $e &lt;esc&gt;`&gt;a&quot;&lt;esc&gt;`&lt;i&quot;&lt;esc&gt;<br><br>&quot; Map auto complete of (, &quot;, ', [<br>inoremap $1 ()&lt;esc&gt;i<br>inoremap $2 []&lt;esc&gt;i<br>inoremap $3 {}&lt;esc&gt;i<br>inoremap $4 {&lt;esc&gt;o}&lt;esc&gt;O<br>inoremap $q ''&lt;esc&gt;i<br>inoremap $e &quot;&quot;&lt;esc&gt;i<br>inoremap $t &lt;&gt;&lt;esc&gt;i<br><br><br>&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br>&quot; =&gt; General Abbrevs<br>&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br>iab xdate &lt;c-r&gt;=strftime(&quot;%d/%m/%y %H:%M:%S&quot;)&lt;cr&gt;<br><br><br>&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br>&quot; =&gt; Editing mappings<br>&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br>&quot;Remap VIM 0<br>map 0 ^<br><br>&quot;Move a line of text using ALT+[jk] or Comamnd+[jk] on mac<br>nmap &lt;M-j&gt; mz:m+&lt;cr&gt;`z<br>nmap &lt;M-k&gt; mz:m-2&lt;cr&gt;`z<br>vmap &lt;M-j&gt; :m'&gt;+&lt;cr&gt;`&lt;my`&gt;mzgv`yo`z<br>vmap &lt;M-k&gt; :m'&lt;-2&lt;cr&gt;`&gt;my`&lt;mzgv`yo`z<br><br>if MySys() == &quot;mac&quot;<br>  nmap &lt;D-j&gt; &lt;M-j&gt;<br>  nmap &lt;D-k&gt; &lt;M-k&gt;<br>  vmap &lt;D-j&gt; &lt;M-j&gt;<br>  vmap &lt;D-k&gt; &lt;M-k&gt;<br>endif<br><br>&quot;Delete trailing white space, useful for Python ;)<br>func! DeleteTrailingWS()<br>  exe &quot;normal mz&quot;<br>  %s/\s\+$//ge<br>  exe &quot;normal `z&quot;<br>endfunc<br>autocmd BufWrite *.py :call DeleteTrailingWS()<br><br>set guitablabel=%t<br><br><br>&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br>&quot; =&gt; Cope<br>&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br>&quot; Do :help cope if you are unsure what cope is. It's super useful!<br>map &lt;leader&gt;cc :botright cope&lt;cr&gt;<br>map &lt;leader&gt;n :cn&lt;cr&gt;<br>map &lt;leader&gt;p :cp&lt;cr&gt;<br><br><br>&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br>&quot; =&gt; bufExplorer plugin<br>&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br>let g:bufExplorerDefaultHelp=0<br>let g:bufExplorerShowRelativePath=1<br>map &lt;leader&gt;o :BufExplorer&lt;cr&gt;<br><br><br>&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br>&quot; =&gt; Minibuffer plugin<br>&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br>let g:miniBufExplModSelTarget = 1<br>let g:miniBufExplorerMoreThanOne = 2<br>let g:miniBufExplModSelTarget = 0<br>let g:miniBufExplUseSingleClick = 1<br>let g:miniBufExplMapWindowNavVim = 1<br>let g:miniBufExplVSplit = 25<br>let g:miniBufExplSplitBelow=1<br><br>let g:bufExplorerSortBy = &quot;name&quot;<br><br>autocmd BufRead,BufNew :call UMiniBufExplorer<br><br>map &lt;leader&gt;u :TMiniBufExplorer&lt;cr&gt;<br><br><br>&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br>&quot; =&gt; Omni complete functions<br>&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br>autocmd FileType css set omnifunc=csscomplete#CompleteCSS<br><br><br>&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br>&quot; =&gt; Spell checking<br>&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br>&quot;Pressing ,ss will toggle and untoggle spell checking<br>map &lt;leader&gt;ss :setlocal spell!&lt;cr&gt;<br><br>&quot;Shortcuts using &lt;leader&gt;<br>map &lt;leader&gt;sn ]s<br>map &lt;leader&gt;sp [s<br>map &lt;leader&gt;sa zg<br>map &lt;leader&gt;s? z=<br><br><br>&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br>&quot; =&gt; Python section<br>&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br>let python_highlight_all = 1<br>au FileType python syn keyword pythonDecorator True None False self<br><br>au BufNewFile,BufRead *.jinja set syntax=htmljinja<br>au BufNewFile,BufRead *.mako set ft=mako<br><br>au FileType python inoremap &lt;buffer&gt; $r return<br>au FileType python inoremap &lt;buffer&gt; $i import<br>au FileType python inoremap &lt;buffer&gt; $p print<br>au FileType python inoremap &lt;buffer&gt; $f #--- PH ----------------------------------------------&lt;esc&gt;FP2xi<br>au FileType python map &lt;buffer&gt; &lt;leader&gt;1 /class<br>au FileType python map &lt;buffer&gt; &lt;leader&gt;2 /def<br>au FileType python map &lt;buffer&gt; &lt;leader&gt;C ?class<br>au FileType python map &lt;buffer&gt; &lt;leader&gt;D ?def<br><br><br>&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br>&quot; =&gt; JavaScript section<br>&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br>au FileType javascript call JavaScriptFold()<br>au FileType javascript setl fen<br>au FileType javascript setl nocindent<br><br>au FileType javascript imap &lt;c-t&gt; AJS.log();&lt;esc&gt;hi<br>au FileType javascript imap &lt;c-a&gt; alert();&lt;esc&gt;hi<br><br>au FileType javascript inoremap &lt;buffer&gt; $r return<br>au FileType javascript inoremap &lt;buffer&gt; $f //--- PH ----------------------------------------------&lt;esc&gt;FP2xi<br><br>function! JavaScriptFold()<br>    setl foldmethod=syntax<br>    setl foldlevelstart=1<br>    syn region foldBraces start=/{/ end=/}/ transparent fold keepend extend<br><br>    function! FoldText()<br>    return substitute(getline(v:foldstart), '{.*', '{...}', '')<br>    endfunction<br>    setl foldtext=FoldText()<br>endfunction<br><br><br>&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br>&quot; =&gt; MRU plugin<br>&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br>let MRU_Max_Entries = 400<br>map &lt;leader&gt;f :MRU&lt;CR&gt;<br><br><br>&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br>&quot; =&gt; Command-T<br>&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br>let g:CommandTMaxHeight = 15<br>set wildignore+=*.o,*.obj,.git,*.pyc<br>noremap &lt;leader&gt;j :CommandT&lt;cr&gt;<br>noremap &lt;leader&gt;y :CommandTFlush&lt;cr&gt;<br><br><br>&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br>&quot; =&gt; Vim grep<br>&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br>let Grep_Skip_Dirs = 'RCS CVS SCCS .svn generated'<br>set grepprg=/bin/grep\ -nH<br><br><br><br>&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br>&quot; =&gt; MISC<br>&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br>&quot; Remove the Windows ^M - when the encodings gets messed up<br>noremap &lt;Leader&gt;m mmHmt:%s/&lt;C-V&gt;&lt;cr&gt;//ge&lt;cr&gt;'tzt'm<br><br>&quot;Quickly open a buffer for scripbble<br>map &lt;leader&gt;q :e ~/buffer&lt;cr&gt;<br>au BufRead,BufNewFile ~/buffer iab &lt;buffer&gt; xh1 ===========================================<br><br>map &lt;leader&gt;pp :setlocal paste!&lt;cr&gt;<br><br>map &lt;leader&gt;bb :cd ..&lt;cr&gt;<br><img src ="http://www.blogjava.net/cuke/aggbug/363350.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/cuke/" target="_blank">H.C</a> 2011-11-09 21:52 <a href="http://www.blogjava.net/cuke/archive/2011/11/09/362411.html#363350#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>