您的位置:首页 > 其它

spf13-vim设置说明

2015-10-14 18:07 309 查看
https://github.com/spf13/spf13-vim

README.markdown

spf13-vim:SteveFrancia'sVimDistribution

_________

______/_/|___/____(_)______

/__|'_\||_|||_\_____\\//||'_`_\

\__\|_)|_||___)|_____|\V/|||||||

|___/.__/|_||_|____/\_/|_|_||_||_|

|_|

spf13-vimisadistributionofvimpluginsandresourcesforVim,Gvimand
MacVim.

ItisagoodstartingpointforanyoneintendingtouseVIMfordevelopmentrunningequallywellonWindows,Linux,*nixandMac.

Thedistributioniscompletelycustomisableusinga
~/.vimrc.local
,
~/.vimrc.bundles.local
,and
~/.vimrc.before.local
VimRCfiles.



UnliketraditionalVIMpluginstructure,whichsimilartoUNIXthrowsallfilesintocommondirectories,makingupdatingordisablingpluginsarealmess,spf13-vim3usesthe
Vundlepluginmanagementsystemtohaveawellorganizedvimdirectory(Similartomac'sappfolders).Vundlealsoensuresthatthelatestversionsofyourpluginsareinstalledandmakesiteasyto
keepthemuptodate.

Greatcarehasbeentakentoensurethateachpluginplaysnicelywithothers,andoptionalconfigurationhasbeenprovidedforwhatwebelieveisthemostefficientuse.

Lastly(andperhaps,mostimportantly)Itiscompletelycrossplatform.ItworkswellonWindows,LinuxandOSXwithoutanymodificationsoradditionalconfigurations.Ifyouareusing
MacVimorGvimadditionalfeaturesareenabled.Soregardlessofyourenvironmentjustcloneandrun.

Installation

Requirements

Tomakeallthepluginswork,specifically
neocomplete,youneed
vimwithlua.

Linux,*nix,MacOSXInstallation

Theeasiestwaytoinstallspf13-vimistouseour
automaticinstallerbysimplycopyingandpastingthefollowinglineintoaterminal.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*nixGitand
Curlarerequired.Also,ifyouhaven'tdonesoalready,you'llneedtoinstall
Vim.Thequickestoptiontoinstallallthreedependencies(Git,
Curl,
Vimandspf13-vim)isvia
ChocolateyNuGet.Afterinstalling
Chocolatey,executethefollowingcommandsonthe
commandprompt:

C:\>chocoinstallspf13-vim

Note:Thespf13-vimpackagewillinstallVimalso!

Ifyouwanttoinstallmsysgit,Curland
spf13-vimindividually,followthedirectionsbelow.

Installingdependencies

InstallVim

AftertheinstallationofVimyoumustaddanewdirectorytoyourenvironmentvariablespathtomakeitworkwiththescriptinstallationofspf13.

OpenVimandwritethefollowingcommand,itwillshowtheinstalleddirectory:

:echo$VIMRUNTIME

C:\ProgramFiles(X86)\Vim\vim74

Thenyouneedtoaddittoyourenvironmentvariablepath.Afterthattryexecute
vim
withincommandprompt(pressWin-R,type
cmd
,pressEnter)andyou’llseethedefaultvimpage.

Installmsysgit

Afterinstallationtryrunning
git--version
withincommandprompt(pressWin-R,type
cmd
,pressEnter)tomakesureallgood:

C:\>git--version

gitversion1.7.4.msysgit.0

SetupCurl

InstructionsblatentlycopiedfromvundlereadmeInstallingCurlonWindowsiseasyas
Curlisbundledwith
msysgit!Butbeforeitcanbeusedwith
Vundleit'srequiredmake
curl
runincommandprompt.Theeasiestwayistocreate
curl.cmd
with
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.Remembertorunthisfilein
AdministratorModeifyouwantthesymlinkstobecreatedsuccessfully.

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.Agoodnumberofpeoplearealready
contributorsto
spf13-vim.Goaheadandforkme.

Ahighlyoptimized.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.local
and
~/.gvimrc.local
foranylocalcustomizations.

Forexample,tooverridethedefaultcolorschemes:

echocolorschemeir_black>>~/.vimrc.local

BeforeFile

Createa
~/.vimrc.before.local
filetodefineanycustomizationsthatgetloaded
beforethespf13-vim
.vimrc
.

Forexample,topreventautocdintoafiledirectory:

echoletg:spf13_no_autochdir=1>>~/.vimrc.before.local

Foralistofavailablespf13-vimspecificcustomizationoptions,lookatthe
~/.vimrc.before
file.

ForkCustomization

Thereisanadditionaltierofcustomizationavailabletothosewhowanttomaintainaforkofspf13-vimspecializedforaparticulargroup.Theseuserscancreate
.vimrc.fork
and
.vimrc.bundles.fork
filesintherootoftheirfork.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.bundles
forspecificsonwhatoptionscanbesettooverridebundleconfiguration.See
.vimrc.before
forspecificsonwhatoptionscanbeoverridden.Mostvimconfigurationoptionsshouldbesetinyour
.vimrc.fork
file,bundleconfigurationneedstobesetinyour
.vimrc.bundles.fork
file.

Youcanspecifythedefaultbundlesforyourforkusing
.vimrc.before.fork
file.Hereishowtocreateanexample
.vimrc.before.fork
fileinaforkrepoforthedefaultbundles.

echoletg:spf13_bundle_groups=[\'general\',\'programming\',\'misc\',\'youcompleteme\']>>.vimrc.before.fork

Onceyouhavethisfileinyourrepo,onlythebundlesyouspecifiedwillbeinstalledduringthefirstinstallationofyourfork.

Youmayalsowanttoupdateyour
README.markdown
filesothatthe
bootstrap.sh
linkpointstoyourrepositoryandyour
bootstrap.sh
filetopulldownyourfork.

Foranexampleofaforkofspf13-vimthatprovidescustomizationinthismannersee
taxilian'sfork.

EasilyEditingYourConfiguration

<Leader>ev
opensanewtabcontainingthe.vimrcconfigurationfileslistedabove.Thismakesiteasiertogetanoverviewofyourconfigurationandmakecustomizations.

<Leader>sv
sourcesthe.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.local
foranyadditionalbundles.

Toaddanewbundle,justaddonelineforeachbundleyouwanttoinstall.Thelineshouldstartwiththeword"Bundle"followedbyastringofeitherthevim.orgprojectnameorthegithubusername/githubprojectname.Forexample,thegithubproject
spf13/vim-colorscanbeaddedwiththefollowingcommand

echoBundle\'spf13/vim-colors\'>>~/.vimrc.bundles.local

Oncenewpluginsareadded,theyhavetobeinstalled.

vim+BundleInstall!+BundleClean+q

Removing(disabling)anincludedplugin

Create
~/.vimrc.local
ifitdoesn'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,anewbranchis
createdinthattree.Combinedwithpersistentundo,thisisnearlyasflexibleandsafeasgit;-)

Undotreemakesthatfeaturemoreaccessiblebycreatingavisualrepresentationofsaidundo-tree.

QuickStartLaunchusing
<Leader>u
.

NERDTree

NERDTreeisafileexplorerpluginthatprovides"projectdrawer"functionalitytoyourvimediting.Youcanlearnmoreaboutitwith
:helpNERDTree
.

QuickStartLaunchusing
<Leader>e
.

Customizations:

Use
<C-E>
totoggleNERDTree
Use
<leader>e
or
<leader>nt
toloadNERDTreeFindwhichopensNERDTreewherethecurrentfileislocated.
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,andadding
surroundings.

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.View
help:NERDCommenter
orcheckoutmyposton
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
youcompleteme
toyourlistofgroupsbyoverridingitinyour
.vimrc.before.local
likeso:
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'thavetocompiletheircodeorexecutetheirscriptto
findthem.

AutoClose

AutoClosedoeswhatyouexpect.It'ssimple,ifyouopenabracket,paren,brace,quote,etc,itautomaticallyclosesit.Ithandlescurlyscorrectlyanddoesn'tgetinthewayofdoublecurliesforthingslikejinjaandtwig.

Fugitive

Fugitiveaddspervasivegitsupporttogitdirectoriesinvim.Formoreinformation,use
:helpfugitive


Use
:Gstatus
toview
gitstatus
andtype
-
onanyfiletostageorunstageit.Type
p
onafiletoenter
gitadd-p
andstagespecifichunksinthefile.

Use
:Gdiff
onanopenfiletoseewhatchangeshavebeenmadetothatfile

QuickStart
<leader>gs
tobringupgitstatus

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

Tabularizeletsyoualignstatementsontheirequalsignsandothercharacters

Customizations:

<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.Italsoprovidesapaneltonavigateeasilyviatags

QuickStart
CTRL-]
whilethecursorisonakeyword(suchasafunctionname)tojumptoitsdefinition.

Customizations:spf13-vimbinds
<Leader>tt
totogglethetagbarpanel



Note:Forfulllanguagesupport,run
brewinstallctags
toinstallexuberant-ctags.

Tip:Checkout
:helpctags
forinformationaboutVIM'sbuilt-inctagsupport.Tagnavigationcreatesastackwhichcantraversedvia
Ctrl-]
(tofindthesourceofatoken)and
Ctrl-T
(tojumpbackuponelevel).

EasyMotion

EasyMotionprovidesaninteractivewaytousemotionsinVim.

Itquicklymapseachpossiblejumpdestinationtoakeyallowingveryfastandstraightforwardmovement.

QuickStartEasyMotionistriggeredusingthenormalmovements,butprefixingthemwith
<leader><leader>


Forexamplethisscreenshotdemonstratespressing
,,w




Airline

Airlineprovidesalightweightthemablestatuslinewithnoexternaldependencies.Bydefaultthisconfigurationusesthesymbols
and
asseparatorsfordifferentstatuslinesectionsbutcanbeconfiguredtousethesamesymbolsas
Powerline.Anexamplefirstwithoutandthenwithpowerlinesymbolsisshownhere:



Toenablepowerlinesymbolsfirstinstalloneofthe
PowerlineFontsorpatchyourfavoritefontusingtheprovidedinstructions.Configureyourterminal,MacVim,orGvimtousethedesiredfont.Finallyadd
letg:airline_powerline_fonts=1
toyour
.vimrc.before.local
.

AdditionalSyntaxes

spf13-vimshipswithafewadditionalsyntaxes:

Markdown(boundto*.markdown,*.md,and*.mk)
Twig
Gitcommits(setyour
EDITOR
to
mvim-f
)

AmazingColors

spf13-vimincludes
solarizedand
spf13vimcolorpack:

ir_black
molokai
peaksea

Use
:colormolokai
toswitchtoacolorscheme.

TerminalVimuserswillbenefitfromsolarizingtheirterminalemulatorsandsettingsolarizedsupportto16colors:

letg:solarized_termcolors=16

colorsolarized

Terminalemulatorcolorschemes:

http://ethanschoonover.com/solarized(iTerm2,Terminal.app)
https://github.com/phiggins/konsole-colors-solarized(KDEKonsole)
https://github.com/sigurdga/gnome-terminal-colors-solarized(GnomeTerminal)

Snippets

Italsocontainsaverycompletesetof
snippetsforusewithsnipmateor
neocomplete.

IntrotoVIM

Here'ssometipsifyou'veneverusedVIMbefore:

Tutorials

Type
vimtutor
intoashelltogothroughabriefinteractivetutorialinsideVIM.
Readtheslidesat
VIM:WalkingWithoutCrutches.

Modes

VIMhastwo(common)modes:

insertmode-stuffyoutypeisaddedtothebuffer
normalmode-keysyouhitareinterpretedascommands

Toenterinsertmode,hit
i

Toexitinsertmode,hit
<ESC>


Usefulcommands

Use
:q
toexitvim
Certaincommandsareprefixedwitha
<Leader>
key,whichbydefaultmapsto
\
.Spf13-vimuses
letmapleader=","
tochangethisto
,
whichisinaconsistentandconvenientlocation.
Keyboard
cheatsheet.



https://github.com/hyperic/sigar/blob/master/examples/cpuinfo.c

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##Unlessrequiredbyapplicablelaworagreedtoinwriting,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]}/"online${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"&&gitpulloriginmasterfiret="$?"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#删除原插件目录
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: