最好的orgmode学习教程.docx
- 文档编号:10781327
- 上传时间:2023-02-22
- 格式:DOCX
- 页数:26
- 大小:29.86KB
最好的orgmode学习教程.docx
《最好的orgmode学习教程.docx》由会员分享,可在线阅读,更多相关《最好的orgmode学习教程.docx(26页珍藏版)》请在冰豆网上搜索。
最好的orgmode学习教程
Usingorg-modeasaDayPlanner
by JOHNW on AUGUST19,2007 · 29COMMENTS
ThefollowingdocumentdescribeshowtouseCarstenDominik’sexcellent org-mode Emacspackageafterthefashionofapen-and-paperdayplanner.
Forthosecurious,IwasnotbroughtupontimemanagementintheeraofthecurrentGTDfad.Istartedwithahard-boundbookfilledwithdailyplanningsheets,alongwithtrainingandbookssupportingthismethod.IfounditincrediblyusefulforthethreeorsoyearsthatIstuckwithit,butultimatelydiscoveredthatonlydigitalmediacantrulykeepupwithmyever-changingworld.Thusbeganmyquestfortheultimate,computerdayplanningpackage.
I’vetriedeverythingavailablefortheAppleMac,andhaveevenstartedsomeofmyownsystems(seeEmacsPlanner),butnothinghasfullysatisfiedme—whichistosay,nothinghasbeenabletokeepme“ontask”,ratherthanfinallygatheringdustonadigitalbookshelf.
Enter org-mode.Thishandysystemusesafairlysimple,single-fileoutliningparadigm,uponwhichitoverlaysconceptslikeduedatesandpriorities.Ifinditsmethodbothnon-intrusiveandeasytoeditbyhand,whichareabsolutenecessitiesforme.
SettingupyourEmacs
Myconfiguration
Iwillpresentmyusageof org-mode asadayplannerfirstbygivingsometemplatesyoucanusestraightaway,andthenbyexplainingmymethodologyviaexampleusesof org-mode thatemploythisconfiguration.First,youshouldaddthefollowingcodetoyour .emacs file,ifyouhavenootherconfiguration:
(require'org-install)
(add-to-list'auto-mode-alist'("\\.org$".org-mode))
(define-keymode-specific-map[?
a]'org-agenda)
(eval-after-load"org"
'(progn
(define-prefix-command'org-todo-state-map)
(define-keyorg-mode-map"\C-cx"'org-todo-state-map)
(define-keyorg-todo-state-map"x"
#'(lambdanil(interactive)(org-todo"CANCELLED")))
(define-keyorg-todo-state-map"d"
#'(lambdanil(interactive)(org-todo"DONE")))
(define-keyorg-todo-state-map"f"
#'(lambdanil(interactive)(org-todo"DEFERRED")))
(define-keyorg-todo-state-map"l"
#'(lambdanil(interactive)(org-todo"DELEGATED")))
(define-keyorg-todo-state-map"s"
#'(lambdanil(interactive)(org-todo"STARTED")))
(define-keyorg-todo-state-map"w"
#'(lambdanil(interactive)(org-todo"WAITING")))
(define-keyorg-agenda-mode-map"\C-n"'next-line)
(define-keyorg-agenda-keymap"\C-n"'next-line)
(define-keyorg-agenda-mode-map"\C-p"'previous-line)
(define-keyorg-agenda-keymap"\C-p"'previous-line)))
(require'remember)
(add-hook'remember-mode-hook'org-remember-apply-template)
(define-keyglobal-map[(controlmeta?
r)]'remember)
(custom-set-variables
'(org-agenda-files(quote("~/todo.org")))
'(org-default-notes-file"~/notes.org")
'(org-agenda-ndays7)
'(org-deadline-warning-days14)
'(org-agenda-show-all-datest)
'(org-agenda-skip-deadline-if-donet)
'(org-agenda-skip-scheduled-if-donet)
'(org-agenda-start-on-weekdaynil)
'(org-reverse-note-ordert)
'(org-fast-tag-selection-single-key(quoteexpert))
'(org-agenda-custom-commands
(quote(("d"todo"DELEGATED"nil)
("c"todo"DONE|DEFERRED|CANCELLED"nil)
("w"todo"WAITING"nil)
("W"agenda""((org-agenda-ndays21)))
("A"agenda""
((org-agenda-skip-function
(lambdanil
(org-agenda-skip-entry-if(quotenotregexp)"\\=.*\\[#A\\]")))
(org-agenda-ndays1)
(org-agenda-overriding-header"Today'sPriority#Atasks:
")))
("u"alltodo""
((org-agenda-skip-function
(lambdanil
(org-agenda-skip-entry-if(quotescheduled)(quotedeadline)
(quoteregexp)"\n]+>")))
(org-agenda-overriding-header"UnscheduledTODOentries:
"))))))
'(org-remember-store-without-promptt)
'(org-remember-templates
(quote((116"*TODO%?
\n%u""~/todo.org""Tasks")
(110"*%u%?
""~/notes.org""Notes"))))
'(remember-annotation-functions(quote(org-remember-annotation)))
'(remember-handler-functions(quote(org-remember-handler))))
Thebeginningofthiscodeloads org-mode intomemory,andcustomizessomeofitsdefaultbehaviors.Inparticular,itaddscertainkeybindingsbothtoregular org-mode (whenyou’reeditingatodofile)andalsotheagendaview.Forexample,Idon’tlikethemeaningof C-n and C-p tobeoverridden,soImodifythembacktotheiroriginalEmacsbehavior.
Afterthis,Iloadthe remember package,whichisagreatcompaniontousewithorg-mode.Finally,Iconfigurebothpackages,whichIdescribehere:
org-agenda-files isalistofallthefileswheretodoitemscanbefound.Thiscanbemany—althoughallthefilesmustbepresentwhen org-mode isfirstinvoked.
org-default-notes-files isusedby remember.el incertainsituationswhereitneedsapathtostoresimplenotesin.
org-agenda-ndays specifieshowmanydaysaheadthedefaultagendaviewshouldlook.Itisimportanttosetthistoseven!
org-deadline-warning-days specifieshowmanydaysearlyadeadlineitemwillbeginshowingupinyouragendalist.Thisnumberisamatterofpreference;Iliketwoweeksasadefault.Startingwith org-mode 5.05,youcannowspecifytheexactwarningamountindividuallyforeachdeadline,soit’snotreallynecessarytochangethisdefaultatall.
Setting org-agenda-show-all-dates totruemeansthatintheagendaview,daysthathavenoassociatedtaskswillstillhavealineshowingthedate.Ilikethisbecauseitletsmeeasilypickout“freedays”.
Setting org-agenda-skip-deadline-if-done meansthatdeadlineitemswhicharemarkedascompletewillnotshowupinyouragendaview.It’simportanttokeepthedailyagendaviewasunclutteredaspossible!
Setting org-agenda-skip-scheduled-if-done meansthatscheduleditemsmarkedascompletewillnotshowupinyouragendaview.
Setting org-agenda-start-on-weekday to nil meansthattheagendaview—eveninthe7-days-at-a-timeview—willalwaysbeginonthecurrentday.Thisisimportant,sincewhileusing org-mode asadayplanner,youneverwanttothinkofdaysgonepast.That’ssomethingyoudoinotherways,suchaswhenreviewingcompletedtasks.
Setting org-reverse-note-order totruemeansthatnotesarestoredindescendingdateorder—inotherwords,themostrecentnoteisalwaysatthetop.Thismakesiteasiertoseeyournotesforthepastweek:
bysimplyopeningupyournotesfile.
Setting org-fast-tag-selection-single-key to expert makesitveryquickandeasytoassigncommontagstoentries.I’llshowhowtousethisfeaturelateron,inthesectiontitled“Taggingandmetadata”.
org-agenda-custom-commands containscustomagendaandtodolistviewcommands,whichcanbeaccessedbytype C-ca followedbythekeyletteroftheirdefinition.JustusethesettingIhaveifyoudon’tunderstandit;I’lldiscusseachonemorethoroughlyinthesectionentitled“Creatingcustomviews”.
Setting org-remember-store-without-prompt totruemakesitpossibletouseremember withouthavingtospecifythefileandparentsubtreeeachtime.Thatis,onceyoutype C-cC-c,itsquirrelsawaytheinfointothedefaultlocationandimmediatereturnsyoubacktowhatyouweredoingbefore.Whenenteringnewtasksonthefly,speed—andminimaldistraction—isoftheessence.
org-remember-templates definestwotemplatesIusewith remember-mode.BecauseIbindthe remember functionto C-M-r,withthesetemplatesIcanquicklytypeeither C-M-rt tojoyanewtask,or C-M-rn tocreateabriefnote.
Adayplanningtemplate
Thefollowingisafiletemplateyoucanuseforstartingyourdayplanner.Justsavethisfileas todo.org inyourhomedirectory:
MYPROJECTS-*-mode:
org;fill-column:
78-*-
*Tasks
#+CATEGORY:
Tasks
*Sampleprojectmilestone
#+CATEGORY:
MilestoneX
DEADLINE:
*School
#+CATEGORY:
School
*Health
#+CATEGORY:
Health
*Finances
#+CATEGORY:
Finance
*Miscellaneous
#+CATEGORY:
Misc
*AnniversariesandHolidays
#+CATEGORY:
Holiday
%%(org-calendar-holiday)
%%(diary-date1025t)Grenada'sThanksgiving
#+CATEGORY:
Birthday
%%(diary-anniversary111960)Someoneis%dyearsold
#+STARTUP:
content
#+STARTUP:
lognotestate
#+SEQ_TODO:
TODOSTARTEDWAITINGDELEGATEDAPPT|DONEDEFERREDCANCELLED
#+TAGS:
{SCHOOL(s)WORK(w)}CALL(c)ERRAND(e)
Onceyouhavethistemplate,youcanbeginaddingtaskstoit.Irecommendusing remember toaddnewtasks,asthiscanbedonequicklyandwithoutinterruptingtheflowofyourotherwork.Soonyouwillhavemanynewtasksadded,lackingonlyinorganization.Thatiswherethedayplanningprocesscomesin.
Atypicalday
Thefollowing“typicalday”willshowhowIuse org-mode toimplementtheconceptofadigitaldayplanner.Thisdayfollowsthelifecycleofaspecificgroupoftasks,fromcreationtoconclusion.
Step1:
Creation
Eachtaskbeginsbyfirstbeingenteredintothesystem.Thekeyatthisstageofthegameis speed.Ifyourmechanismforenteringnewtasksistooslow,youwilltendtoavoidenteringthem—andthenyouwillforgetthem.
Tomaximizespeedinthiscase,IusetheEmacs remember package.Bindittoaneasilyaccessedglobalkey.Iuse C-M-r,replacingthedefaultbehaviorwhichisisearch-backward-regexp.Thisisjustfineforme,becauseyoucanalsotype C-uC-r todotheexactsamesearch.
So,let’senteragroupoftasks.Ifyou’reusing“Myconfiguration”fromabove,hit C-M-r followedbythe t keytoinputanewtask.Fireoffseveraltasks,itdoesn’tmatterwhethertheyarerealonesornot.Thetopofyour todo.org filewillenduplookingsomethinglikethis:
MYPROJECTS-*-mode:
org;fill-column:
78-*-
*Tasks
#+CATEGORY:
Tasks
**TODOThisistaskalpha
[2007-08-23Thu]
**TODOThisistaskbeta
[2007-08-23Thu]
**TODOThisistaskgamma
[2007-08-23Thu]
**TODOThisistaskdelta
[2007-08-23Thu]
**TODOThisistaskepsilon
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 最好 orgmode 学习 教程
![提示](https://static.bdocx.com/images/bang_tan.gif)