Windows平台Cmd工具Cmder
1. Cmder + Sublime 实现多Window共存
配置过程比较简单。
打开Cmder安装目录下的config文件夹下的aliases文件。
在aliases中增加一行,添加别名。
subl="D:\PROGRA~1\sublimeText3\sublime_text.exe" $1 -new_console:s50H
其中,subl为别名,后面是您的Sublime所在的路径,-new_console:s50H代表在新增的Tab中打开sublime,同时横向排列,占比50%, H表示Horizontal, 水平方向创建.
下面的操作也可以,我来添加sublime text 2的快捷方式,纵向分布,占比75%, V表示Vertical,垂直方向创建。
subl2="D:\PROGRA~1\sublimeText2\sublime_text.exe" $1 -new_console:s75V
注意,其中的路径有空格时, c:\progra1 替代 C:\Program Files, c:\progra2 替代 C:\Program Files (x86)。
如果想退出Sublime而保留Cmd, 将光标保持在Sublime上. 按下Alt+F+X, 你就能回到cmd上.
将Cmder添加到右键菜单
以管理员模式打开命令行提示符,cd到Cmder.exe目录下,执行
Cmder.exe /REGISTER ALL
给Vim添加插件
首当其冲的当然是强大的Vundle vim插件管理, Vundle在Windows的安装可以参考
Vundle for Windows.
- 安装Vundle for Windows前,需安装两个依赖,git和curl, 因为Cmder full版已经包含git,这里只需安装curl,安装curl最简单的方式是通过.cmd执行,只需将下面代码复制到C:\Program Files\Git\cmd\curl.cmd(没有则新建,touch curl.cmd)
@rem Do not use "echo off" to not affect any child calls.
@setlocal
@rem Get the abolute path to the parent directory, which is assumed to be the
@rem Git installation root.
@for /F "delims=" %%I in ("%~dp0..") do @set git_install_root=%%~fI
@set PATH=%git_install_root%\bin;%git_install_root%\mingw\bin;%git_install_root%\mingw64\bin;%PATH%
@rem !!!!!!! For 64bit msysgit, replace 'mingw' above with 'mingw64' !!!!!!!
@if not exist "%HOME%" @set HOME=%HOMEDRIVE%%HOMEPATH%
@if not exist "%HOME%" @set HOME=%USERPROFILE%
@curl.exe %*
注意:需要将上面的git_install_root替换为你的git安装根目录,然后验证curl是否安装成功
C:\> curl --version
curl 7.21.1 (i686-pc-mingw32) libcurl/7.21.1 OpenSSL/0.9.8k zlib/1.2.3
Protocols: dict file ftp ftps http https imap imaps ldap ldaps pop3 pop3s rtsp smtp smtps telnet tftp
Features: Largefile NTLM SSL SSPI libz
在命令行执行
cd %USERPROFILE%
git clone https://github.com/gmarik/Vundle.vim.git %USERPROFILE%/vimfiles/bundle/Vundle.vim
gvim _vimrc
如果没安装gvim,可以使用vim替换
- 接下来修改.vimrc配置文件, 将下面Vundle 例子配置文件复制到.vimrc中
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.
" plugin on GitHub repo
Plugin 'tpope/vim-fugitive'
" plugin from http://vim-scripts.org/vim/scripts.html
Plugin 'L9'
" Git plugin not hosted on GitHub
Plugin 'git://git.wincent.com/command-t.git'
" git repos on your local machine (i.e. when working on your own plugin)
Plugin 'file:///home/gmarik/path/to/plugin'
" The sparkup vim script is in a subdirectory of this repo called vim.
" Pass the path to set the runtimepath properly.
Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
" Install L9 and avoid a Naming conflict if you've already installed a
" different version somewhere else.
Plugin 'ascenator/L9', {'name': 'newL9'}
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
同时还需要将上面的
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
替换为
set rtp+=$HOME/vimfiles/bundle/Vundle.vim/
call vundle#begin('$USERPROFILE/vimfiles/bundle/')
注意:如果没有配置$HOME的环境变量,可以将上面的代码替换为
set rtp+=~/vimfiles/bundle/Vundle.vim/
call vundle#begin('~/vimfiles/bundle/')
Windows上出现Vundle 插件路径安装错误,需要修改Plugin ‘file:’为
Plugin 'file:///~/vimfiles/plugin'
可以参照 (Windows) Vundle installs plugins to wrong directory
现在,可以开始安装我们的Vim插件了
启动vim并运行
:PluginInstall
也可以通过命令行安装:
vim +PluginInstall +qall