spf13-vim设置说明
2015-10-14 18:07
309 查看
README.markdown
spf13-vim:SteveFrancia'sVimDistribution
_________
______/_/|___/____(_)______
/__|'_\||_|||_\_____\\//||'_`_\
\__\|_)|_||___)|_____|\V/|||||||
|___/.__/|_||_|____/\_/|_|_||_||_|
|_|
spf13-vimisadistributionofvimpluginsandresourcesforVim,Gvimand
MacVim.
ItisagoodstartingpointforanyoneintendingtouseVIMfordevelopmentrunningequallywellonWindows,Linux,*nixandMac.
Thedistributioniscompletelycustomisableusinga
~/.vimrc.local,
~/.vimrc.bundles.local,and
~/.vimrc.before.localVimRCfiles.
UnliketraditionalVIMpluginstructure,whichsimilartoUNIXthrowsallfilesintocommondirectories,makingupdatingordisablingpluginsarealmess,spf13-vim3usesthe
keepthemuptodate.
Greatcarehasbeentakentoensurethateachpluginplaysnicelywithothers,andoptionalconfigurationhasbeenprovidedforwhatwebelieveisthemostefficientuse.
Lastly(andperhaps,mostimportantly)Itiscompletelycrossplatform.ItworkswellonWindows,LinuxandOSXwithoutanymodificationsoradditionalconfigurations.Ifyouareusing
Installation
Requirements
Tomakeallthepluginswork,specificallyneocomplete,youneed
vimwithlua.
Linux,*nix,MacOSXInstallation
Theeasiestwaytoinstallspf13-vimistouseourautomaticinstallerbysimplycopyingandpastingthefollowinglineintoaterminal.Thiswillinstallspf13-vimandbackupyourexistingvimconfiguration.Ifyouareupgradingfromapriorversion(before3.0)thisisalsotherecommendedinstallation.
RequiresGit1.7+andVim7.3+
curlhttps://j.mp/spf13-vim3-L>spf13-vim.sh&&shspf13-vim.sh
Ifyouhaveabash-compatibleshellyoucanrunthescriptdirectly:
sh<(curlhttps://j.mp/spf13-vim3-L)
InstallingonWindows
OnWindowsand*nixCurlarerequired.Also,ifyouhaven'tdonesoalready,you'llneedtoinstall
Vimand
commandprompt:
C:\>chocoinstallspf13-vim
Note:The
Ifyouwanttoinstall
Installingdependencies
InstallVim
AftertheinstallationofVimyoumustaddanewdirectorytoyourenvironmentvariablespathtomakeitworkwiththescriptinstallationofspf13.OpenVimandwritethefollowingcommand,itwillshowtheinstalleddirectory:
:echo$VIMRUNTIME
C:\ProgramFiles(X86)\Vim\vim74
Thenyouneedtoaddittoyourenvironmentvariablepath.Afterthattryexecute
vimwithincommandprompt(pressWin-R,type
cmd,pressEnter)andyou’llseethedefaultvimpage.
Installmsysgit
Afterinstallationtryrunninggit--versionwithincommandprompt(pressWin-R,type
cmd,pressEnter)tomakesureallgood:
C:\>git--version
gitversion1.7.4.msysgit.0
SetupCurl
InstructionsblatentlycopiedfromvundlereadmeInstallingCurlonWindowsiseasyasmsysgit!Butbeforeitcanbeusedwith
Vundleit'srequiredmake
curlrunincommandprompt.Theeasiestwayistocreate
curl.cmdwith
thiscontent
@remDonotuse"echooff"tonotaffectanychildcalls.
@setlocal
@remGettheabolutepathtotheparentdirectory,whichisassumedtobethe
@remGitinstallationroot.
@for/F"delims="%%Iin("%~dp0..")do@setgit_install_root=%%~fI
@setPATH=%git_install_root%\bin;%git_install_root%\mingw\bin;%PATH%
@ifnotexist"%HOME%"@setHOME=%HOMEDRIVE%%HOMEPATH%
@ifnotexist"%HOME%"@setHOME=%USERPROFILE%
@curl.exe%*
Andcopyitto
C:\ProgramFiles\Git\cmd\curl.cmd,assuming
msysgitwasinstalledto
c:\ProgramFiles\Git
toverifyallgood,run:
C:\>curl--version
curl7.21.1(i686-pc-mingw32)libcurl/7.21.1OpenSSL/0.9.8kzlib/1.2.3
Protocols:dictfileftpftpshttphttpsimapimapsldapldapspop3pop3srtspsmtpsmtpstelnettftp
Features:LargefileNTLMSSLSSPIlibz
Installingspf13-vimonWindows
Theeasiestwayistodownloadandrunthespf13-vim-windows-install.cmdfile.RemembertorunthisfileinAdministratorModeifyouwantthesymlinkstobecreatedsuccessfully.
Updatingtothelatestversion
Thesimpliest(andsafest)waytoupdateistosimplyreruntheinstaller.Itwillcompletelyandnondestructivelyupgradetothelatestversion.curlhttps://j.mp/spf13-vim3-L-o-|sh
Alternativelyyoucanmanuallyperformthefollowingsteps.Ifanythinghaschangedwiththestructureoftheconfigurationyouwillneedtocreatetheappropriatesymlinks.
cd$HOME/to/spf13-vim/
gitpull
vim+BundleInstall!+BundleClean+q
ForkmeonGitHub
I'malwayshappytotakepullrequestsfromothers.AgoodnumberofpeoplearealreadyAhighlyoptimized.vimrcconfigfile
The.vimrcfileissuitedtoprogramming.Itisextremelywellorganizedandfoldsinsections.Eachsectionislabeledandeachoptioniscommented.
Itfixesmanyoftheinconveniencesofvanillavimincluding
AsingleconfigcanbeusedacrossWindows,Macandlinux
Eliminatesswapandbackupfilesfromlitteringdirectories,preferringtostoreinacentrallocation.
Fixescommontyposlike:W,:Q,etc
SetupasolidsetofsettingsforFormatting(changetomeetyourneeds)
Setuptheinterfacetotakeadvantageofvim'sfeaturesincluding
omnicomplete
linenumbers
syntaxhighlighting
Abetterruler&statusline
&more
Configuringincludedplugins
Customization
Create~/.vimrc.localand
~/.gvimrc.localforanylocalcustomizations.
Forexample,tooverridethedefaultcolorschemes:
echocolorschemeir_black>>~/.vimrc.local
BeforeFile
Createa~/.vimrc.before.localfiletodefineanycustomizationsthatgetloaded
beforethespf13-vim
.vimrc.
Forexample,topreventautocdintoafiledirectory:
echoletg:spf13_no_autochdir=1>>~/.vimrc.before.local
Foralistofavailablespf13-vimspecificcustomizationoptions,lookatthe
~/.vimrc.beforefile.
ForkCustomization
Thereisanadditionaltierofcustomizationavailabletothosewhowanttomaintainaforkofspf13-vimspecializedforaparticulargroup.Theseuserscancreate.vimrc.forkand
.vimrc.bundles.forkfilesintherootoftheirfork.Theloadorderfortheconfigurationis:
.vimrc.before-spf13-vimbeforeconfiguration
.vimrc.before.fork-forkbeforeconfiguration
.vimrc.before.local-beforeuserconfiguration
.vimrc.bundles-spf13-vimbundleconfiguration
.vimrc.bundles.fork-forkbundleconfiguration
.vimrc.bundles.local-localuserbundleconfiguration
.vimrc-spf13-vimvimconfiguration
.vimrc.fork-forkvimconfiguration
.vimrc.local-localuserconfiguration
See
.vimrc.bundlesforspecificsonwhatoptionscanbesettooverridebundleconfiguration.See
.vimrc.beforeforspecificsonwhatoptionscanbeoverridden.Mostvimconfigurationoptionsshouldbesetinyour
.vimrc.forkfile,bundleconfigurationneedstobesetinyour
.vimrc.bundles.forkfile.
Youcanspecifythedefaultbundlesforyourforkusing
.vimrc.before.forkfile.Hereishowtocreateanexample
.vimrc.before.forkfileinaforkrepoforthedefaultbundles.
echoletg:spf13_bundle_groups=[\'general\',\'programming\',\'misc\',\'youcompleteme\']>>.vimrc.before.fork
Onceyouhavethisfileinyourrepo,onlythebundlesyouspecifiedwillbeinstalledduringthefirstinstallationofyourfork.
Youmayalsowanttoupdateyour
README.markdownfilesothatthe
bootstrap.shlinkpointstoyourrepositoryandyour
bootstrap.shfiletopulldownyourfork.
Foranexampleofaforkofspf13-vimthatprovidescustomizationinthismannersee
EasilyEditingYourConfiguration
<Leader>evopensanewtabcontainingthe.vimrcconfigurationfileslistedabove.Thismakesiteasiertogetanoverviewofyourconfigurationandmakecustomizations.
<Leader>svsourcesthe.vimrcfile,instantlyapplyingyourcustomizationstothecurrentlyrunningviminstance.
Thesetwomappingscanthemselvesbecustomizedbysettingthefollowingin.vimrc.before.local:
letg:spf13_edit_config_mapping='<Leader>ev'
letg:spf13_apply_config_mapping='<Leader>sv'
Plugins
spf13-vimcontainsacuratedsetofpopularvimplugins,colors,snippetsandsyntaxes.Greatcarehasbeenmadetoensurethatthesepluginsplaywelltogetherandhaveoptimalconfiguration.Addingnewplugins
Create~/.vimrc.bundles.localforanyadditionalbundles.
Toaddanewbundle,justaddonelineforeachbundleyouwanttoinstall.Thelineshouldstartwiththeword"Bundle"followedbyastringofeitherthevim.orgprojectnameorthegithubusername/githubprojectname.Forexample,thegithubproject
echoBundle\'spf13/vim-colors\'>>~/.vimrc.bundles.local
Oncenewpluginsareadded,theyhavetobeinstalled.
vim+BundleInstall!+BundleClean+q
Removing(disabling)anincludedplugin
Create~/.vimrc.localifitdoesn'talreadyexist.
AddtheUnBundlecommandtothisline.IttakesthesameinputastheBundleline,sosimplycopythelineyouwanttodisableandadd'Un'tothebeginning.
Forexample,disablingthe'AutoClose'and'scrooloose/syntastic'plugins
echoUnBundle\'AutoClose\'>>~/.vimrc.bundles.local
echoUnBundle\'scrooloose/syntastic\'>>~/.vimrc.bundles.local
Remembertorun':BundleClean!'afterthistoremovetheexistingdirectories
Hereareafewoftheplugins:
Undotree
Ifyouundochangesandthenmakeanewchange,inmosteditorsthechangesyouundidaregoneforever,astheirundo-historyisasimplelist.Sinceversion7.0vimusesanundo-treeinstead.Ifyoumakeanewchangeafterundoingchanges,anewbranchiscreatedinthattree.Combinedwithpersistentundo,thisisnearlyasflexibleandsafeasgit;-)
Undotreemakesthatfeaturemoreaccessiblebycreatingavisualrepresentationofsaidundo-tree.
QuickStartLaunchusing
<Leader>u.
NERDTree
NERDTreeisafileexplorerpluginthatprovides"projectdrawer"functionalitytoyourvimediting.Youcanlearnmoreaboutitwith:helpNERDTree.
QuickStartLaunchusing
<Leader>e.
Customizations:
Use
<C-E>totoggleNERDTree
Use
<leader>eor
<leader>nttoloadNERDTreeFindwhichopensNERDTreewherethecurrentfileislocated.
Hideclutter('.pyc','.git','.hg','.svn','.bzr')
TreatNERDTreemorelikeapanelthanasplit.
ctrlp
CtrlpreplacestheCommand-Tpluginwitha100%vimlplugin.Itprovidesanintuitiveandfastmechanismtoloadfilesfromthefilesystem(withregexandfuzzyfind),fromopenbuffers,andfromrecentlyusedfiles.QuickStartLaunchusing
<c-p>.
Surround
Thispluginisatoolfordealingwithpairsof"surroundings."Examplesofsurroundingsincludeparentheses,quotes,andHTMLtags.TheyarecloselyrelatedtowhatVimreferstoastext-objects.Providedaremappingstoallowforremoving,changing,andaddingsurroundings.
Detailsfollowontheexactsemantics,butfirst,considerthefollowingexamples.Anasterisk(*)isusedtodenotethecursorposition.
OldtextCommandNewtext~
"Hello*world!"ds"Helloworld!
[123+4*56]/2cs])(123+456)/2
"Lookma,I'm*HTML!"cs"<q><q>Lookma,I'mHTML!</q>
if*x>3{ysW(if(x>3){
my$str=*whee!;vllllS'my$str='whee!';
Forinstance,ifthecursorwasinside
"foobar",youcouldtype
cs"'toconvertthetextto
'foobar'.
There'salotmore,checkitoutat
:helpsurround
NERDCommenter
NERDCommenterallowsyoutowrangleyourcodecomments,regardlessoffiletype.Viewhelp:NERDCommenterorcheckoutmyposton
NERDCommenter.
QuickStartTogglecommentsusing
<Leader>c<space>inVisualorNormalmode.
neocomplete
Neocompleteisanamazingautocompletepluginwithadditionalsupportforsnippets.Itcancompletesimulatiouslyfromthedictionary,buffer,omnicompleteandsnippets.ThisistheonetruepluginthatbringsVimautocompleteonparwiththebesteditors.QuickStartJuststarttyping,itwillautocompletewherepossible
Customizations:
Automaticallypresenttheautocompletemenu
Supporttabandenterforautocomplete
<C-k>forcompletingsnippetsusing
Neosnippet.
YouCompleteMe
YouCompleteMeisanotheramazingcompletionengine.Itisslightlymoreinvolvedtosetupasitcontainsabinarycomponentthattheuserneedstocompilebeforeitwillwork.Asaresultofthishoweveritisveryfast.ToenableYouCompleteMeadd
youcompletemetoyourlistofgroupsbyoverridingitinyour
.vimrc.before.locallikeso:
letg:spf13_bundle_groups=['general','programming','misc','scala','youcompleteme']Thisisjustanexample.Remembertochoosetheothergroupsyouwanthere.
OnceyouhavedonethisyouwillneedtogetVundletograbthelatestcodefromgit.Youcandothisbycalling
:BundleInstall!.YoushouldseeYouCompleteMeinthelist.
Youwillnowhavethecodeinyourbundlesdirectoryandcanproceedtocompilethecore.Changetothedirectoryithasbeendownloadedto.Ifyouhaveavanillainstallthen
cd~/.spf13-vim-3/.vim/bundle/YouCompleteMe/shoulddothetrick.Youshouldseeafileinthisdirectorycalledinstall.sh.Thereareafewoptionstoconsiderbeforerunningtheinstaller:
Doyouwantclangsupport(ifyoudon'tknowwhatthisisthenyoulikelydon'tneedit)?
Doyouwanttolinkagainstalocallibclangorhavetheinstallerdownloadthelatestforyou?
Doyouwantsupportforc#viatheomnisharpserver?
Thepluginiswelldocumentedonthesitelinkedabove.Besuretogivethatareadandmakesureyouunderstandtheoptionsyourequire.
Forjavauserswantingtouseeclimbesuretoadd
letg:EclimCompletionMethod='omnifunc'toyour.vimrc.local.
Syntastic
Syntasticisasyntaxcheckingpluginthatrunsbuffersthroughexternalsyntaxcheckersastheyaresavedandopened.Ifsyntaxerrorsaredetected,theuserisnotifiedandishappybecausetheydidn'thavetocompiletheircodeorexecutetheirscripttofindthem.
AutoClose
AutoClosedoeswhatyouexpect.It'ssimple,ifyouopenabracket,paren,brace,quote,etc,itautomaticallyclosesit.Ithandlescurlyscorrectlyanddoesn'tgetinthewayofdoublecurliesforthingslikejinjaandtwig.Fugitive
Fugitiveaddspervasivegitsupporttogitdirectoriesinvim.Formoreinformation,use:helpfugitive
Use
:Gstatustoview
gitstatusandtype
-onanyfiletostageorunstageit.Type
ponafiletoenter
gitadd-pandstagespecifichunksinthefile.
Use
:Gdiffonanopenfiletoseewhatchangeshavebeenmadetothatfile
QuickStart
<leader>gstobringupgitstatus
Customizations:
<leader>gs:Gstatus
<leader>gd:Gdiff
<leader>gc:Gcommit
<leader>gb:Gblame
<leader>gl:Glog
<leader>gp:Gitpush
<leader>gw:Gwrite
:Git___willpassanythingalongtogit.
PIV
ThemostfeaturecompleteanduptodatePHPIntegrationforVimwithpropersupportforPHP5.3+includinglatestsyntax,functions,betterfoldsupport,etc.PIVprovides:
PHP5.3support
AutogenerationofPHPDoc(,pdon(function,variable,class)definitionline)
Autocompleteofclasses,functions,variables,constantsandlanguagekeywords
Betterindenting
FullPHPdocumentationmanual(hitKonanyfunctionforfulldocs)
Ack.vim
Ack.vimusesacktosearchinsidethecurrentdirectoryforapattern.Youcanlearnmoreaboutitwith:helpAck
QuickStart:Ack
Tabularize
TabularizeletsyoualignstatementsontheirequalsignsandothercharactersCustomizations:
<Leader>a=:Tabularize/=<CR>
<Leader>a::Tabularize/:<CR>
<Leader>a:::Tabularize/:\zs<CR>
<Leader>a,:Tabularize/,<CR>
<Leader>a<Bar>:Tabularize/<Bar><CR>
Tagbar
spf13-vimincludestheTagbarplugin.Thispluginrequiresexuberant-ctagsandwillautomaticallygeneratetagsforyouropenfiles.ItalsoprovidesapaneltonavigateeasilyviatagsQuickStart
CTRL-]whilethecursorisonakeyword(suchasafunctionname)tojumptoitsdefinition.
Customizations:spf13-vimbinds
<Leader>tttotogglethetagbarpanel
Note:Forfulllanguagesupport,run
brewinstallctagstoinstallexuberant-ctags.
Tip:Checkout
:helpctagsforinformationaboutVIM'sbuilt-inctagsupport.Tagnavigationcreatesastackwhichcantraversedvia
Ctrl-](tofindthesourceofatoken)and
Ctrl-T(tojumpbackuponelevel).
EasyMotion
EasyMotionprovidesaninteractivewaytousemotionsinVim.Itquicklymapseachpossiblejumpdestinationtoakeyallowingveryfastandstraightforwardmovement.
QuickStartEasyMotionistriggeredusingthenormalmovements,butprefixingthemwith
<leader><leader>
Forexamplethisscreenshotdemonstratespressing
,,w
Airline
Airlineprovidesalightweightthemablestatuslinewithnoexternaldependencies.Bydefaultthisconfigurationusesthesymbols‹and
›asseparatorsfordifferentstatuslinesectionsbutcanbeconfiguredtousethesamesymbolsas
Toenablepowerlinesymbolsfirstinstalloneofthe
PowerlineFontsorpatchyourfavoritefontusingtheprovidedinstructions.Configureyourterminal,MacVim,orGvimtousethedesiredfont.Finallyadd
letg:airline_powerline_fonts=1toyour
.vimrc.before.local.
AdditionalSyntaxes
spf13-vimshipswithafewadditionalsyntaxes:Markdown(boundto*.markdown,*.md,and*.mk)
Twig
Gitcommits(setyour
EDITORto
mvim-f)
AmazingColors
spf13-vimincludessolarizedand
spf13vimcolorpack:
ir_black
molokai
peaksea
Use
:colormolokaitoswitchtoacolorscheme.
TerminalVimuserswillbenefitfromsolarizingtheirterminalemulatorsandsettingsolarizedsupportto16colors:
letg:solarized_termcolors=16
colorsolarized
Terminalemulatorcolorschemes:
Snippets
Italsocontainsaverycompletesetofsnippetsforusewithsnipmateor
neocomplete.
IntrotoVIM
Here'ssometipsifyou'veneverusedVIMbefore:Tutorials
TypevimtutorintoashelltogothroughabriefinteractivetutorialinsideVIM.
Readtheslidesat
VIM:WalkingWithoutCrutches.
Modes
VIMhastwo(common)modes:insertmode-stuffyoutypeisaddedtothebuffer
normalmode-keysyouhitareinterpretedascommands
Toenterinsertmode,hit
i
Toexitinsertmode,hit
<ESC>
Usefulcommands
Use:qtoexitvim
Certaincommandsareprefixedwitha
<Leader>key,whichbydefaultmapsto
\.Spf13-vimuses
letmapleader=","tochangethisto
,whichisinaconsistentandconvenientlocation.
Keyboard
cheatsheet.
spf13-vim安装与使用
一、简介
spf13-vim是Vim插件与配置的一个发行版本,包含了一整套精心挑选的Vim插件,采用Vundle进行插件管理,并且可以通过下列文件进行个性化配置
~/.vimrc.local#个性化配置文件~/.vimrc.bundles.local#本地bundle配置文件~/.vimrc.before.local#早于spf13-vim加载的 个性化配置文件
参考:https://github.com/spf13/spf13-vim#fork-customization
二、安装
下面介绍两种安装方式
方式1:执行如下命令,即可完成安装
curlhttps://j.mp/spf13-vim3-L>spf13-vim.sh&&shspf13-vim.sh
方式2:通过文件:bootstrap.sh,步骤如下
1、新建目录与文件,如下:
mkdirspf13-vimcdspf13-vimvimbootstrap.shchmod+xbootstrap.sh./bootstrap.sh
文件:bootstrap.sh,内容如下
#!/usr/bin/envbash#Copyright2014SteveFrancia##LicensedundertheApacheLicense,Version2.0(the"License");#youmaynotusethisfileexceptincompliancewiththeLicense.#YoumayobtainacopyoftheLicenseat## http://www.apache.org/licenses/LICENSE-2.0##Unlessrequiredbyapplicable laworagreedtoinwriting,software#distributedundertheLicenseisdistributedonan"ASIS"BASIS,#WITHOUTWARRANTIESORCONDITIONSOFANYKIND,eitherexpressorimplied.#SeetheLicenseforthespecificlanguagegoverningpermissionsand#limitationsundertheLicense.############################SETUPPARAMETERSapp_name='spf13-vim'app_dir="$HOME/.spf13-vim-3"[-z"$git_uri"]&&git_uri='https://github.com/spf13/spf13-vim.git'git_branch='3.0'debug_mode='0'fork_maintainer='0'[-z"$VUNDLE_URI"]&&VUNDLE_URI="https://github.com/gmarik/vundle.git"############################BASICSETUPTOOLSmsg(){printf'%b/n'"$1">&2}success(){if["$ret"-eq'0'];thenmsg"/e[32m[✔]/e[0m${1}${2}"fi}error(){msg"/e[31m[✘]/e[0m${1}${2}"exit1}debug(){if["$debug_mode"-eq'1']&&["$ret"-gt'1'];thenmsg"Anerroroccurredinfunction/"${FUNCNAME[$i+1]}/"on line${BASH_LINENO[$i+1]},we'resorryforthat."fi}program_exists(){localret='0'type$1>/dev/null2>&1||{localret='1';}#throwerroronnon-zeroreturnvalueif[!"$ret"-eq'0'];thenerror"$2"fi}variable_set(){if[-z"$1"];thenerror"YoumusthaveyourHOMEenvironmentalvariablesettocontinue."fi}############################SETUPFUNCTIONSlnif(){if[-e"$1"];thenln-sf"$1""$2"firet="$?"debug}do_backup(){if[-e"$2"]||[-e"$3"]||[-e"$4"];thentoday=`date+%Y%m%d_%s`foriin"$2""$3""$4";do[-e"$i"]&&[!-L"$i"]&&mv"$i""$i.$today";doneret="$?"success"$1"debugfi}upgrade_repo(){msg"tryingtoupdate$1"if["$1"="$app_name"];thencd"$app_dir"&&gitpullorigin"$git_branch"fiif["$1"="vundle"];thencd"$HOME/.vim/bundle/vundle"&&gitpullorigin masterfiret="$?"success"$2"debug}clone_repo(){program_exists"git""Sorry,wecannotcontinuewithoutGIT,pleaseinstallitfirst."if[!-e"$app_dir"];thengitclone--recursive-b"$git_branch""$git_uri""$app_dir"ret="$?"success"$1"debugelseupgrade_repo"$app_name""Successfullyupdated$app_name"fi}clone_vundle(){if[!-e"$HOME/.vim/bundle/vundle"];thengitclone$VUNDLE_URI"$HOME/.vim/bundle/vundle"elseupgrade_repo"vundle""Successfullyupdatedvundle"firet="$?"success"$1"debug}create_symlinks(){endpath="$app_dir"if[!-d"$endpath/.vim/bundle"];thenmkdir-p"$endpath/.vim/bundle"filnif"$endpath/.vimrc""$HOME/.vimrc"lnif"$endpath/.vimrc.bundles""$HOME/. vimrc.bundles"lnif"$endpath/.vimrc.before""$HOME/.vimrc.before"lnif"$endpath/.vim""$HOME/.vim"#Usefulforforkmaintainerstouch"$HOME/.vimrc.local"if[-e"$endpath/.vimrc.fork"];thenln-sf"$endpath/.vimrc.fork""$HOME/.vimrc.fork"elif["$fork_maintainer"-eq'1'];thentouch"$HOME/.vimrc.fork"touch"$HOME/.vimrc.bundles.fork" touch"$HOME/.vimrc.before.fork"fiif[-e"$endpath/.vimrc.bundles.fork"];thenln-sf"$endpath/.vimrc.bundles.fork""$HOME/. vimrc.bundles.fork"fiif[-e"$endpath/.vimrc.before.fork"];thenln-sf"$endpath/.vimrc.before.fork""$HOME/.vimrc.before.fork"firet="$?"success"$1"debug}setup_vundle(){system_shell="$SHELL"exportSHELL='/bin/sh'vim/-u"$app_dir/.vimrc.bundles.default"/"+setnomore"/"+BundleInstall!"/"+BundleClean"/"+qall"exportSHELL="$system_ shell"success"$1"debug}############################MAIN()variable_set"$HOME"program_exists" vim""Toinstall$app_nameyoufirstneedtoinstallVim."do_backup"Youroldvimstuffhasasuffixnowandlookslike.vim.`date+%Y%m%d%S`"/"$HOME/.vim"/"$HOME/.vimrc"/"$HOME/.gvimrc"clone_repo"Successfullycloned$app_name"create_symlinks"Settingupvimsymlinks"clone_vundle"Successfullyclonedvundle"setup_vundle"Nowupdating/installingpluginsusingVundle"msg"/nThanksforinstalling$app_name."msg"©`date+%Y` http://href="http://cpro.baidu.com/cpro/ui/uijs.php?adclass=0&app_id=0&c=news&cf=1001&ch=0&di=128&fv=18&is_app=0&jk=5da9ead942a8a5d0&k=vim&k0=vim&kdi0=0&luki=9&n=10&p=baidu&q=smileking_cpr&rb=0&rs=1&seller_id=1&sid=d0a5a842d9eaa95d&ssp2=1&stid=0&t=tpclicked3_hc&td=1682280&tu=u1682280&u=http%3A%2F%2Fwww%2Eth7%2Ecn%2Fsystem%2Flin%2F201504%2F101833%2Eshtml&urlid=0"target=_blank>vim.spf13.com/"
2、执行如下命令,进行安装
./bootstrap.sh
报错如下
解决办法:重新安装Git-1.8.5,即可
再次执行命令
./bootstrap.sh
报错如下:
解决办法:
cd~vim.vimrc.bundles.default#内容如下"DefaultBundles{"Usebeforeconfigifavailable{iffilereadable(expand("~/.vimrc.before"))source~/.vimrc.beforeendif"}"Usebundlesconfig{iffilereadable(expand("~/.vimrc.bundles"))source~/.vimrc.bundlesendif"}"}
3、重新运行,即可完成安装
./bootstrap.sh
三、插件管理
1、配置并安装插件
echoBundle/'spf13/vim-colors/'>>~/.vimrc.bundles.local#插件:vim-colors,需首先在文件.vimrc.bundles.local中进行配置vim+BundleInstall!+BundleClean+q#安装
2、卸载插件
echoUnBundle/'AutoClose/'>>~/.vimrc.local#卸载插件:AutoCloseechoUnBundle/'scrooloose/syntastic/'>>~/.vimrc.local#卸载插件:scrooloose/syntastic
进入Vim,执行如下命令
:BundleClean#删除原插件目录
相关文章推荐
- 远程桌面无法复制 或 剪贴板
- Struts2返回JSON对象的方法总结
- 一张图解析如何让img垂直居中对齐
- iOS8 LaunchScreen.storyboard
- UICollectionView
- 分页控件:pager-taglib与SpringMVC结合实例2
- 安装 Oh My Zsh 插件
- Java 集合(Collection)
- FineUI开源版之TreeGrid实现
- oracle 第08章 用户、权限、角色管理
- 微信-.NET调用JS-SDK
- Android Canvas不能换行,或者不识别\n,\r\n的解决方案
- 2.5 范数
- git使用之一——git的基本使用
- opencv在vs2013下的环境搭建
- Android ExpandableListView的特殊使用——始终展开不收缩
- Git action (Push Pull Clone) 避免输入用户名和密码方法
- 网络通信三要素:IP、端口、协议
- 《Head First 设计模式》学习笔记——命令模式
- 黑板课爬虫闯关第一关