Commit
·
59707bf
0
Parent(s):
Init
Browse files- .gitattributes +66 -0
- .gitignore +98 -0
- README.md +3 -0
- contains_empty_cell.csv +6 -0
- drawing_text_image.xlsx +3 -0
- jfk_30.mp4 +3 -0
- jfk_apollo_49.mp3 +3 -0
- jfk_apollo_49.wav +3 -0
- long.epub +3 -0
- long.html +3 -0
- long.ipynb +0 -0
- long.json +0 -0
- long.org +202 -0
- long.pdf +3 -0
- long.rst +337 -0
- long.tex +155 -0
- long.toml +232 -0
- long.txt +96 -0
- long.yaml +0 -0
- lz.md +418 -0
- multi_sheets.xlsx +3 -0
- normal.pptx +3 -0
- short.pdf +3 -0
- short.rtf +0 -0
- short_image.pdf +3 -0
- short_image.pptx +3 -0
- with_image.docx +3 -0
- with_image.odt +3 -0
- with_table.jpg +3 -0
.gitattributes
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
| 2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
| 5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
| 6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
| 7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
| 8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 11 |
+
*.lz4 filter=lfs diff=lfs merge=lfs -text
|
| 12 |
+
*.mds filter=lfs diff=lfs merge=lfs -text
|
| 13 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
| 14 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
| 15 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 16 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
| 17 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
| 18 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 19 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
| 20 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
| 21 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 22 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
| 23 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
| 24 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 25 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 26 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
| 27 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 28 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
| 29 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
| 30 |
+
*.tar filter=lfs diff=lfs merge=lfs -text
|
| 31 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 32 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
| 33 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
| 34 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
| 35 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
*.epub filter=lfs diff=lfs merge=lfs -text
|
| 39 |
+
# Audio files - uncompressed
|
| 40 |
+
*.pcm filter=lfs diff=lfs merge=lfs -text
|
| 41 |
+
*.sam filter=lfs diff=lfs merge=lfs -text
|
| 42 |
+
*.raw filter=lfs diff=lfs merge=lfs -text
|
| 43 |
+
# Audio files - compressed
|
| 44 |
+
*.aac filter=lfs diff=lfs merge=lfs -text
|
| 45 |
+
*.flac filter=lfs diff=lfs merge=lfs -text
|
| 46 |
+
*.mp3 filter=lfs diff=lfs merge=lfs -text
|
| 47 |
+
*.ogg filter=lfs diff=lfs merge=lfs -text
|
| 48 |
+
*.wav filter=lfs diff=lfs merge=lfs -text
|
| 49 |
+
# Image files - uncompressed
|
| 50 |
+
*.bmp filter=lfs diff=lfs merge=lfs -text
|
| 51 |
+
*.gif filter=lfs diff=lfs merge=lfs -text
|
| 52 |
+
*.png filter=lfs diff=lfs merge=lfs -text
|
| 53 |
+
*.tiff filter=lfs diff=lfs merge=lfs -text
|
| 54 |
+
# Image files - compressed
|
| 55 |
+
*.jpg filter=lfs diff=lfs merge=lfs -text
|
| 56 |
+
*.jpeg filter=lfs diff=lfs merge=lfs -text
|
| 57 |
+
*.webp filter=lfs diff=lfs merge=lfs -text
|
| 58 |
+
# Video files - compressed
|
| 59 |
+
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 60 |
+
*.webm filter=lfs diff=lfs merge=lfs -text
|
| 61 |
+
*.pdf filter=lfs diff=lfs merge=lfs -text
|
| 62 |
+
*.docx filter=lfs diff=lfs merge=lfs -text
|
| 63 |
+
*.odt filter=lfs diff=lfs merge=lfs -text
|
| 64 |
+
*.xlsx filter=lfs diff=lfs merge=lfs -text
|
| 65 |
+
*.pptx filter=lfs diff=lfs merge=lfs -text
|
| 66 |
+
long.html filter=lfs diff=lfs merge=lfs -text
|
.gitignore
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
### LibreOffice ###
|
| 2 |
+
# LibreOffice locks
|
| 3 |
+
.~lock.*#
|
| 4 |
+
|
| 5 |
+
### Linux ###
|
| 6 |
+
*~
|
| 7 |
+
|
| 8 |
+
# temporary files which can be created if a process still has a handle open of a deleted file
|
| 9 |
+
.fuse_hidden*
|
| 10 |
+
|
| 11 |
+
# KDE directory preferences
|
| 12 |
+
.directory
|
| 13 |
+
|
| 14 |
+
# Linux trash folder which might appear on any partition or disk
|
| 15 |
+
.Trash-*
|
| 16 |
+
|
| 17 |
+
# .nfs files are created when an open file is removed but is still being accessed
|
| 18 |
+
.nfs*
|
| 19 |
+
|
| 20 |
+
### macOS ###
|
| 21 |
+
# General
|
| 22 |
+
.DS_Store
|
| 23 |
+
.AppleDouble
|
| 24 |
+
.LSOverride
|
| 25 |
+
|
| 26 |
+
# Icon must end with two \r
|
| 27 |
+
Icon
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
# Thumbnails
|
| 31 |
+
._*
|
| 32 |
+
|
| 33 |
+
# Files that might appear in the root of a volume
|
| 34 |
+
.DocumentRevisions-V100
|
| 35 |
+
.fseventsd
|
| 36 |
+
.Spotlight-V100
|
| 37 |
+
.TemporaryItems
|
| 38 |
+
.Trashes
|
| 39 |
+
.VolumeIcon.icns
|
| 40 |
+
.com.apple.timemachine.donotpresent
|
| 41 |
+
|
| 42 |
+
# Directories potentially created on remote AFP share
|
| 43 |
+
.AppleDB
|
| 44 |
+
.AppleDesktop
|
| 45 |
+
Network Trash Folder
|
| 46 |
+
Temporary Items
|
| 47 |
+
.apdisk
|
| 48 |
+
|
| 49 |
+
### macOS Patch ###
|
| 50 |
+
# iCloud generated files
|
| 51 |
+
*.icloud
|
| 52 |
+
|
| 53 |
+
### Vim ###
|
| 54 |
+
# Swap
|
| 55 |
+
[._]*.s[a-v][a-z]
|
| 56 |
+
!*.svg # comment out if you don't need vector files
|
| 57 |
+
[._]*.sw[a-p]
|
| 58 |
+
[._]s[a-rt-v][a-z]
|
| 59 |
+
[._]ss[a-gi-z]
|
| 60 |
+
[._]sw[a-p]
|
| 61 |
+
|
| 62 |
+
# Session
|
| 63 |
+
Session.vim
|
| 64 |
+
Sessionx.vim
|
| 65 |
+
|
| 66 |
+
# Temporary
|
| 67 |
+
.netrwhist
|
| 68 |
+
# Auto-generated tag files
|
| 69 |
+
tags
|
| 70 |
+
# Persistent undo
|
| 71 |
+
[._]*.un~
|
| 72 |
+
|
| 73 |
+
### Windows ###
|
| 74 |
+
# Windows thumbnail cache files
|
| 75 |
+
Thumbs.db
|
| 76 |
+
Thumbs.db:encryptable
|
| 77 |
+
ehthumbs.db
|
| 78 |
+
ehthumbs_vista.db
|
| 79 |
+
|
| 80 |
+
# Dump file
|
| 81 |
+
*.stackdump
|
| 82 |
+
|
| 83 |
+
# Folder config file
|
| 84 |
+
[Dd]esktop.ini
|
| 85 |
+
|
| 86 |
+
# Recycle Bin used on file shares
|
| 87 |
+
$RECYCLE.BIN/
|
| 88 |
+
|
| 89 |
+
# Windows Installer files
|
| 90 |
+
*.cab
|
| 91 |
+
*.msi
|
| 92 |
+
*.msix
|
| 93 |
+
*.msm
|
| 94 |
+
*.msp
|
| 95 |
+
|
| 96 |
+
# Windows shortcuts
|
| 97 |
+
*.lnk
|
| 98 |
+
|
README.md
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
---
|
contains_empty_cell.csv
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Disability Category,Participants,Ballots Completed,Ballots Incomplete/Terminated,Results,
|
| 2 |
+
,,,,Accuracy,Time to complete
|
| 3 |
+
Blind,5,1,4,"34.5%, n=1","1199 sec, n=1"
|
| 4 |
+
Low Vision,5,2,3,"98.3% n=2 (97.7%, n=3)","1716 sec, n=3 (1934 sec, n=2)"
|
| 5 |
+
Dexterity,5,4,1,"98.3%, n=4","1672.1 sec, n=4"
|
| 6 |
+
Mobility,3,3,0,"95.4%, n=3","1416 sec, n=3"
|
drawing_text_image.xlsx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:24154df423274e6b57bb2f4fb488f074bc7a07681b67c6738222017b215d0308
|
| 3 |
+
size 12541
|
jfk_30.mp4
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c7ed5dea7ed578733cd6dda6df6f32abce55a3b27c0ee5f6d5597edc1d47a12c
|
| 3 |
+
size 3319895
|
jfk_apollo_49.mp3
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f37d6cfc64737e244ada419a4be26083a894e67adebfb3c46e4631528f01bea8
|
| 3 |
+
size 392598
|
jfk_apollo_49.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:59f57553f9371d5077f36d93aa6ebb6b0aa9503561bbca0f1cbd346d30989373
|
| 3 |
+
size 4322560
|
long.epub
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bac49dc2bf6eaad769593efae03293c90c316d244146c8dcb3e5e95569b5b6fa
|
| 3 |
+
size 522408
|
long.html
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:015e32e2e170ecfb8795f6643e4134e822c5bffa3848edd7959f845cf0acd5e7
|
| 3 |
+
size 12283535
|
long.ipynb
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
long.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
long.org
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#+HTML: <div align="center">
|
| 2 |
+
|
| 3 |
+
#+HTML: <img alt="A blend of the Neovim (shape) and Org-mode (colours) logos" src="assets/nvim-orgmode.svg" width="250" /><br/>
|
| 4 |
+
|
| 5 |
+
* nvim-orgmode
|
| 6 |
+
|
| 7 |
+
#+HTML:<a href="/LICENSE"><img alt="License" src="https://img.shields.io/badge/license-MIT-brightgreen?style=flat-square"></a>
|
| 8 |
+
#+HTML:<a href="https://ko-fi.com/kristijanhusak"><img alt="Kofi" src="https://img.shields.io/badge/support-kofi-00b9fe?style=flat-square&logo=kofi"></a>
|
| 9 |
+
#+HTML:<a href="https://matrix.to/#/#neovim-orgmode:matrix.org"><img alt="Chat" src="https://img.shields.io/matrix/neovim-orgmode:matrix.org?logo=matrix&server_fqdn=matrix.org&style=flat-square"></a>
|
| 10 |
+
|
| 11 |
+
Orgmode clone written in Lua for Neovim
|
| 12 |
+
|
| 13 |
+
[[#installation][Installation]] • [[#docs][Docs]] • [[#showcase][Showcase]] • [[file:./docs/troubleshoot.org][Troubleshoot]] • [[#plugins][Plugins]] • [[file:./docs/contributing.org][Contributing]] • [[#thanks-to][Kudos]]
|
| 14 |
+
|
| 15 |
+
#+HTML:</div>
|
| 16 |
+
|
| 17 |
+
** Quickstart
|
| 18 |
+
|
| 19 |
+
*** Requirements
|
| 20 |
+
|
| 21 |
+
- Neovim 0.10.0 or later
|
| 22 |
+
|
| 23 |
+
*** Installation
|
| 24 |
+
:PROPERTIES:
|
| 25 |
+
:CUSTOM_ID: installation
|
| 26 |
+
:END:
|
| 27 |
+
|
| 28 |
+
Use your favourite package manager. We recommend [[https://github.com/folke/lazy.nvim][lazy.nvim]]:
|
| 29 |
+
#+BEGIN_SRC lua
|
| 30 |
+
{
|
| 31 |
+
'nvim-orgmode/orgmode',
|
| 32 |
+
event = 'VeryLazy',
|
| 33 |
+
ft = { 'org' },
|
| 34 |
+
config = function()
|
| 35 |
+
-- Setup orgmode
|
| 36 |
+
require('orgmode').setup({
|
| 37 |
+
org_agenda_files = '~/orgfiles/**/*',
|
| 38 |
+
org_default_notes_file = '~/orgfiles/refile.org',
|
| 39 |
+
})
|
| 40 |
+
|
| 41 |
+
-- NOTE: If you are using nvim-treesitter with ~ensure_installed = "all"~ option
|
| 42 |
+
-- add ~org~ to ignore_install
|
| 43 |
+
-- require('nvim-treesitter.configs').setup({
|
| 44 |
+
-- ensure_installed = 'all',
|
| 45 |
+
-- ignore_install = { 'org' },
|
| 46 |
+
-- })
|
| 47 |
+
end,
|
| 48 |
+
}
|
| 49 |
+
#+END_SRC
|
| 50 |
+
|
| 51 |
+
For more installation options see [[file:./docs/installation.org][Installation]] page.
|
| 52 |
+
|
| 53 |
+
*** Docs
|
| 54 |
+
:PROPERTIES:
|
| 55 |
+
:CUSTOM_ID: docs
|
| 56 |
+
:END:
|
| 57 |
+
|
| 58 |
+
Online docs is available at [[https://nvim-orgmode.github.io]].
|
| 59 |
+
|
| 60 |
+
To view docs in orgmode format in Neovim, run =:Org help=.
|
| 61 |
+
|
| 62 |
+
Vim help docs is available at =:help orgmode.txt=
|
| 63 |
+
*** Usage
|
| 64 |
+
|
| 65 |
+
- *Open agenda prompt*: =<Leader>oa=
|
| 66 |
+
- *Open capture prompt*: =<Leader>oc=
|
| 67 |
+
- In any orgmode buffer press =g?= for help
|
| 68 |
+
|
| 69 |
+
If you are new to Orgmode, see [[file:./docs/index.org#getting-started][Getting started]] section in the Docs.
|
| 70 |
+
|
| 71 |
+
** Showcase
|
| 72 |
+
:PROPERTIES:
|
| 73 |
+
:CUSTOM_ID: showcase
|
| 74 |
+
:END:
|
| 75 |
+
|
| 76 |
+
*** Agenda
|
| 77 |
+
|
| 78 |
+
#+CAPTION: agenda
|
| 79 |
+
#+NAME: agenda
|
| 80 |
+
[[https://user-images.githubusercontent.com/1782860/123549968-8521f600-d76b-11eb-9a93-02bad08b37ce.gif]]
|
| 81 |
+
|
| 82 |
+
*** Org file
|
| 83 |
+
|
| 84 |
+
#+CAPTION: orgfile
|
| 85 |
+
#+NAME: orgfile
|
| 86 |
+
[[https://user-images.githubusercontent.com/1782860/123549982-90752180-d76b-11eb-8828-9edf9f76af08.gif]]
|
| 87 |
+
|
| 88 |
+
*** Capturing and refiling
|
| 89 |
+
|
| 90 |
+
#+CAPTION: capture
|
| 91 |
+
#+NAME: capture
|
| 92 |
+
[[https://user-images.githubusercontent.com/1782860/123549993-9a972000-d76b-11eb-814b-b348a93df08a.gif]]
|
| 93 |
+
|
| 94 |
+
*** Autocompletion
|
| 95 |
+
|
| 96 |
+
#+CAPTION: autocomplete
|
| 97 |
+
#+NAME: autocomplete
|
| 98 |
+
[[https://user-images.githubusercontent.com/1782860/123550227-e8605800-d76c-11eb-96f6-c0a677d562d4.gif]]
|
| 99 |
+
|
| 100 |
+
** Features
|
| 101 |
+
|
| 102 |
+
*** TL;DR
|
| 103 |
+
|
| 104 |
+
- Agenda view
|
| 105 |
+
- Search by tags/keyword
|
| 106 |
+
- Clocking time
|
| 107 |
+
- Repeatable dates, date and time ranges
|
| 108 |
+
- Capturing to default notes file/destination
|
| 109 |
+
- Archiving (archive file or ARCHIVE tag)
|
| 110 |
+
- Exporting (via ~emacs~, ~pandoc~ and custom export options)
|
| 111 |
+
- Notifications (experimental, see issue [[https://github.com/nvim-orgmode/orgmode/issues/49][#49]])
|
| 112 |
+
- Calendar popup for easier navigation and date updates
|
| 113 |
+
- Various org file mappings:
|
| 114 |
+
- Promote/Demote
|
| 115 |
+
- Change TODO state
|
| 116 |
+
- Change dates
|
| 117 |
+
- Insert/Move/Refile headlines
|
| 118 |
+
- Change tags
|
| 119 |
+
- Toggle checkbox state
|
| 120 |
+
- Remote editing from agenda view
|
| 121 |
+
- Repeatable mapping via [[https://github.com/tpope/vim-repeat][vim-repeat]]
|
| 122 |
+
|
| 123 |
+
*** Detailed breakdown
|
| 124 |
+
|
| 125 |
+
- Agenda prompt:
|
| 126 |
+
- Agenda view (=a=):
|
| 127 |
+
- Ability to show daily(=vd=)/weekly(=vw=)/monthly(=vm=)/yearly(=vy=) agenda
|
| 128 |
+
- Support for various date settings:
|
| 129 |
+
- DEADLINE: Warning settings - example: ~<2021-06-11 Fri 11:00 -1d>~
|
| 130 |
+
- SCHEDULED: Delay setting - example: ~<2021-06-11 Fri 11:00 -2d>~
|
| 131 |
+
- All dates - Repeater settings:
|
| 132 |
+
- Cumulate type: ~<2021-06-11 Fri 11:00 +1w>~
|
| 133 |
+
- Catch-up type: ~<2021-06-11 Fri 11:00 ++1w>~
|
| 134 |
+
- Restart type: ~<2021-06-11 Fri 11:00 .+1w>~
|
| 135 |
+
- Time ranges - example: ~<2021-06-11 Fri 11:00-12:30>~
|
| 136 |
+
- Date ranges - example: ~<2021-06-11 Fri 11:00-12:30>--<2021-06-13 Sun 22:00>~
|
| 137 |
+
- Properly lists tasks according to defined dates (DEADLINE,SCHEDULED,Plain date)
|
| 138 |
+
- Navigate forward (=f=)/backward(=b=) or jump to specific date (=J=)
|
| 139 |
+
- Go to task under cursor in current window(=<CR>=) or other window(=<TAB>=)
|
| 140 |
+
- Print category from ":CATEGORY:" property if defined
|
| 141 |
+
- List tasks that have "TODO" state (=t=):
|
| 142 |
+
- Find headlines matching tag(s) (=m=):
|
| 143 |
+
- Search for headlines (and it's content) for a query (=s=):
|
| 144 |
+
- [[file:./docs/configuration.org#advanced-search][Advanced search]] for tags/todo kewords/properties
|
| 145 |
+
- Notifications (experimental, see issue [[https://github.com/nvim-orgmode/orgmode/issues/49][#49]])
|
| 146 |
+
- Clocking time
|
| 147 |
+
- Capture:
|
| 148 |
+
- Define custom templates
|
| 149 |
+
- Fast capturing to default notes file via =<C-c>=
|
| 150 |
+
- Capturing to specific destination =<Leader>or=
|
| 151 |
+
- Abort capture with =<Leader>ok=
|
| 152 |
+
- Org files
|
| 153 |
+
- Clocking time
|
| 154 |
+
- Refile to destination/headline: =<Leader>or=
|
| 155 |
+
- Increase/Decrease date under cursor: =<C-a>= / =<C-x>=
|
| 156 |
+
- Change date under cursor via calendar popup: =cid=
|
| 157 |
+
- Change headline TODO state: forward =cit= or backward =ciT=
|
| 158 |
+
- Open hyperlink or date under cursor: =<Leader>oo=
|
| 159 |
+
- Toggle checkbox: =<C-space>=
|
| 160 |
+
- Toggle current line to headline and vice versa: =<Leader>o*=
|
| 161 |
+
- Toggle folding of current headline: =<TAB>=
|
| 162 |
+
- Toggle folding in whole file: =<S-TAB>=
|
| 163 |
+
- Archive headline: =<Leader>o$=
|
| 164 |
+
- Add archive tag: =<Leader>oA=
|
| 165 |
+
- Change tags: =<Leader>ot=
|
| 166 |
+
- Promote headline: =<<=
|
| 167 |
+
- Demote headline: =>>=
|
| 168 |
+
- Promote subtree: =<s=
|
| 169 |
+
- Demote subtree: =>s=
|
| 170 |
+
- Add headline/list item/checkbox: =<Leader><CR>=
|
| 171 |
+
- Insert heading after current heading and it's content: =<Leader>oih=
|
| 172 |
+
- Insert TODO heading after current line: =<Leader>oiT=
|
| 173 |
+
- Insert TODO heading after current heading and it's content: =<Leader>oit=
|
| 174 |
+
- Move headline up: =<Leader>oK=
|
| 175 |
+
- Move headline down: =<Leader>oJ=
|
| 176 |
+
- Highlighted code blocks (~#+BEGIN_SRC filetype~)
|
| 177 |
+
Exporting (via ~emacs~, ~pandoc~ and custom export options)
|
| 178 |
+
|
| 179 |
+
Link to detailed documentation: [[./docs/index.org][DOCS]]
|
| 180 |
+
|
| 181 |
+
** Plugins
|
| 182 |
+
Check [[file:./docs/plugins.org][Plugins]] page for list of plugins.
|
| 183 |
+
|
| 184 |
+
#+BEGIN_QUOTE
|
| 185 |
+
*NOTE*: None of the Emacs Orgmode plugins will be built into nvim-orgmode.
|
| 186 |
+
Anything that's a separate plugin in Emacs Orgmode should be a separate plugin in here.
|
| 187 |
+
The point of this plugin is to provide functionality that's built into Emacs Orgmode core,
|
| 188 |
+
and a good foundation for external plugins.
|
| 189 |
+
#+END_QUOTE
|
| 190 |
+
|
| 191 |
+
If you want to build a plugin, post suggestions and improvements on [[https://github.com/nvim-orgmode/orgmode/issues/26][Plugins infrastructure]]
|
| 192 |
+
issue.
|
| 193 |
+
|
| 194 |
+
** Thanks to
|
| 195 |
+
:PROPERTIES:
|
| 196 |
+
:CUSTOM_ID: thanks-to
|
| 197 |
+
:END:
|
| 198 |
+
|
| 199 |
+
- [[https://github.com/dhruvasagar][@dhruvasagar]] and his [[https://github.com/dhruvasagar/vim-dotoo][vim-dotoo]] plugin
|
| 200 |
+
that got me started using orgmode. Without him this plugin would not happen.
|
| 201 |
+
- [[https://github.com/milisims][@milisims]] for writing a treesitter parser for org
|
| 202 |
+
- [[https://github.com/jceb/vim-orgmode][vim-orgmode]] for some parts of the code (mostly syntax)
|
long.pdf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a67e18a4ca6e2c81abc030239a3ee53705f656b79efab8ce1d6b5ac25630c2a5
|
| 3 |
+
size 1887607
|
long.rst
ADDED
|
@@ -0,0 +1,337 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
===============
|
| 2 |
+
Getting started
|
| 3 |
+
===============
|
| 4 |
+
|
| 5 |
+
Sphinx is a *documentation generator* or a tool that translates a set of plain
|
| 6 |
+
text source files into various output formats, automatically producing
|
| 7 |
+
cross-references, indices, etc. That is, if you have a directory containing a
|
| 8 |
+
bunch of :doc:`/usage/restructuredtext/index` or :doc:`/usage/markdown`
|
| 9 |
+
documents, Sphinx can generate a series of HTML files, a PDF file (via LaTeX),
|
| 10 |
+
man pages and much more.
|
| 11 |
+
|
| 12 |
+
Sphinx focuses on documentation, in particular handwritten documentation,
|
| 13 |
+
however, Sphinx can also be used to generate blogs, homepages and even books.
|
| 14 |
+
Much of Sphinx's power comes from the richness of its default plain-text markup
|
| 15 |
+
format, :doc:`reStructuredText </usage/restructuredtext/index>`, along with
|
| 16 |
+
its :doc:`significant extensibility capabilities </development/index>`.
|
| 17 |
+
|
| 18 |
+
The goal of this document is to give you a quick taste of what Sphinx is and
|
| 19 |
+
how you might use it. When you're done here, you can check out the
|
| 20 |
+
:doc:`installation guide </usage/installation>` followed by the intro to the
|
| 21 |
+
default markup format used by Sphinx, :doc:`reStructuredText
|
| 22 |
+
</usage/restructuredtext/index>`.
|
| 23 |
+
|
| 24 |
+
For a great "introduction" to writing docs in general -- the whys and hows, see
|
| 25 |
+
also `Write the docs`__, written by Eric Holscher.
|
| 26 |
+
|
| 27 |
+
.. __: https://www.writethedocs.org/guide/writing/beginners-guide-to-docs/
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
Setting up the documentation sources
|
| 31 |
+
------------------------------------
|
| 32 |
+
|
| 33 |
+
The root directory of a Sphinx collection of plain-text document sources is
|
| 34 |
+
called the :term:`source directory`. This directory also contains the Sphinx
|
| 35 |
+
configuration file :file:`conf.py`, where you can configure all aspects of how
|
| 36 |
+
Sphinx reads your sources and builds your documentation. [#]_
|
| 37 |
+
|
| 38 |
+
Sphinx comes with a script called :program:`sphinx-quickstart` that sets up a
|
| 39 |
+
source directory and creates a default :file:`conf.py` with the most useful
|
| 40 |
+
configuration values from a few questions it asks you. To use this, run:
|
| 41 |
+
|
| 42 |
+
.. code-block:: console
|
| 43 |
+
|
| 44 |
+
$ sphinx-quickstart
|
| 45 |
+
|
| 46 |
+
|
| 47 |
+
Defining document structure
|
| 48 |
+
---------------------------
|
| 49 |
+
|
| 50 |
+
Let's assume you've run :program:`sphinx-quickstart`. It created a source
|
| 51 |
+
directory with :file:`conf.py` and a root document, :file:`index.rst`. The
|
| 52 |
+
main function of the :term:`root document` is to serve as a welcome page, and
|
| 53 |
+
to contain the root of the "table of contents tree" (or *toctree*). This is one
|
| 54 |
+
of the main things that Sphinx adds to reStructuredText, a way to connect
|
| 55 |
+
multiple files to a single hierarchy of documents.
|
| 56 |
+
|
| 57 |
+
.. admonition:: reStructuredText directives
|
| 58 |
+
:class: note
|
| 59 |
+
|
| 60 |
+
``toctree`` is a reStructuredText :dfn:`directive`, a very versatile piece
|
| 61 |
+
of markup. Directives can have arguments, options and content.
|
| 62 |
+
|
| 63 |
+
*Arguments* are given directly after the double colon following the
|
| 64 |
+
directive's name. Each directive decides whether it can have arguments, and
|
| 65 |
+
how many.
|
| 66 |
+
|
| 67 |
+
*Options* are given after the arguments, in form of a "field list". The
|
| 68 |
+
``maxdepth`` is such an option for the ``toctree`` directive.
|
| 69 |
+
|
| 70 |
+
*Content* follows the options or arguments after a blank line. Each
|
| 71 |
+
directive decides whether to allow content, and what to do with it.
|
| 72 |
+
|
| 73 |
+
A common gotcha with directives is that **the first line of the content must
|
| 74 |
+
be indented to the same level as the options are**.
|
| 75 |
+
|
| 76 |
+
The ``toctree`` directive initially is empty, and looks like so:
|
| 77 |
+
|
| 78 |
+
.. code-block:: rst
|
| 79 |
+
|
| 80 |
+
.. toctree::
|
| 81 |
+
:maxdepth: 2
|
| 82 |
+
|
| 83 |
+
You add documents listing them in the *content* of the directive:
|
| 84 |
+
|
| 85 |
+
.. code-block:: rst
|
| 86 |
+
|
| 87 |
+
.. toctree::
|
| 88 |
+
:maxdepth: 2
|
| 89 |
+
|
| 90 |
+
usage/installation
|
| 91 |
+
usage/quickstart
|
| 92 |
+
...
|
| 93 |
+
|
| 94 |
+
This is exactly how the ``toctree`` for this documentation looks. The
|
| 95 |
+
documents to include are given as :term:`document name`\ s, which in short
|
| 96 |
+
means that you leave off the file name extension and use forward slashes
|
| 97 |
+
(``/``) as directory separators.
|
| 98 |
+
|
| 99 |
+
.. seealso::
|
| 100 |
+
|
| 101 |
+
Read more about :ref:`the toctree directive <toctree-directive>`.
|
| 102 |
+
|
| 103 |
+
You can now create the files you listed in the ``toctree`` and add content, and
|
| 104 |
+
their section titles will be inserted (up to the ``maxdepth`` level) at the
|
| 105 |
+
place where the ``toctree`` directive is placed. Also, Sphinx now knows about
|
| 106 |
+
the order and hierarchy of your documents. (They may contain ``toctree``
|
| 107 |
+
directives themselves, which means you can create deeply nested hierarchies if
|
| 108 |
+
necessary.)
|
| 109 |
+
|
| 110 |
+
|
| 111 |
+
Adding content
|
| 112 |
+
--------------
|
| 113 |
+
|
| 114 |
+
In Sphinx source files, you can use most features of standard
|
| 115 |
+
:term:`reStructuredText`. There are also several features added by Sphinx.
|
| 116 |
+
For example, you can add cross-file references in a portable way (which works
|
| 117 |
+
for all output types) using the :rst:role:`ref` role.
|
| 118 |
+
|
| 119 |
+
For an example, if you are viewing the HTML version, you can look at the source
|
| 120 |
+
for this document -- use the "Show Source" link in the sidebar.
|
| 121 |
+
|
| 122 |
+
.. todo:: Update the below link when we add new guides on these.
|
| 123 |
+
|
| 124 |
+
.. seealso::
|
| 125 |
+
|
| 126 |
+
:doc:`/usage/restructuredtext/index`
|
| 127 |
+
for a more in-depth introduction to reStructuredText,
|
| 128 |
+
including markup added by Sphinx.
|
| 129 |
+
|
| 130 |
+
|
| 131 |
+
Running the build
|
| 132 |
+
-----------------
|
| 133 |
+
|
| 134 |
+
Now that you have added some files and content, let's make a first build of the
|
| 135 |
+
docs. A build is started with the :program:`sphinx-build` program:
|
| 136 |
+
|
| 137 |
+
.. code-block:: console
|
| 138 |
+
|
| 139 |
+
$ sphinx-build -M html sourcedir outputdir
|
| 140 |
+
|
| 141 |
+
where *sourcedir* is the :term:`source directory`, and *outputdir* is the
|
| 142 |
+
directory in which you want to place the built documentation.
|
| 143 |
+
The :option:`-M <sphinx-build -M>` option selects a builder; in this example
|
| 144 |
+
Sphinx will build HTML files.
|
| 145 |
+
|
| 146 |
+
.. seealso::
|
| 147 |
+
|
| 148 |
+
Refer to the :doc:`sphinx-build man page </man/sphinx-build>`
|
| 149 |
+
for all options that :program:`sphinx-build` supports.
|
| 150 |
+
|
| 151 |
+
You can also build a **live version of the documentation** that you can preview
|
| 152 |
+
in the browser.
|
| 153 |
+
It will detect changes and reload the page any time you make edits.
|
| 154 |
+
To do so, use `sphinx-autobuild`_ to run the following command:
|
| 155 |
+
|
| 156 |
+
.. code-block:: console
|
| 157 |
+
|
| 158 |
+
$ sphinx-autobuild source-dir output-dir
|
| 159 |
+
|
| 160 |
+
.. _sphinx-autobuild: https://github.com/sphinx-doc/sphinx-autobuild
|
| 161 |
+
|
| 162 |
+
However, :program:`sphinx-quickstart` script creates a :file:`Makefile` and a
|
| 163 |
+
:file:`make.bat` which make life even easier for you. These can be executed by
|
| 164 |
+
running :command:`make` with the name of the builder. For example.
|
| 165 |
+
|
| 166 |
+
.. code-block:: console
|
| 167 |
+
|
| 168 |
+
$ make html
|
| 169 |
+
|
| 170 |
+
This will build HTML docs in the build directory you chose. Execute
|
| 171 |
+
:command:`make` without an argument to see which targets are available.
|
| 172 |
+
|
| 173 |
+
.. admonition:: How do I generate PDF documents?
|
| 174 |
+
|
| 175 |
+
``make latexpdf`` runs the :mod:`LaTeX builder
|
| 176 |
+
<sphinx.builders.latex.LaTeXBuilder>` and readily invokes the pdfTeX
|
| 177 |
+
toolchain for you.
|
| 178 |
+
|
| 179 |
+
|
| 180 |
+
.. todo:: Move this whole section into a guide on rST or directives
|
| 181 |
+
|
| 182 |
+
Documenting objects
|
| 183 |
+
-------------------
|
| 184 |
+
|
| 185 |
+
One of Sphinx's main objectives is easy documentation of :dfn:`objects` (in a
|
| 186 |
+
very general sense) in any :dfn:`domain`. A domain is a collection of object
|
| 187 |
+
types that belong together, complete with markup to create and reference
|
| 188 |
+
descriptions of these objects.
|
| 189 |
+
|
| 190 |
+
The most prominent domain is the Python domain. For example, to document
|
| 191 |
+
Python's built-in function ``enumerate()``, you would add this to one of your
|
| 192 |
+
source files.
|
| 193 |
+
|
| 194 |
+
.. code-block:: rst
|
| 195 |
+
|
| 196 |
+
.. py:function:: enumerate(sequence[, start=0])
|
| 197 |
+
|
| 198 |
+
Return an iterator that yields tuples of an index and an item of the
|
| 199 |
+
*sequence*. (And so on.)
|
| 200 |
+
|
| 201 |
+
This is rendered like this:
|
| 202 |
+
|
| 203 |
+
.. py:function:: enumerate(sequence[, start=0])
|
| 204 |
+
|
| 205 |
+
Return an iterator that yields tuples of an index and an item of the
|
| 206 |
+
*sequence*. (And so on.)
|
| 207 |
+
|
| 208 |
+
The argument of the directive is the :dfn:`signature` of the object you
|
| 209 |
+
describe, the content is the documentation for it. Multiple signatures can be
|
| 210 |
+
given, each in its own line.
|
| 211 |
+
|
| 212 |
+
The Python domain also happens to be the default domain, so you don't need to
|
| 213 |
+
prefix the markup with the domain name.
|
| 214 |
+
|
| 215 |
+
.. code-block:: rst
|
| 216 |
+
|
| 217 |
+
.. function:: enumerate(sequence[, start=0])
|
| 218 |
+
|
| 219 |
+
...
|
| 220 |
+
|
| 221 |
+
does the same job if you keep the default setting for the default domain.
|
| 222 |
+
|
| 223 |
+
There are several more directives for documenting other types of Python
|
| 224 |
+
objects, for example :rst:dir:`py:class` or :rst:dir:`py:method`. There is
|
| 225 |
+
also a cross-referencing :dfn:`role` for each of these object types. This
|
| 226 |
+
markup will create a link to the documentation of ``enumerate()``.
|
| 227 |
+
|
| 228 |
+
::
|
| 229 |
+
|
| 230 |
+
The :py:func:`enumerate` function can be used for ...
|
| 231 |
+
|
| 232 |
+
And here is the proof: A link to :func:`enumerate`.
|
| 233 |
+
|
| 234 |
+
Again, the ``py:`` can be left out if the Python domain is the default one. It
|
| 235 |
+
doesn't matter which file contains the actual documentation for
|
| 236 |
+
``enumerate()``; Sphinx will find it and create a link to it.
|
| 237 |
+
|
| 238 |
+
Each domain will have special rules for how the signatures can look like, and
|
| 239 |
+
make the formatted output look pretty, or add specific features like links to
|
| 240 |
+
parameter types, e.g. in the C/C++ domains.
|
| 241 |
+
|
| 242 |
+
.. seealso::
|
| 243 |
+
|
| 244 |
+
:doc:`/usage/domains/index`
|
| 245 |
+
for all the available domains and their directives/roles.
|
| 246 |
+
|
| 247 |
+
|
| 248 |
+
Basic configuration
|
| 249 |
+
-------------------
|
| 250 |
+
|
| 251 |
+
Earlier we mentioned that the :file:`conf.py` file controls how Sphinx
|
| 252 |
+
processes your documents. In that file, which is executed as a Python source
|
| 253 |
+
file, you assign configuration values. For advanced users: since it is
|
| 254 |
+
executed by Sphinx, you can do non-trivial tasks in it, like extending
|
| 255 |
+
:data:`sys.path` or importing a module to find out the version you are
|
| 256 |
+
documenting.
|
| 257 |
+
|
| 258 |
+
The config values that you probably want to change are already put into the
|
| 259 |
+
:file:`conf.py` by :program:`sphinx-quickstart` and initially commented out
|
| 260 |
+
(with standard Python syntax: a ``#`` comments the rest of the line). To
|
| 261 |
+
change the default value, remove the hash sign and modify the value. To
|
| 262 |
+
customize a config value that is not automatically added by
|
| 263 |
+
:program:`sphinx-quickstart`, just add an additional assignment.
|
| 264 |
+
|
| 265 |
+
Keep in mind that the file uses Python syntax for strings, numbers, lists and
|
| 266 |
+
so on. The file is saved in UTF-8 by default, as indicated by the encoding
|
| 267 |
+
declaration in the first line.
|
| 268 |
+
|
| 269 |
+
.. seealso::
|
| 270 |
+
|
| 271 |
+
:doc:`/usage/configuration`
|
| 272 |
+
for documentation of all available config values.
|
| 273 |
+
|
| 274 |
+
|
| 275 |
+
.. todo:: Move this entire doc to a different section
|
| 276 |
+
|
| 277 |
+
Autodoc
|
| 278 |
+
-------
|
| 279 |
+
|
| 280 |
+
When documenting Python code, it is common to put a lot of documentation in the
|
| 281 |
+
source files, in documentation strings. Sphinx supports the inclusion of
|
| 282 |
+
docstrings from your modules with an :dfn:`extension` (an extension is a Python
|
| 283 |
+
module that provides additional features for Sphinx projects) called *autodoc*.
|
| 284 |
+
|
| 285 |
+
.. seealso::
|
| 286 |
+
|
| 287 |
+
:mod:`sphinx.ext.autodoc`
|
| 288 |
+
for the complete description of the features of autodoc.
|
| 289 |
+
|
| 290 |
+
Intersphinx
|
| 291 |
+
-----------
|
| 292 |
+
|
| 293 |
+
Many Sphinx documents including the `Python documentation`_ are published on
|
| 294 |
+
the Internet. When you want to make links to such documents from your
|
| 295 |
+
documentation, you can do it with :mod:`sphinx.ext.intersphinx`.
|
| 296 |
+
|
| 297 |
+
.. _Python documentation: https://docs.python.org/3
|
| 298 |
+
|
| 299 |
+
In order to use intersphinx, you need to activate it in :file:`conf.py` by
|
| 300 |
+
putting the string ``'sphinx.ext.intersphinx'`` into the :confval:`extensions`
|
| 301 |
+
list and set up the :confval:`intersphinx_mapping` config value.
|
| 302 |
+
|
| 303 |
+
For example, to link to ``io.open()`` in the Python library manual, you need to
|
| 304 |
+
setup your :confval:`intersphinx_mapping` like::
|
| 305 |
+
|
| 306 |
+
intersphinx_mapping = {'python': ('https://docs.python.org/3', None)}
|
| 307 |
+
|
| 308 |
+
And now, you can write a cross-reference like ``:py:func:`io.open```. Any
|
| 309 |
+
cross-reference that has no matching target in the current documentation set,
|
| 310 |
+
will be looked up in the documentation sets configured in
|
| 311 |
+
:confval:`intersphinx_mapping` (this needs access to the URL in order to
|
| 312 |
+
download the list of valid targets). Intersphinx also works for some other
|
| 313 |
+
:term:`domain`\'s roles including ``:ref:``, however it doesn't work for
|
| 314 |
+
``:doc:`` as that is non-domain role.
|
| 315 |
+
|
| 316 |
+
.. seealso::
|
| 317 |
+
|
| 318 |
+
:mod:`sphinx.ext.intersphinx`
|
| 319 |
+
for the complete description of the features of intersphinx.
|
| 320 |
+
|
| 321 |
+
|
| 322 |
+
More topics to be covered
|
| 323 |
+
-------------------------
|
| 324 |
+
|
| 325 |
+
- :doc:`Other extensions </usage/extensions/index>`:
|
| 326 |
+
- Static files
|
| 327 |
+
- :doc:`Selecting a theme </usage/theming>`
|
| 328 |
+
- :ref:`Templating <templating>`
|
| 329 |
+
- Using extensions
|
| 330 |
+
- :ref:`Writing extensions <dev-extensions>`
|
| 331 |
+
|
| 332 |
+
|
| 333 |
+
.. rubric:: Footnotes
|
| 334 |
+
|
| 335 |
+
.. [#] This is the usual layout. However, :file:`conf.py` can also live in
|
| 336 |
+
another directory, the :term:`configuration directory`. Refer to the
|
| 337 |
+
:doc:`sphinx-build man page </man/sphinx-build>` for more information.
|
long.tex
ADDED
|
@@ -0,0 +1,155 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
\begin{figure}
|
| 3 |
+
\centering
|
| 4 |
+
\includegraphics[scale=0.6]{Figures/ModalNet-21}
|
| 5 |
+
\caption{The Transformer - model architecture.}
|
| 6 |
+
\label{fig:model-arch}
|
| 7 |
+
\end{figure}
|
| 8 |
+
|
| 9 |
+
% Although the primary workhorse of our model is attention,
|
| 10 |
+
%Our model maintains the encoder-decoder structure that is common to many so-called sequence-to-sequence models \citep{bahdanau2014neural,sutskever14}. As in all such architectures, the encoder computes a representation of the input sequence, and the decoder consumes these representations along with the output tokens to autoregressively produce the output sequence. Where, traditionally, the encoder and decoder contain stacks of recurrent or convolutional layers, our encoder and decoder stacks are composed of attention layers and position-wise feed-forward layers (Figure~\ref{fig:model-arch}). The following sections describe the gross architecture and these particular components in detail.
|
| 11 |
+
|
| 12 |
+
Most competitive neural sequence transduction models have an encoder-decoder structure \citep{cho2014learning,bahdanau2014neural,sutskever14}. Here, the encoder maps an input sequence of symbol representations $(x_1, ..., x_n)$ to a sequence of continuous representations $\mathbf{z} = (z_1, ..., z_n)$. Given $\mathbf{z}$, the decoder then generates an output sequence $(y_1,...,y_m)$ of symbols one element at a time. At each step the model is auto-regressive \citep{graves2013generating}, consuming the previously generated symbols as additional input when generating the next.
|
| 13 |
+
|
| 14 |
+
The Transformer follows this overall architecture using stacked self-attention and point-wise, fully connected layers for both the encoder and decoder, shown in the left and right halves of Figure~\ref{fig:model-arch}, respectively.
|
| 15 |
+
|
| 16 |
+
\subsection{Encoder and Decoder Stacks}
|
| 17 |
+
|
| 18 |
+
\paragraph{Encoder:}The encoder is composed of a stack of $N=6$ identical layers. Each layer has two sub-layers. The first is a multi-head self-attention mechanism, and the second is a simple, position-wise fully connected feed-forward network. We employ a residual connection \citep{he2016deep} around each of the two sub-layers, followed by layer normalization \cite{layernorm2016}. That is, the output of each sub-layer is $\mathrm{LayerNorm}(x + \mathrm{Sublayer}(x))$, where $\mathrm{Sublayer}(x)$ is the function implemented by the sub-layer itself. To facilitate these residual connections, all sub-layers in the model, as well as the embedding layers, produce outputs of dimension $\dmodel=512$.
|
| 19 |
+
|
| 20 |
+
\paragraph{Decoder:}The decoder is also composed of a stack of $N=6$ identical layers. In addition to the two sub-layers in each encoder layer, the decoder inserts a third sub-layer, which performs multi-head attention over the output of the encoder stack. Similar to the encoder, we employ residual connections around each of the sub-layers, followed by layer normalization. We also modify the self-attention sub-layer in the decoder stack to prevent positions from attending to subsequent positions. This masking, combined with fact that the output embeddings are offset by one position, ensures that the predictions for position $i$ can depend only on the known outputs at positions less than $i$.
|
| 21 |
+
|
| 22 |
+
% In our model (Figure~\ref{fig:model-arch}), the encoder and decoder are composed of stacks of alternating self-attention layers (for cross-positional communication) and position-wise feed-forward layers (for in-place computation). In addition, the decoder stack contains encoder-decoder attention layers. Since attention is agnostic to the distances between words, our model requires a "positional encoding" to be added to the encoder and decoder input. The following sections describe all of these components in detail.
|
| 23 |
+
|
| 24 |
+
\subsection{Attention} \label{sec:attention}
|
| 25 |
+
An attention function can be described as mapping a query and a set of key-value pairs to an output, where the query, keys, values, and output are all vectors. The output is computed as a weighted sum of the values, where the weight assigned to each value is computed by a compatibility function of the query with the corresponding key.
|
| 26 |
+
|
| 27 |
+
\subsubsection{Scaled Dot-Product Attention} \label{sec:scaled-dot-prod}
|
| 28 |
+
|
| 29 |
+
% \begin{figure}
|
| 30 |
+
% \centering
|
| 31 |
+
% \includegraphics[scale=0.6]{Figures/ModalNet-19}
|
| 32 |
+
% \caption{Scaled Dot-Product Attention.}
|
| 33 |
+
% \label{fig:multi-head-att}
|
| 34 |
+
% \end{figure}
|
| 35 |
+
|
| 36 |
+
We call our particular attention "Scaled Dot-Product Attention" (Figure~\ref{fig:multi-head-att}). The input consists of queries and keys of dimension $d_k$, and values of dimension $d_v$. We compute the dot products of the query with all keys, divide each by $\sqrt{d_k}$, and apply a softmax function to obtain the weights on the values.
|
| 37 |
+
|
| 38 |
+
In practice, we compute the attention function on a set of queries simultaneously, packed together into a matrix $Q$. The keys and values are also packed together into matrices $K$ and $V$. We compute the matrix of outputs as:
|
| 39 |
+
|
| 40 |
+
\begin{equation}
|
| 41 |
+
\mathrm{Attention}(Q, K, V) = \mathrm{softmax}(\frac{QK^T}{\sqrt{d_k}})V
|
| 42 |
+
\end{equation}
|
| 43 |
+
|
| 44 |
+
The two most commonly used attention functions are additive attention \citep{bahdanau2014neural}, and dot-product (multiplicative) attention. Dot-product attention is identical to our algorithm, except for the scaling factor of $\frac{1}{\sqrt{d_k}}$. Additive attention computes the compatibility function using a feed-forward network with a single hidden layer. While the two are similar in theoretical complexity, dot-product attention is much faster and more space-efficient in practice, since it can be implemented using highly optimized matrix multiplication code.
|
| 45 |
+
|
| 46 |
+
%We scale the dot products by $1/\sqrt{d_k}$ to limit the magnitude of the dot products, which works well in practice. Otherwise, we found applying the softmax to often result in weights very close to 0 or 1, and hence minuscule gradients.
|
| 47 |
+
|
| 48 |
+
% Already described in the subsequent section
|
| 49 |
+
%When used as part of decoder self-attention, an optional mask function is applied just before the softmax to prevent positions from attending to subsequent positions. This mask simply sets the logits corresponding to all illegal connections (those outside of the lower triangle) to $-\infty$.
|
| 50 |
+
|
| 51 |
+
%\paragraph{Comparison to Additive Attention: } We choose dot product attention over additive attention \citep{bahdanau2014neural} since it can be computed using highly optimized matrix multiplication code. This optimization is particularly important to us, as we employ many attention layers in our model.
|
| 52 |
+
|
| 53 |
+
While for small values of $d_k$ the two mechanisms perform similarly, additive attention outperforms dot product attention without scaling for larger values of $d_k$ \citep{DBLP:journals/corr/BritzGLL17}. We suspect that for large values of $d_k$, the dot products grow large in magnitude, pushing the softmax function into regions where it has extremely small gradients \footnote{To illustrate why the dot products get large, assume that the components of $q$ and $k$ are independent random variables with mean $0$ and variance $1$. Then their dot product, $q \cdot k = \sum_{i=1}^{d_k} q_ik_i$, has mean $0$ and variance $d_k$.}. To counteract this effect, we scale the dot products by $\frac{1}{\sqrt{d_k}}$.
|
| 54 |
+
|
| 55 |
+
|
| 56 |
+
%We suspect this to be caused by the dot products growing too large in magnitude to result in useful gradients after applying the softmax function. To counteract this, we scale the dot product by $1/\sqrt{d_k}$.
|
| 57 |
+
|
| 58 |
+
|
| 59 |
+
\subsubsection{Multi-Head Attention} \label{sec:multihead}
|
| 60 |
+
|
| 61 |
+
\begin{figure}
|
| 62 |
+
\begin{minipage}[t]{0.5\textwidth}
|
| 63 |
+
\centering
|
| 64 |
+
Scaled Dot-Product Attention \\
|
| 65 |
+
\vspace{0.5cm}
|
| 66 |
+
\includegraphics[scale=0.6]{Figures/ModalNet-19}
|
| 67 |
+
\end{minipage}
|
| 68 |
+
\begin{minipage}[t]{0.5\textwidth}
|
| 69 |
+
\centering
|
| 70 |
+
Multi-Head Attention \\
|
| 71 |
+
\vspace{0.1cm}
|
| 72 |
+
\includegraphics[scale=0.6]{Figures/ModalNet-20}
|
| 73 |
+
\end{minipage}
|
| 74 |
+
|
| 75 |
+
|
| 76 |
+
% \centering
|
| 77 |
+
|
| 78 |
+
\caption{(left) Scaled Dot-Product Attention. (right) Multi-Head Attention consists of several attention layers running in parallel.}
|
| 79 |
+
\label{fig:multi-head-att}
|
| 80 |
+
\end{figure}
|
| 81 |
+
|
| 82 |
+
Instead of performing a single attention function with $\dmodel$-dimensional keys, values and queries, we found it beneficial to linearly project the queries, keys and values $h$ times with different, learned linear projections to $d_k$, $d_k$ and $d_v$ dimensions, respectively.
|
| 83 |
+
On each of these projected versions of queries, keys and values we then perform the attention function in parallel, yielding $d_v$-dimensional output values. These are concatenated and once again projected, resulting in the final values, as depicted in Figure~\ref{fig:multi-head-att}.
|
| 84 |
+
|
| 85 |
+
Multi-head attention allows the model to jointly attend to information from different representation subspaces at different positions. With a single attention head, averaging inhibits this.
|
| 86 |
+
|
| 87 |
+
\begin{align*}
|
| 88 |
+
\mathrm{MultiHead}(Q, K, V) &= \mathrm{Concat}(\mathrm{head_1}, ..., \mathrm{head_h})W^O\\
|
| 89 |
+
% \mathrm{where} \mathrm{head_i} &= \mathrm{Attention}(QW_Q_i^{\dmodel \times d_q}, KW_K_i^{\dmodel \times d_k}, VW^V_i^{\dmodel \times d_v})\\
|
| 90 |
+
\text{where}~\mathrm{head_i} &= \mathrm{Attention}(QW^Q_i, KW^K_i, VW^V_i)\\
|
| 91 |
+
\end{align*}
|
| 92 |
+
|
| 93 |
+
Where the projections are parameter matrices $W^Q_i \in \mathbb{R}^{\dmodel \times d_k}$, $W^K_i \in \mathbb{R}^{\dmodel \times d_k}$, $W^V_i \in \mathbb{R}^{\dmodel \times d_v}$ and $W^O \in \mathbb{R}^{hd_v \times \dmodel}$.
|
| 94 |
+
|
| 95 |
+
|
| 96 |
+
%find it better (and no more expensive) to have multiple parallel attention layers (each over the full set of positions) with proportionally lower-dimensional keys, values and queries. We call this "Multi-Head Attention" (Figure~\ref{fig:multi-head-att}). The keys, values, and queries for each of these parallel attention layers are computed by learned linear transformations of the inputs to the multi-head attention. We use different linear transformations across different parallel attention layers. The output of the parallel attention layers are concatenated, and then passed through a final learned linear transformation.
|
| 97 |
+
|
| 98 |
+
In this work we employ $h=8$ parallel attention layers, or heads. For each of these we use $d_k=d_v=\dmodel/h=64$.
|
| 99 |
+
Due to the reduced dimension of each head, the total computational cost is similar to that of single-head attention with full dimensionality.
|
| 100 |
+
|
| 101 |
+
\subsubsection{Applications of Attention in our Model}
|
| 102 |
+
|
| 103 |
+
The Transformer uses multi-head attention in three different ways:
|
| 104 |
+
\begin{itemize}
|
| 105 |
+
\item In "encoder-decoder attention" layers, the queries come from the previous decoder layer, and the memory keys and values come from the output of the encoder. This allows every position in the decoder to attend over all positions in the input sequence. This mimics the typical encoder-decoder attention mechanisms in sequence-to-sequence models such as \citep{wu2016google, bahdanau2014neural,JonasFaceNet2017}.
|
| 106 |
+
|
| 107 |
+
\item The encoder contains self-attention layers. In a self-attention layer all of the keys, values and queries come from the same place, in this case, the output of the previous layer in the encoder. Each position in the encoder can attend to all positions in the previous layer of the encoder.
|
| 108 |
+
|
| 109 |
+
\item Similarly, self-attention layers in the decoder allow each position in the decoder to attend to all positions in the decoder up to and including that position. We need to prevent leftward information flow in the decoder to preserve the auto-regressive property. We implement this inside of scaled dot-product attention by masking out (setting to $-\infty$) all values in the input of the softmax which correspond to illegal connections. See Figure~\ref{fig:multi-head-att}.
|
| 110 |
+
|
| 111 |
+
\end{itemize}
|
| 112 |
+
|
| 113 |
+
\subsection{Position-wise Feed-Forward Networks}\label{sec:ffn}
|
| 114 |
+
|
| 115 |
+
In addition to attention sub-layers, each of the layers in our encoder and decoder contains a fully connected feed-forward network, which is applied to each position separately and identically. This consists of two linear transformations with a ReLU activation in between.
|
| 116 |
+
|
| 117 |
+
\begin{equation}
|
| 118 |
+
\mathrm{FFN}(x)=\max(0, xW_1 + b_1) W_2 + b_2
|
| 119 |
+
\end{equation}
|
| 120 |
+
|
| 121 |
+
While the linear transformations are the same across different positions, they use different parameters from layer to layer. Another way of describing this is as two convolutions with kernel size 1. The dimensionality of input and output is $\dmodel=512$, and the inner-layer has dimensionality $d_{ff}=2048$.
|
| 122 |
+
|
| 123 |
+
|
| 124 |
+
|
| 125 |
+
%In the appendix, we describe how the position-wise feed-forward network can also be seen as a form of attention.
|
| 126 |
+
|
| 127 |
+
%from Jakob: The number of operations required for the model to relate signals from two arbitrary input or output positions grows in the distance between positions in input or output, linearly for ConvS2S and logarithmically for ByteNet, making it harder to learn dependencies between these positions \citep{hochreiter2001gradient}. In the transformer this is reduced to a constant number of operations, albeit at the cost of effective resolution caused by averaging attention-weighted positions, an effect we aim to counteract with multi-headed attention.
|
| 128 |
+
|
| 129 |
+
|
| 130 |
+
%Figure~\ref{fig:simple-att} presents a simple attention function, $A$, with a single head, that forms the basis of our multi-head attention. $A$ takes a query key vector $\kq$, matrices of memory keys $\km$ and memory values $\vm$ ,and produces a query value vector $\vq$ as
|
| 131 |
+
%\begin{equation*} \label{eq:attention}
|
| 132 |
+
% A(\kq, \km, \vm) = {\vm}^T (Softmax(\km \kq).
|
| 133 |
+
%\end{equation*}
|
| 134 |
+
%We linearly transform $\kq,\,\km$, and $\vm$ with learned matrices ${\Wkq \text{,} \, \Wkm}$, and ${\Wvm}$ before calling the attention function, and transform the output query with $\Wvq$ before handing it to the feed forward layer. Each attention layer has it's own set of transformation matrices, which are shared across all query positions. $A$ is applied in parallel for each query position, and is implemented very efficiently as a batch of matrix multiplies. The self-attention and encoder-decoder attention layers use $A$, but with different arguments. For example, in encdoder self-attention, queries in encoder layer $i$ attention to memories in encoder layer $i-1$. To ensure that decoder self-attention layers do not look at future words, we add $- \inf$ to the softmax logits in positions $j+1$ to query length for query position $l$.
|
| 135 |
+
|
| 136 |
+
%In simple attention, the query value is a weighted combination of the memory values where the attention weights sum to one. Although this function performs well in practice, the constraint on attention weights can restrict the amount of information that flows from memories to queries because the query cannot focus on multiple memory positions at once, which might be desirable when translating long sequences. \marginpar{@usz, could you think of an example of this ?} We remedy this by maintaining multiple attention heads at each query position that attend to all memory positions in parallel, with a different set of parameters per attention head $h$.
|
| 137 |
+
%\marginpar{}
|
| 138 |
+
|
| 139 |
+
\subsection{Embeddings and Softmax}
|
| 140 |
+
Similarly to other sequence transduction models, we use learned embeddings to convert the input tokens and output tokens to vectors of dimension $\dmodel$. We also use the usual learned linear transformation and softmax function to convert the decoder output to predicted next-token probabilities. In our model, we share the same weight matrix between the two embedding layers and the pre-softmax linear transformation, similar to \citep{press2016using}. In the embedding layers, we multiply those weights by $\sqrt{\dmodel}$.
|
| 141 |
+
|
| 142 |
+
|
| 143 |
+
\subsection{Positional Encoding}
|
| 144 |
+
Since our model contains no recurrence and no convolution, in order for the model to make use of the order of the sequence, we must inject some information about the relative or absolute position of the tokens in the sequence. To this end, we add "positional encodings" to the input embeddings at the bottoms of the encoder and decoder stacks. The positional encodings have the same dimension $\dmodel$ as the embeddings, so that the two can be summed. There are many choices of positional encodings, learned and fixed \citep{JonasFaceNet2017}.
|
| 145 |
+
|
| 146 |
+
In this work, we use sine and cosine functions of different frequencies:
|
| 147 |
+
|
| 148 |
+
\begin{align*}
|
| 149 |
+
PE_{(pos,2i)} = sin(pos / 10000^{2i/\dmodel}) \\
|
| 150 |
+
PE_{(pos,2i+1)} = cos(pos / 10000^{2i/\dmodel})
|
| 151 |
+
\end{align*}
|
| 152 |
+
|
| 153 |
+
where $pos$ is the position and $i$ is the dimension. That is, each dimension of the positional encoding corresponds to a sinusoid. The wavelengths form a geometric progression from $2\pi$ to $10000 \cdot 2\pi$. We chose this function because we hypothesized it would allow the model to easily learn to attend by relative positions, since for any fixed offset $k$, $PE_{pos+k}$ can be represented as a linear function of $PE_{pos}$.
|
| 154 |
+
|
| 155 |
+
We also experimented with using learned positional embeddings \citep{JonasFaceNet2017} instead, and found that the two versions produced nearly identical results (see Table~\ref{tab:variations} row (E)). We chose the sinusoidal version because it may allow the model to extrapolate to sequence lengths longer than the ones encountered during training.
|
long.toml
ADDED
|
@@ -0,0 +1,232 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[build-system]
|
| 2 |
+
build-backend = "mesonpy"
|
| 3 |
+
requires = [
|
| 4 |
+
"meson-python>=0.15.0",
|
| 5 |
+
"Cython>=3.0.6", # keep in sync with version check in meson.build
|
| 6 |
+
]
|
| 7 |
+
|
| 8 |
+
[project]
|
| 9 |
+
name = "numpy"
|
| 10 |
+
version = "2.3.0.dev0"
|
| 11 |
+
# TODO: add `license-files` once PEP 639 is accepted (see meson-python#88)
|
| 12 |
+
license = {file = "LICENSE.txt"}
|
| 13 |
+
|
| 14 |
+
description = "Fundamental package for array computing in Python"
|
| 15 |
+
authors = [{name = "Travis E. Oliphant et al."}]
|
| 16 |
+
maintainers = [
|
| 17 |
+
{name = "NumPy Developers", email="numpy-discussion@python.org"},
|
| 18 |
+
]
|
| 19 |
+
requires-python = ">=3.11"
|
| 20 |
+
readme = "README.md"
|
| 21 |
+
classifiers = [
|
| 22 |
+
'Development Status :: 5 - Production/Stable',
|
| 23 |
+
'Intended Audience :: Science/Research',
|
| 24 |
+
'Intended Audience :: Developers',
|
| 25 |
+
'License :: OSI Approved :: BSD License',
|
| 26 |
+
'Programming Language :: C',
|
| 27 |
+
'Programming Language :: Python',
|
| 28 |
+
'Programming Language :: Python :: 3',
|
| 29 |
+
'Programming Language :: Python :: 3.11',
|
| 30 |
+
'Programming Language :: Python :: 3.12',
|
| 31 |
+
'Programming Language :: Python :: 3.13',
|
| 32 |
+
'Programming Language :: Python :: 3 :: Only',
|
| 33 |
+
'Programming Language :: Python :: Implementation :: CPython',
|
| 34 |
+
'Topic :: Software Development',
|
| 35 |
+
'Topic :: Scientific/Engineering',
|
| 36 |
+
'Typing :: Typed',
|
| 37 |
+
'Operating System :: Microsoft :: Windows',
|
| 38 |
+
'Operating System :: POSIX',
|
| 39 |
+
'Operating System :: Unix',
|
| 40 |
+
'Operating System :: MacOS',
|
| 41 |
+
]
|
| 42 |
+
|
| 43 |
+
[project.scripts]
|
| 44 |
+
f2py = 'numpy.f2py.f2py2e:main'
|
| 45 |
+
numpy-config = 'numpy._configtool:main'
|
| 46 |
+
|
| 47 |
+
[project.entry-points.pkg_config]
|
| 48 |
+
numpy = 'numpy._core.lib.pkgconfig'
|
| 49 |
+
|
| 50 |
+
[project.entry-points.array_api]
|
| 51 |
+
numpy = 'numpy'
|
| 52 |
+
|
| 53 |
+
[project.entry-points.pyinstaller40]
|
| 54 |
+
hook-dirs = 'numpy:_pyinstaller_hooks_dir'
|
| 55 |
+
|
| 56 |
+
[project.urls]
|
| 57 |
+
homepage = "https://numpy.org"
|
| 58 |
+
documentation = "https://numpy.org/doc/"
|
| 59 |
+
source = "https://github.com/numpy/numpy"
|
| 60 |
+
download = "https://pypi.org/project/numpy/#files"
|
| 61 |
+
tracker = "https://github.com/numpy/numpy/issues"
|
| 62 |
+
"release notes" = "https://numpy.org/doc/stable/release"
|
| 63 |
+
|
| 64 |
+
[tool.towncrier]
|
| 65 |
+
single_file = false
|
| 66 |
+
filename = "doc/source/release/notes-towncrier.rst"
|
| 67 |
+
directory = "doc/release/upcoming_changes/"
|
| 68 |
+
issue_format = "`gh-{issue} <https://github.com/numpy/numpy/pull/{issue}>`__"
|
| 69 |
+
template = "doc/release/upcoming_changes/template.rst"
|
| 70 |
+
underlines = "~="
|
| 71 |
+
all_bullets = false
|
| 72 |
+
|
| 73 |
+
|
| 74 |
+
[[tool.towncrier.type]]
|
| 75 |
+
directory = "highlight"
|
| 76 |
+
name = "Highlights"
|
| 77 |
+
showcontent = true
|
| 78 |
+
|
| 79 |
+
[[tool.towncrier.type]]
|
| 80 |
+
directory = "new_function"
|
| 81 |
+
name = "New functions"
|
| 82 |
+
showcontent = true
|
| 83 |
+
|
| 84 |
+
[[tool.towncrier.type]]
|
| 85 |
+
directory = "python_removal"
|
| 86 |
+
name = "NumPy 2.0 Python API removals"
|
| 87 |
+
showcontent = true
|
| 88 |
+
|
| 89 |
+
[[tool.towncrier.type]]
|
| 90 |
+
directory = "deprecation"
|
| 91 |
+
name = "Deprecations"
|
| 92 |
+
showcontent = true
|
| 93 |
+
|
| 94 |
+
[[tool.towncrier.type]]
|
| 95 |
+
directory = "future"
|
| 96 |
+
name = "Future Changes"
|
| 97 |
+
showcontent = true
|
| 98 |
+
|
| 99 |
+
[[tool.towncrier.type]]
|
| 100 |
+
directory = "expired"
|
| 101 |
+
name = "Expired deprecations"
|
| 102 |
+
showcontent = true
|
| 103 |
+
|
| 104 |
+
[[tool.towncrier.type]]
|
| 105 |
+
directory = "compatibility"
|
| 106 |
+
name = "Compatibility notes"
|
| 107 |
+
showcontent = true
|
| 108 |
+
|
| 109 |
+
[[tool.towncrier.type]]
|
| 110 |
+
directory = "c_api"
|
| 111 |
+
name = "C API changes"
|
| 112 |
+
showcontent = true
|
| 113 |
+
|
| 114 |
+
[[tool.towncrier.type]]
|
| 115 |
+
directory = "c_api_removal"
|
| 116 |
+
name = "NumPy 2.0 C API removals"
|
| 117 |
+
showcontent = true
|
| 118 |
+
|
| 119 |
+
[[tool.towncrier.type]]
|
| 120 |
+
directory = "new_feature"
|
| 121 |
+
name = "New Features"
|
| 122 |
+
showcontent = true
|
| 123 |
+
|
| 124 |
+
[[tool.towncrier.type]]
|
| 125 |
+
directory = "improvement"
|
| 126 |
+
name = "Improvements"
|
| 127 |
+
showcontent = true
|
| 128 |
+
|
| 129 |
+
[[tool.towncrier.type]]
|
| 130 |
+
directory = "performance"
|
| 131 |
+
name = "Performance improvements and changes"
|
| 132 |
+
showcontent = true
|
| 133 |
+
|
| 134 |
+
[[tool.towncrier.type]]
|
| 135 |
+
directory = "change"
|
| 136 |
+
name = "Changes"
|
| 137 |
+
showcontent = true
|
| 138 |
+
|
| 139 |
+
|
| 140 |
+
[tool.cibuildwheel]
|
| 141 |
+
# Note: the below skip command doesn't do much currently, the platforms to
|
| 142 |
+
# build wheels for in CI are controlled in `.github/workflows/wheels.yml` and
|
| 143 |
+
# `tools/ci/cirrus_wheels.yml`.
|
| 144 |
+
build-frontend = "build"
|
| 145 |
+
skip = "*_i686 *_ppc64le *_s390x *_universal2"
|
| 146 |
+
before-build = "bash {project}/tools/wheels/cibw_before_build.sh {project}"
|
| 147 |
+
# The build will use openblas64 everywhere, except on arm64 macOS >=14.0 (uses Accelerate)
|
| 148 |
+
config-settings = "setup-args=-Duse-ilp64=true setup-args=-Dallow-noblas=false build-dir=build"
|
| 149 |
+
before-test = "pip install -r {project}/requirements/test_requirements.txt"
|
| 150 |
+
test-command = "bash {project}/tools/wheels/cibw_test_command.sh {project}"
|
| 151 |
+
enable = ["cpython-freethreading", "pypy", "cpython-prerelease"]
|
| 152 |
+
|
| 153 |
+
[tool.cibuildwheel.linux]
|
| 154 |
+
manylinux-x86_64-image = "manylinux_2_28"
|
| 155 |
+
manylinux-aarch64-image = "manylinux_2_28"
|
| 156 |
+
musllinux-x86_64-image = "musllinux_1_2"
|
| 157 |
+
musllinux-aarch64-image = "musllinux_1_2"
|
| 158 |
+
|
| 159 |
+
[tool.cibuildwheel.pyodide]
|
| 160 |
+
config-settings = "build-dir=build setup-args=--cross-file=$PWD/tools/ci/emscripten/emscripten.meson.cross setup-args=-Dblas=none setup-args=-Dlapack=none"
|
| 161 |
+
|
| 162 |
+
[tool.cibuildwheel.linux.environment]
|
| 163 |
+
# RUNNER_OS is a GitHub Actions specific env var; define it here so it works on Cirrus CI too
|
| 164 |
+
RUNNER_OS="Linux"
|
| 165 |
+
# /project will be the $PWD equivalent inside the docker used to build the wheel
|
| 166 |
+
PKG_CONFIG_PATH="/project/.openblas"
|
| 167 |
+
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/project/.openblas/lib"
|
| 168 |
+
|
| 169 |
+
[tool.cibuildwheel.macos]
|
| 170 |
+
# universal2 wheels are not supported (see gh-21233), use `delocate-fuse` if you need them
|
| 171 |
+
# note that universal2 wheels are not built, they're listed in the tool.cibuildwheel.skip
|
| 172 |
+
# section
|
| 173 |
+
# Not clear why the DYLD_LIBRARY_PATH is not passed through from the environment
|
| 174 |
+
repair-wheel-command = [
|
| 175 |
+
"export DYLD_LIBRARY_PATH=$PWD/.openblas/lib",
|
| 176 |
+
"echo DYLD_LIBRARY_PATH $DYLD_LIBRARY_PATH",
|
| 177 |
+
"delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}",
|
| 178 |
+
]
|
| 179 |
+
|
| 180 |
+
[tool.cibuildwheel.windows]
|
| 181 |
+
# This does not work, use CIBW_ENVIRONMENT_WINDOWS
|
| 182 |
+
environment = {PKG_CONFIG_PATH="./.openblas"}
|
| 183 |
+
config-settings = "setup-args=--vsenv setup-args=-Dallow-noblas=false build-dir=build"
|
| 184 |
+
repair-wheel-command = "bash -el ./tools/wheels/repair_windows.sh {wheel} {dest_dir}"
|
| 185 |
+
|
| 186 |
+
[[tool.cibuildwheel.overrides]]
|
| 187 |
+
select = "*-win32"
|
| 188 |
+
config-settings = "setup-args=--vsenv setup-args=-Dallow-noblas=true build-dir=build"
|
| 189 |
+
repair-wheel-command = ""
|
| 190 |
+
|
| 191 |
+
[[tool.cibuildwheel.overrides]]
|
| 192 |
+
select = "*pyodide*"
|
| 193 |
+
before-test = "pip install -r {project}/requirements/emscripten_test_requirements.txt"
|
| 194 |
+
# Pyodide ensures that the wheels are already repaired by auditwheel-emscripten
|
| 195 |
+
repair-wheel-command = ""
|
| 196 |
+
test-command = "python -m pytest --pyargs numpy -m 'not slow'"
|
| 197 |
+
|
| 198 |
+
[tool.meson-python]
|
| 199 |
+
meson = 'vendored-meson/meson/meson.py'
|
| 200 |
+
|
| 201 |
+
[tool.meson-python.args]
|
| 202 |
+
install = ['--tags=runtime,python-runtime,tests,devel']
|
| 203 |
+
|
| 204 |
+
[tool.spin]
|
| 205 |
+
package = 'numpy'
|
| 206 |
+
|
| 207 |
+
[tool.spin.meson]
|
| 208 |
+
cli = 'vendored-meson/meson/meson.py'
|
| 209 |
+
|
| 210 |
+
[tool.spin.commands]
|
| 211 |
+
"Build" = [
|
| 212 |
+
".spin/cmds.py:build",
|
| 213 |
+
".spin/cmds.py:test",
|
| 214 |
+
".spin/cmds.py:mypy",
|
| 215 |
+
".spin/cmds.py:config_openblas",
|
| 216 |
+
".spin/cmds.py:lint",
|
| 217 |
+
]
|
| 218 |
+
"Environments" = [
|
| 219 |
+
"spin.cmds.meson.run",
|
| 220 |
+
".spin/cmds.py:ipython",
|
| 221 |
+
".spin/cmds.py:python",
|
| 222 |
+
"spin.cmds.meson.gdb",
|
| 223 |
+
"spin.cmds.meson.lldb"
|
| 224 |
+
]
|
| 225 |
+
"Documentation" = [
|
| 226 |
+
".spin/cmds.py:docs",
|
| 227 |
+
".spin/cmds.py:changelog",
|
| 228 |
+
".spin/cmds.py:notes",
|
| 229 |
+
".spin/cmds.py:check_docs",
|
| 230 |
+
".spin/cmds.py:check_tutorials",
|
| 231 |
+
]
|
| 232 |
+
"Metrics" = [".spin/cmds.py:bench"]
|
long.txt
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
William Daniel Leahy (/ˈleɪhi, ˈleɪ.i/; 6 May 1875 – 20 July 1959) was an American naval officer. The most senior United States military officer on active duty during World War II, he held several titles and exercised considerable influence over foreign and military policy. As a fleet admiral, he was the first flag officer ever to hold a five-star rank in the U.S. Armed Forces.
|
| 2 |
+
|
| 3 |
+
An 1897 graduate of Annapolis, Leahy saw active service in the Spanish–American War, the Philippine Insurrection, the Boxer Rebellion in China, the Banana Wars in Central America, and World War I. He was the first member of his cadet class to reach flag rank, as the Chief of the Bureau of Ordnance from 1927 to 1931. He subsequently served as Chief of the Bureau of Navigation from 1933 to 1936, and commanded the Battle Fleet from 1936 to 1937. As Chief of Naval Operations from 1937 to 1939, he was the senior officer in the United States Navy, overseeing the expansion of the fleet and preparations for war.
|
| 4 |
+
|
| 5 |
+
After retiring from the Navy, Leahy was appointed the governor of Puerto Rico in 1939 by President Franklin D. Roosevelt. In his most controversial role, he served as the Ambassador to France from 1940 to 1942. American policy was aimed at keeping the government of Vichy France free of German control, but Leahy had limited success and came to believe the United States should back Free France instead of Vichy France. He asked to be recalled to the United States after the Japanese attack on Pearl Harbor brought the United States into the Second World War.
|
| 6 |
+
|
| 7 |
+
Leahy was recalled to active duty and became the Chief of Staff to President Roosevelt in 1942, serving in that position for the rest of the war. As the de facto first Chairman of the Joint Chiefs of Staff, he oversaw all of the American armed forces and was a major decision-maker during the war. He also presided over the American delegation to the Combined Chiefs of Staff. In December 1944, he was promoted to the five-star rank of fleet admiral. In the aftermath of World War II, he served Roosevelt's successor Harry S. Truman, helping shape postwar foreign policy until he retired in 1949. Although he did not oppose the use of the nuclear weapons during the war, in the post-war period he rejected war plans that overemphasised the first use of nuclear weapons.
|
| 8 |
+
|
| 9 |
+
Early life and education
|
| 10 |
+
refer to caption
|
| 11 |
+
As a naval cadet
|
| 12 |
+
William Daniel Leahy was born in Hampton, Iowa, on 6 May 1875, the first of seven children of Michael Anthony Leahy,[1][2] a lawyer and American Civil War veteran,[3] who was elected to the Iowa Legislature in 1872,[1][4] and his wife Rose Mary née Hamilton.[1] Both parents were born in the United States but his grandparents were immigrants from Ireland.[5] He had five brothers and a sister.[1] His father was re-elected in 1874,[4] but moved to Wausau, Wisconsin, in 1882. In 1889, the family moved again, this time to Ashland, Wisconsin, where Leahy attended high school. His nose was broken in an American football match and his family lacked the money to get it fixed, so it remained crooked for the rest of his life.[1]
|
| 13 |
+
|
| 14 |
+
Leahy wanted to attend the United States Military Academy at West Point, New York, but this required a Congressional appointment, and Leahy was unable to secure one. His local congressman, Thomas Lynch,[6] offered Leahy an appointment to the United States Naval Academy in Annapolis, Maryland, which was much less popular among boys in the landlocked Midwestern United States. Leahy passed the entrance examinations and was admitted as a naval cadet in May 1893.[3][7]
|
| 15 |
+
|
| 16 |
+
Leahy learned how to sail on the USS Constellation on a summer cruise to Europe, although the vessel only made it as far as the Azores before breaking down.[7] He graduated 35th out of 47 in the class of 1897.[8][9][10] His class was the most successful ever: five of its members reached four-star rank while on active duty: Leahy, Thomas C. Hart, Arthur J. Hepburn, Orin G. Murfin, and Harry E. Yarnell. As of 2022, no other class has had more than four.[11]
|
| 17 |
+
|
| 18 |
+
Naval service
|
| 19 |
+
Spanish–American War
|
| 20 |
+
Until 1912, naval cadets graduating from Annapolis had to complete two years' duty at sea and pass examinations before they could be commissioned as ensigns.[12] Leahy was assigned to the battleship USS Oregon, which was then at Vancouver, British Columbia, for celebrations of Queen Victoria's Diamond Jubilee.[13] He was on board when she made a dash through the Strait of Magellan, and around South America in the spring of 1898 to participate in the Spanish–American War.[14] The Oregon took part in the blockade and bombardment of Santiago and shelled the small town of Guantánamo, which Leahy felt was "unnecessary and cruel."[15] In the Battle of Santiago on 3 July,[14] Leahy was in command of the ship's forward turret.[16] This was the only naval battle Leahy witnessed in person.[17]
|
| 21 |
+
|
| 22 |
+
Seeking further action, Leahy volunteered to serve on the gunboat USS Castine. The ship was bound for the war in the Pacific, traveling via the Mediterranean Sea and Suez Canal, but he got only as far as Ceylon when he received orders to report to Annapolis for his final ensign's examinations. He was left at Ceylon, and had to return to the United States on the USS Buffalo. He reached Annapolis in June 1899.[16] He passed his examinations, and was commissioned as an ensign on 1 July 1899.[9] After a few weeks' leave, spent with his parents in Wisconsin, and a few months' service on the cruiser USS Philadelphia at the Mare Island Navy Yard, he joined the monitor USS Nevada on 12 October 1899. A week later it set sail for the Philippines. It arrived in Manila on 24 November, and Leahy rejoined the crew of the Castine five days later.[18]
|
| 23 |
+
|
| 24 |
+
China and Philippine–American Wars
|
| 25 |
+
On 17 December 1899, Castine sailed for Nagasaki, but it developed engine trouble on 12 February 1900 and stopped in Shanghai to make repairs. While it was there, the Boxer Rebellion broke out in China; the ship was retained in Shanghai to help British, French and Japanese forces guard the city.[19] Leahy did not like their chances if the 4,500 Chinese troops in the vicinity joined the uprising, as they had in the Battle of Tientsin.[20] On 28 August, the Castine was ordered to Amoy to protect American interests in fear of a Japanese coup.[21] After the threat had passed, the Castine returned to the Philippines, arriving back in Manila on 16 September 1900.[22][23]
|
| 26 |
+
|
| 27 |
+
William Harrington Leahy is still a baby
|
| 28 |
+
With wife Louise and son William Harrington Leahy at Mare Island, California, in October 1905
|
| 29 |
+
The Philippine–American War was still ongoing, and the Castine supported American operations on Marinduque and Iloilo.[24] Leahy was appalled by American brutality and the widespread use of torture.[24][25] Still an ensign, he was given his first command, the gunboat USS Mariveles, a refitted ex-Spanish vessel. It had a crew of 23. His period in command ended when the Mariveles lost one of its propellers and had to be laid up for repairs. He was then reassigned to the USS Glacier, a stores ship which was engaged in bringing supplies from Australia to the Philippines. While in the Philippines he passed the examinations required for promotion to lieutenant, junior grade, and was promoted to that rank on 1 July 1902. He made his final trip to the Philippines in September 1902, and returned to the United States later that year.[9][26]
|
| 30 |
+
|
| 31 |
+
Sea duty alternated with duty ashore. Leahy was assigned to the training ship USS Pensacola in San Francisco,[27] where he was promoted to lieutenant on 31 December 1903.[9] He met and courted Louise Tennent Harrington. Leahy married Louise on 3 February 1904.[27][28][29] Louise subsequently convinced him to convert to Episcopalianism.[30]
|
| 32 |
+
|
| 33 |
+
Leahy helped commission the cruiser USS Tacoma but swapped assignments with an officer on the USS Boston so that he could remain in San Francisco with Louise, who was pregnant. Over the next two years the Boston cruised back and forth between San Francisco and Panama, where the Panama Canal was under construction. He was in Acapulco when their son and only child, William Harrington Leahy, was born on 27 October 1904, and did not see his son until five months later.[27][28][31] He was present for the 1906 San Francisco earthquake. His family had to leave their house in the face of the resulting fires. It survived undamaged, although they had to live in a hotel for several months before they could return.[32]
|
| 34 |
+
|
| 35 |
+
refer to caption
|
| 36 |
+
President William H. Taft reviews a parade in San Francisco, California, 14 October 1911. Left to right: Rear Admiral Chauncey Thomas Jr., Leahy, Lillian Nordica, Archibald Butt and President Taft.
|
| 37 |
+
On 22 February 1907,[33] Leahy returned to Annapolis as instructor in the department of physics and chemistry.[34] He also coached the academy rifle team.[35] After two years ashore, he received orders on 14 August 1909, to return to San Francisco and sea duty as navigator of the armored cruiser USS California, commanded by Captain Henry T. Mayo,[33] in whom Leahy found a patron and a role model. In September, the California was one of eight ships that paid an official visit to Japan, where Leahy saw Admiral Heihachirō Tōgō. Mayo switched Leahy's assignment from navigator to gunnery officer.[36][37]
|
| 38 |
+
|
| 39 |
+
Leahy was promoted to lieutenant commander on 15 September 1909,[9] and in January 1911, the commander-in-chief of the Pacific Fleet, Rear Admiral Chauncey Thomas Jr., chose him as his fleet gunnery officer.[33] In October, the California returned to San Francisco for a fleet review in honor of President William Howard Taft, and Leahy served as Taft's temporary naval aide for four days.[38][37]
|
| 40 |
+
|
| 41 |
+
Banana Wars
|
| 42 |
+
Rear Admiral William H. H. Southerland succeeded Thomas as commander of the Pacific Fleet on 21 April 1912. The California sailed to Manila and then to Japan before returning to San Francisco on 15 August. A few weeks later, Southerland received orders to proceed to Nicaragua and be prepared to deploy a landing force for the United States occupation of Nicaragua.[39] Along with his duties as gunnery officer, Leahy became the chief of staff of the expeditionary force and the commander of the small garrison at Corinto, Nicaragua.[40] He came under fire while repeatedly escorting reinforcements and supplies over the railroad line to León. Privately, he thought that the United States was backing the wrong side, propping up a conservative elite who were exploiting the Nicaraguan people.[41]
|
| 43 |
+
|
| 44 |
+
In October 1912, Leahy came ashore in Washington, D.C., as assistant director of gunnery exercises and engineering competitions. Then, in 1913, Mayo had him assigned to the Bureau of Navigation as a detail officer.[42] Mayo and then his replacement, Rear Admiral William Fullam, were reassigned, leaving Leahy as the acting chief of the bureau. It was one of the Navy's most sensitive offices, as it controlled officer assignments. Leahy's wife Louise enjoyed the social milieu of Washington, and socialized with Addie Daniels, the wife of Josephus Daniels, the Secretary of the Navy. Leahy established a close friendship with the Assistant Secretary of the Navy, Franklin D. Roosevelt.[43]
|
| 45 |
+
|
| 46 |
+
refer to caption
|
| 47 |
+
With Major C. S. Hill (right) on the deck of the USS California in August 1912
|
| 48 |
+
As Leahy's three-year tour of shore duty approached its end in 1915, he hoped to command the new destroyer tender USS Melville but Daniels had the assignment changed to command of the Secretary of the Navy's dispatch gunboat, the USS Dolphin. Leahy assumed command of the Dolphin on 18 September 1915. The ship took part in the United States occupation of Haiti, where Leahy again acted as chief of staff, this time to Rear Admiral William B. Caperton. In May 1916, Dolphin participated in the occupation of the Dominican Republic too.[44] During the summer, Roosevelt used it as his family yacht, cruising down the Hudson River from the Roosevelt family estate in Hyde Park, New York, and along the coast to his holiday house on Campobello Island.[45] Leahy was promoted to commander on 29 August 1916.[9]
|
| 49 |
+
|
| 50 |
+
World War I
|
| 51 |
+
Following the United States entry into World War I In April 1917, Dolphin was sent to the United States Virgin Islands to assert America's control there. There was a rumor that a Danish-flagged freighter in the vicinity, the Nordskov, was a German merchant raider in disguise, and Dolphin was sent to investigate. If it had been, Leahy would have been outgunned, but an inspection determined that the rumors were false. In July 1917, Leahy became the executive officer of USS Nevada. It was the Navy's newest battleship, but it was not sent to Europe due to teething troubles with its new design and a shortage of fuel oil in Britain.[45]
|
| 52 |
+
|
| 53 |
+
In April 1918 Leahy assumed command of a troop transport, the USS Princess Matoika. Shortly before it was due to depart for France, Leahy was summoned to Washington, D.C., by the Chief of Naval Operations (CNO), Admiral William S. Benson, who offered him the position of the Navy's director of gunnery. Leahy told him that he wanted to remain on the Princess Matoika. A compromise was reached; Leahy was permitted to cross the Atlantic once before becoming director of gunnery. Traveling in convoy, the Princess Matoika reached Brest on 23 May 1918, and disembarked its troops.[45] Leahy was awarded the Navy Cross "for distinguished service in the line of his profession as commanding officer of the USS Princess Matoika, engaged in the important, exacting and hazardous duty of transporting and escorting troops and supplies to European ports through waters infested with enemy submarines and mines during World War I."[46]
|
| 54 |
+
|
| 55 |
+
Leahy returned to the United States,[47] where he was promoted to captain on 1 July 1918,[9] and soon after was on his way back to Europe to confer with representatives of the Royal Navy and discuss their gunnery practices. He reached London later that month, where he reported to the U.S. Navy commander in Europe, Vice Admiral William S. Sims, who had been a critic of the Navy's gunnery in the Spanish-American War.[48] Leahy met with his British counterpart, Captain Frederic Dreyer, and the chief gunnery officer of the Anglo-American Grand Fleet, Captain Ernle Chatfield.[49]
|
| 56 |
+
|
| 57 |
+
Leahy was attached to the staff of Rear Admiral Hugh Rodman, the commander of the American division of the Grand Fleet, and was able to view a gunnery exercise from the British battleship HMS Queen Elizabeth.[48] On the way home he visited Paris, where he was appalled at the German use of a long-range gun to bombard the city, which he considered an indiscriminate targeting of civilians and militarily useless. He embarked for home on the SS Leviathan at Brest on 12 August 1918.[49]
|
| 58 |
+
|
| 59 |
+
Sea duty between the wars
|
| 60 |
+
refer to caption
|
| 61 |
+
Leahy shakes hands with Admiral Joseph M. Reeves (left) on assuming command of the Battle Force in June 1936.
|
| 62 |
+
In February 1921, Leahy sailed for Europe, where he assumed command of the cruiser USS Chattanooga on 2 April. In May he was ordered to take command of the cruiser USS St. Louis, the flagship of the naval detachment in Turkish waters during the Greco-Turkish War. He was able to spend a couple of weeks in the French countryside with Louise, who spoke fluent French, before taking the Orient Express to Constantinople, where he reported to the American commander there, Rear Admiral Mark L. Bristol, on 30 May.[50] Leahy had the role of safeguarding American interests in Turkey. He had to play the diplomat, attending parties and receptions, and organizing American events. He reveled in this assignment.[51]
|
| 63 |
+
|
| 64 |
+
The next step in a successful naval career would normally have been to attend the Naval War College. Leahy submitted repeated requests but was never sent.[52] At the end of 1921, he was given command of the minelayer USS Shawmut and concurrent command of Mine Squadron One. He then returned to Washington, D.C., where he served as director of Officer Personnel in the Bureau of Navigation from 1923 to 1926.[53] After three years of shore duty, he was given command of the battleship USS New Mexico. In biennial competitions in gunnery, engineering and battle efficiency, the New Mexico won all three in 1927–1928.[54]
|
| 65 |
+
|
| 66 |
+
Flag officer
|
| 67 |
+
On 14 October 1927, he reached flag rank, the first member of his cadet class to do so, and returned to Washington as the Chief of the Bureau of Ordnance. The following year he bought a town house on Florida Avenue near Dupont Circle for $20,000 (equivalent to $370,000 in 2024).[55] He also had assets that he had acquired through his marriage to Louise: stocks in the Colusa County Bank and agricultural land in the Sacramento Valley in California.[56] In the wake of the Wall Street crash of 1929, President Herbert Hoover determined to effect cuts in the Navy's budget, and his representative, Rear Admiral William V. Pratt, negotiated the London Naval Treaty that limited naval construction. The list of canceled ships included two aircraft carriers, three cruisers, a destroyer and six submarines. Leahy was in charge of implementing these cuts, and he was appalled at the human toll; some 5,000 workers lost their jobs, many of them highly skilled shipyard workers who faced long-term unemployment during the Great Depression.[57][58]
|
| 68 |
+
|
| 69 |
+
refer to caption
|
| 70 |
+
Leahy and Admiral William H. Standley shake hands after Leahy is sworn in as the Chief of Naval Operations in Washington, D.C., in January 1937.
|
| 71 |
+
Admiral Charles F. Hughes elected to retire rather than enforce the cuts, and he was replaced by Pratt. Pratt and Leahy soon clashed over cuts to shipbuilding, and Pratt attempted to have Leahy reassigned as chief of staff of the Pacific Fleet. Leahy had the Chief of the Bureau of Navigation block this, but decided that it would be in his best interest to get away from Pratt, and he secured command of the destroyers of the Scouting Force on the West Coast in 1931.[57][58] Leahy's dislike of Hoover was intensified by his dire personal circumstances. He could not find a tenant for the Florida Avenue property at a rent that would pay for its upkeep;[59] the price of food had fallen so much that his land in the Sacramento Valley could not generate a profit, and was seized by the government to recover unpaid taxes;[60] and a run on the bank in January 1933 caused the Colusa County Bank to close its doors, taking with it Leahy's life savings, and leaving him with a large debt that he would not pay off until 1941.[61]
|
| 72 |
+
|
| 73 |
+
Roosevelt was inaugurated as president on 4 March 1933, and he nominated Leahy as the Chief of the Bureau of Navigation.[62] On 6 May 1933, Leahy and Louise boarded a train back to Washington, D.C.[63] As bureau chief, Leahy handled personnel matters with care and consideration. When his successor as the Chief of the Bureau of Ordnance, Rear Admiral Edgar B. Larimer, suffered a mental breakdown and was hospitalized, Leahy ensured that he was kept on the active list until he reached retirement age, thereby safeguarding his pension. When two midshipmen at Annapolis, John Hyland and Victor Krulak, faced expulsion for failing to reach the required minimum height of 5 feet 6 inches (168 cm), Leahy waived the regulations to permit them to graduate with the class of 1934, and both went on to have distinguished careers.[62]
|
| 74 |
+
|
| 75 |
+
refer to caption
|
| 76 |
+
Discussing naval expansion with Congressmen and the President in Washington, D.C., on 5 January 1938: (left to right) Carl Vinson, Edward T. Taylor, William B. Umstead, Charles Edison and Leahy
|
| 77 |
+
Leahy formed a good working relationship with the new Assistant Secretary of the Navy, Henry L. Roosevelt, an Annapolis graduate and distant cousin of the President whom Leahy considered a close personal friend,[62] but he clashed with the new CNO, Admiral William H. Standley, who sought to assert the power of the CNO over the bureau chiefs. In this he was opposed by Leahy and the Chief of the Bureau of Aeronautics, Rear Admiral Ernest J. King, who enlisted the aid of Henry Roosevelt and the Secretary of the Navy, Claude A. Swanson, to block it.[64] In 1936, the commander-in-chief United States Fleet (CINCUS), Admiral Joseph M. Reeves recommended Leahy for the position of Commander Battleships Battle Force, with the rank of vice admiral. Standley was opposed to this,[64] but was unable to persuade Swanson or the President, who invited Leahy to a private chat at the White House before proceeding to take up his new posting.[65]
|
| 78 |
+
|
| 79 |
+
Leahy assumed his new command on 13 July 1935.[66] In October Roosevelt came out to California for the California Pacific International Exposition. Leahy treated him to the largest fleet maneuver the U.S. Navy had ever carried out, with 129 warships, including 12 battleships, participating, which the President observed from the deck of the cruiser USS Houston.[67] On 30 March 1936, Leahy was promoted to the temporary rank of admiral and hoisted his four-star flag on the battleship USS California as Commander Battle Force.[68][69][70] One of his last acts in this post was a symbolic one: he transferred his flag to the aircraft carrier USS Ranger as a sign of his conviction that aircraft were now an integral part of sea power.[71]
|
| 80 |
+
|
| 81 |
+
Chief of Naval Operations
|
| 82 |
+
In December 1935, Swanson told Leahy in confidence that he would be appointed the next CNO if Roosevelt won the 1936 presidential election.[67] Roosevelt won the election with a landslide victory,[72] and on 10 November 1936, it was announced that Leahy would succeed Standley as CNO on 1 January 1937.[73] As CNO, Leahy was content to let the bureau chiefs function as they always had, acting as a primus inter pares.[74][75] Swanson was chronically ill, and Henry Roosevelt died on 22 February 1936.[76] Charles Edison became the new assistant secretary, but he lacked experience in naval affairs.[77]
|
| 83 |
+
|
| 84 |
+
refer to caption
|
| 85 |
+
Appearing before the Senate Foreign Relations Committee in Washington, D.C., on 22 March 1939, in support of military aid to the Latin American republics: (left to right) George C. Marshall, Leahy, Key Pittman and Sumner Welles
|
| 86 |
+
Leahy began representing the Navy in cabinet meetings.[78] He met with the President frequently; during his tenure as CNO, Roosevelt had 52 meetings with Leahy, compared with twelve with his Army counterpart, General Malin Craig, and none of the meetings with Craig were private lunches. Meetings between Leahy and Roosevelt were sometimes on matters unrelated to the Navy, and they frequently went on for hours. At one private lunch on 15 April 1937, Leahy and Roosevelt debated whether new battleships should have 16-inch (410 mm) or (cheaper) 14-inch (360 mm) guns. Leahy ultimately persuaded the President that the new North Carolina-class battleships should have 16-inch guns. On 22 May, Leahy accompanied the President and dignitaries including John Nance Garner, Harry Hopkins, James F. Byrnes, Morris Sheppard, Edwin C. Johnson, Claude Pepper and Sam Rayburn on a cruise on the presidential yacht USS Potomac to watch a baseball game between congressmen and the press.[79][80]
|
| 87 |
+
|
| 88 |
+
The most important issue confronting the administration was how to respond to the Japanese invasion of China. The commander-in-chief of the Asiatic Fleet, Admiral Harry Yarnell, asked for four more cruisers to help evacuate American citizens from the Shanghai International Settlement, but the Secretary of State, Cordell Hull, thought this would be too provocative. Leahy went to Hyde Park to take the matter up with Roosevelt. The request was turned down: American isolationist sentiment was too strong to countenance the risk of being drawn into the conflict; Yarnell could use merchant ships, if he could find them. Leahy accepted this presidential decision, as he always did, even when he strongly disagreed.[79][81] Leahy wrote in his diary that a Japanese threat to bomb the civilian population in China was "evidence, and a conclusive one, that the old accepted rules of warfare are no longer in effect."[82]
|
| 89 |
+
|
| 90 |
+
refer to caption
|
| 91 |
+
Roosevelt presents Leahy with the Navy Distinguished Service Medal on 28 July 1939.
|
| 92 |
+
On 12 December, Leahy was informed of the USS Panay incident, in which an American gunboat on the Yangtze River had been sunk by Japanese aircraft. He met with Hull to craft a response, and discussed the matter with Roosevelt on 14 December.[83] Leahy saw the Panay incident as a test of American resolve. He wanted to answer it with a show of force, economic sanctions and a naval blockade of Japan. But among Roosevelt's advisors, he was the only one willing to countenance such a drastic step. Roosevelt agreed with him, but with uncertain midterm elections coming up in 1938 he felt he could not afford to antagonize the pacifists and isolationists. The Japanese apology therefore was accepted.[84]
|
| 93 |
+
|
| 94 |
+
The Panay incident did prompt Roosevelt and Leahy to press ahead with plans for an ambitious shipbuilding program. On 5 January, Roosevelt, Leahy and Edison met with Congressman Carl Vinson to draw up a strategy for obtaining Congressional approval for a 20 percent increase in all classes of warships. The resulting Second Vinson Act was approved in May 1938, and provided for four more Iowa-class battleships. Leahy had not thought it worthwhile to build more aircraft carriers, but five were added to what became the Two-Ocean Navy Act, together with five Montana-class battleships. Leahy pushed for the construction of 24 Cimarron class oilers, which would be needed to project American sea power across the Pacific.[85][86] Leahy joined Louise when she sponsored the first of these, the USS Cimarron, which was commissioned on 20 March 1939.[87]
|
| 95 |
+
|
| 96 |
+
Roosevelt threw a surprise party for Leahy on 28 July 1939, during which he presented him with the Navy Distinguished Service Medal.[88] According to Leahy, Roosevelt said: "Bill, if we have a war, you're going to be right back here helping me run it."[89] To make this easier, legislation was expedited to keep Leahy on the active list for another two years. On 1 August 1939, Admiral Harold Stark replaced Leahy as CNO.[88]
|
long.yaml
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
lz.md
ADDED
|
@@ -0,0 +1,418 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<p align="center">
|
| 2 |
+
<img width="536" src="https://user-images.githubusercontent.com/8456633/174470852-339b5011-5800-4bb9-a628-ff230aa8cd4e.png">
|
| 3 |
+
</p>
|
| 4 |
+
|
| 5 |
+
<div align="center">
|
| 6 |
+
|
| 7 |
+
A simple terminal UI for git commands
|
| 8 |
+
<br/>
|
| 9 |
+
|
| 10 |
+
[](https://github.com/jesseduffield/lazygit/releases) [](https://goreportcard.com/report/github.com/jesseduffield/lazygit) [](https://golangci.com) [](https://github.com/jesseduffield/lazygit/releases/latest) [](https://github.com/Homebrew/homebrew-core/blob/master/Formula/lazygit.rb)
|
| 11 |
+
|
| 12 |
+

|
| 13 |
+
|
| 14 |
+
</div>
|
| 15 |
+
|
| 16 |
+
| Month | Savings |
|
| 17 |
+
| -------- | ------- |
|
| 18 |
+
| January | $250 |
|
| 19 |
+
| February | $80 |
|
| 20 |
+
| March | $420 |
|
| 21 |
+
|
| 22 |
+
## Sponsors
|
| 23 |
+
|
| 24 |
+
<p align="center">
|
| 25 |
+
Maintenance of this project is made possible by all the <a href="https://github.com/jesseduffield/lazygit/graphs/contributors">contributors</a> and <a href="https://github.com/sponsors/jesseduffield">sponsors</a>. If you'd like to sponsor this project and have your avatar or company logo appear below <a href="https://github.com/sponsors/jesseduffield">click here</a>. 💙
|
| 26 |
+
</p>
|
| 27 |
+
|
| 28 |
+
<p align="center">
|
| 29 |
+
<!-- sponsors --><a href="https://github.com/intabulas"><img src="https://github.com/intabulas.png" width="60px" alt="" /></a><a href="https://github.com/piot"><img src="https://github.com/piot.png" width="60px" alt="" /></a><a href="https://github.com/rgwood"><img src="https://github.com/rgwood.png" width="60px" alt="" /></a><a href="https://github.com/oliverguenther"><img src="https://github.com/oliverguenther.png" width="60px" alt="" /></a><a href="https://github.com/pawanjay176"><img src="https://github.com/pawanjay176.png" width="60px" alt="" /></a><a href="https://github.com/bdach"><img src="https://github.com/bdach.png" width="60px" alt="" /></a><a href="https://github.com/davidklsn"><img src="https://github.com/davidklsn.png" width="60px" alt="" /></a><a href="https://github.com/naoey"><img src="https://github.com/naoey.png" width="60px" alt="" /></a><a href="https://github.com/jryom"><img src="https://github.com/jryom.png" width="60px" alt="" /></a><a href="https://github.com/carstengehling"><img src="https://github.com/carstengehling.png" width="60px" alt="" /></a><a href="https://github.com/ceuk"><img src="https://github.com/ceuk.png" width="60px" alt="" /></a><a href="https://github.com/akospwc"><img src="https://github.com/akospwc.png" width="60px" alt="" /></a><a href="https://github.com/Xetera"><img src="https://github.com/Xetera.png" width="60px" alt="" /></a><a href="https://github.com/HoldenLucas"><img src="https://github.com/HoldenLucas.png" width="60px" alt="" /></a><a href="https://github.com/barbados-clemens"><img src="https://github.com/barbados-clemens.png" width="60px" alt="" /></a><a href="https://github.com/nartc"><img src="https://github.com/nartc.png" width="60px" alt="" /></a><a href="https://github.com/matejcik"><img src="https://github.com/matejcik.png" width="60px" alt="" /></a><a href="https://github.com/lucatume"><img src="https://github.com/lucatume.png" width="60px" alt="" /></a><a href="https://github.com/zach-fuller"><img src="https://github.com/zach-fuller.png" width="60px" alt="" /></a><a href="https://github.com/KowalskiPiotr98"><img src="https://github.com/KowalskiPiotr98.png" width="60px" alt="" /></a><a href="https://github.com/nicholascloud"><img src="https://github.com/nicholascloud.png" width="60px" alt="" /></a><a href="https://github.com/PhotonQuantum"><img src="https://github.com/PhotonQuantum.png" width="60px" alt="" /></a><a href="https://github.com/GitSquared"><img src="https://github.com/GitSquared.png" width="60px" alt="" /></a><a href="https://github.com/ava1ar"><img src="https://github.com/ava1ar.png" width="60px" alt="" /></a><a href="https://github.com/pedropombeiro"><img src="https://github.com/pedropombeiro.png" width="60px" alt="" /></a><a href="https://github.com/minidfx"><img src="https://github.com/minidfx.png" width="60px" alt="" /></a><a href="https://github.com/JoeKlemmer"><img src="https://github.com/JoeKlemmer.png" width="60px" alt="" /></a><a href="https://github.com/ColonelBucket8"><img src="https://github.com/ColonelBucket8.png" width="60px" alt="" /></a><a href="https://github.com/tobi"><img src="https://github.com/tobi.png" width="60px" alt="" /></a><a href="https://github.com/benbfortis"><img src="https://github.com/benbfortis.png" width="60px" alt="" /></a><a href="https://github.com/jakewarren"><img src="https://github.com/jakewarren.png" width="60px" alt="" /></a><a href="https://github.com/tgpholly"><img src="https://github.com/tgpholly.png" width="60px" alt="" /></a><a href="https://github.com/jisantuc"><img src="https://github.com/jisantuc.png" width="60px" alt="" /></a><a href="https://github.com/bitprophet"><img src="https://github.com/bitprophet.png" width="60px" alt="" /></a><a href="https://github.com/tayleighr"><img src="https://github.com/tayleighr.png" width="60px" alt="" /></a><a href="https://github.com/Novakov"><img src="https://github.com/Novakov.png" width="60px" alt="" /></a><a href="https://github.com/mthuggett"><img src="https://github.com/mthuggett.png" width="60px" alt="" /></a><a href="https://github.com/portothree"><img src="https://github.com/portothree.png" width="60px" alt="" /></a><a href="https://github.com/farzadmf"><img src="https://github.com/farzadmf.png" width="60px" alt="" /></a><a href="https://github.com/nekhaevskiy"><img src="https://github.com/nekhaevskiy.png" width="60px" alt="" /></a><a href="https://github.com/reivilibre"><img src="https://github.com/reivilibre.png" width="60px" alt="" /></a><a href="https://github.com/andreaskurth"><img src="https://github.com/andreaskurth.png" width="60px" alt="" /></a><a href="https://github.com/BSteffaniak"><img src="https://github.com/BSteffaniak.png" width="60px" alt="" /></a><a href="https://github.com/jordan-gillard"><img src="https://github.com/jordan-gillard.png" width="60px" alt="" /></a><a href="https://github.com/smangels"><img src="https://github.com/smangels.png" width="60px" alt="" /></a><a href="https://github.com/George-Spanos"><img src="https://github.com/George-Spanos.png" width="60px" alt="" /></a><a href="https://github.com/BenGH28"><img src="https://github.com/BenGH28.png" width="60px" alt="" /></a><a href="https://github.com/abradner"><img src="https://github.com/abradner.png" width="60px" alt="" /></a><a href="https://github.com/Thalys"><img src="https://github.com/Thalys.png" width="60px" alt="" /></a><a href="https://github.com/wakywayne"><img src="https://github.com/wakywayne.png" width="60px" alt="" /></a><a href="https://github.com/frantisekstanko"><img src="https://github.com/frantisekstanko.png" width="60px" alt="" /></a><a href="https://github.com/vlad-psh"><img src="https://github.com/vlad-psh.png" width="60px" alt="" /></a><a href="https://github.com/atlj"><img src="https://github.com/atlj.png" width="60px" alt="" /></a><a href="https://github.com/robclancy"><img src="https://github.com/robclancy.png" width="60px" alt="" /></a><a href="https://github.com/Jaxwood"><img src="https://github.com/Jaxwood.png" width="60px" alt="" /></a><a href="https://github.com/orthodoX"><img src="https://github.com/orthodoX.png" width="60px" alt="" /></a><a href="https://github.com/Broderick-Westrope"><img src="https://github.com/Broderick-Westrope.png" width="60px" alt="" /></a><a href="https://github.com/tmontaigu"><img src="https://github.com/tmontaigu.png" width="60px" alt="" /></a><a href="https://github.com/camina-apps"><img src="https://github.com/camina-apps.png" width="60px" alt="" /></a><a href="https://github.com/tkuraku"><img src="https://github.com/tkuraku.png" width="60px" alt="" /></a><!-- sponsors -->
|
| 30 |
+
</p>
|
| 31 |
+
|
| 32 |
+
Elevator Pitch
|
| 33 |
+
--
|
| 34 |
+
|
| 35 |
+
Rant time: You've heard it before, git is _powerful_, but what good is that power when everything is so damn hard to do? Interactive rebasing requires you to edit a goddamn TODO file in your editor? _Are you kidding me?_ To stage part of a file you need to use a command line program to step through each hunk and if a hunk can't be split down any further but contains code you don't want to stage, you have to edit an arcane patch file _by hand_? _Are you KIDDING me?!_ Sometimes you get asked to stash your changes when switching branches only to realise that after you switch and unstash that there weren't even any conflicts and it would have been fine to just checkout the branch directly? _YOU HAVE GOT TO BE KIDDING ME!_
|
| 36 |
+
|
| 37 |
+
If you're a mere mortal like me and you're tired of hearing how powerful git is when in your daily life it's a powerful pain in your ass, lazygit might be for you.
|
| 38 |
+
|
| 39 |
+
## Table of contents
|
| 40 |
+
|
| 41 |
+
- [Features](#features)
|
| 42 |
+
- [Tutorials](#tutorials)
|
| 43 |
+
- [Installation](#installation)
|
| 44 |
+
- [Binary releases](#binary-releases)
|
| 45 |
+
- [Homebrew](#homebrew)
|
| 46 |
+
- [MacPorts](#macports)
|
| 47 |
+
- [Void Linux](#void-linux)
|
| 48 |
+
- [Scoop (Windows)](#scoop-windows)
|
| 49 |
+
- [Arch Linux](#arch-linux)
|
| 50 |
+
- [Fedora and RHEL](#fedora-and-rhel)
|
| 51 |
+
- [Solus Linux](#solus-linux)
|
| 52 |
+
- [Ubuntu](#ubuntu)
|
| 53 |
+
- [Funtoo Linux](#funtoo-linux)
|
| 54 |
+
- [Gentoo Linux](#gentoo-linux)
|
| 55 |
+
- [FreeBSD](#freebsd)
|
| 56 |
+
- [Conda](#conda)
|
| 57 |
+
- [Go](#go)
|
| 58 |
+
- [Chocolatey (Windows)](#chocolatey-windows)
|
| 59 |
+
- [Manual](#manual)
|
| 60 |
+
- [Usage](#usage)
|
| 61 |
+
- [Keybindings](#keybindings)
|
| 62 |
+
- [Changing directory on exit](#changing-directory-on-exit)
|
| 63 |
+
- [Undo/Redo](#undoredo)
|
| 64 |
+
- [Configuration](#configuration)
|
| 65 |
+
- [Custom pagers](#configuration)
|
| 66 |
+
- [Custom commands](#configuration)
|
| 67 |
+
- [Contributing](#contributing)
|
| 68 |
+
- [Donate](#donate)
|
| 69 |
+
- [Alternatives](#alternatives)
|
| 70 |
+
|
| 71 |
+
Lazygit is not my fulltime job but it is a hefty part time job so if you want to support the project please consider [sponsoring me](https://github.com/sponsors/jesseduffield)
|
| 72 |
+
|
| 73 |
+
## Features
|
| 74 |
+
|
| 75 |
+
### Stage individual lines
|
| 76 |
+
|
| 77 |
+
Press space on the selected line to stage it, or press `v` to start selecting a range of lines. You can also press `a` to select the entirety of the current hunk.
|
| 78 |
+
|
| 79 |
+

|
| 80 |
+
|
| 81 |
+
### Interactive Rebase
|
| 82 |
+
|
| 83 |
+
Press `e` on a commit to start an interactive rebase on it: causing all above commits to become part of the TODO file. Then squash (`s`), fixup (`f`), drop (`d`), edit (`e`), move up (ctrl+i) or move down (ctrl+j) any of TODO commits, before continuing the rebase by bringing up the rebase options menu with `m` and then selecting `continue`. You can also perform any these actions as a once-off (e.g. pressing `s` on a commit to squash it) without explicitly starting a rebase.
|
| 84 |
+
|
| 85 |
+

|
| 86 |
+
|
| 87 |
+
### Cherry-pick
|
| 88 |
+
|
| 89 |
+
Press `c` on a commit to copy it and press `v` to paste (cherry-pick) it.
|
| 90 |
+
|
| 91 |
+

|
| 92 |
+
|
| 93 |
+
### Bisect
|
| 94 |
+
|
| 95 |
+
Press `b` in the commits view to mark a commit as good/bad in order to begin a git bisect.
|
| 96 |
+
|
| 97 |
+

|
| 98 |
+
|
| 99 |
+
### Nuke the working tree
|
| 100 |
+
|
| 101 |
+
For when you really want to just get rid of anything that shows up when you run `git status` (and yes that includes dirty submodules) [kidpix style](https://www.youtube.com/watch?v=Ur7_A4JusMU), press `shift+d` to bring up the reset options menu and then select the 'nuke' option.
|
| 102 |
+
|
| 103 |
+

|
| 104 |
+
|
| 105 |
+
### Amend an old commit
|
| 106 |
+
|
| 107 |
+
Pressing `shift+a` on any commit will amend that commit with the currently staged changes (running an interactive rebase in the background).
|
| 108 |
+
|
| 109 |
+

|
| 110 |
+
|
| 111 |
+
### Filter
|
| 112 |
+
|
| 113 |
+
You can filter a view with `/`. Here we filter down our branches view and then hit `enter` to view its commits.
|
| 114 |
+
|
| 115 |
+

|
| 116 |
+
|
| 117 |
+
### Invoke a custom command
|
| 118 |
+
|
| 119 |
+
Lazygit has a very flexible [custom command system](docs/Custom_Command_Keybindings.md). In this example a custom command is defined which emulates the built-in branch checkout action.
|
| 120 |
+
|
| 121 |
+

|
| 122 |
+
|
| 123 |
+
### Worktrees
|
| 124 |
+
|
| 125 |
+
You can create worktrees to have multiple branches going at once without the need for stashing or creating WIP commits when switching between them. Press `w` in the branches view to create a worktree from the selected branch and switch to it.
|
| 126 |
+
|
| 127 |
+

|
| 128 |
+
|
| 129 |
+
### Rebase magic (custom patches)
|
| 130 |
+
|
| 131 |
+
You can build a custom patch from an old commit and then remove the patch from the commit, split out a new commit, apply the patch in reverse to the index, and more.
|
| 132 |
+
|
| 133 |
+
In this example we have a redundant comment that we want to remove from an old commit. We hit `<enter>` on the commit to view its files, then `<enter>` on a file to focus the patch, then `<space>` to add the comment line to our custom patch, and then `ctrl+p` to view the custom patch options; selecting to remove the patch from the current commit.
|
| 134 |
+
|
| 135 |
+
Learn more in the [Rebase magic Youtube tutorial](https://youtu.be/4XaToVut_hs).
|
| 136 |
+
|
| 137 |
+

|
| 138 |
+
|
| 139 |
+
## Tutorials
|
| 140 |
+
|
| 141 |
+
[<img src="https://i.imgur.com/sVEktDn.png">](https://youtu.be/CPLdltN7wgE)
|
| 142 |
+
|
| 143 |
+
- [15 Lazygit Features in 15 Minutes](https://youtu.be/CPLdltN7wgE)
|
| 144 |
+
- [Basics Tutorial](https://youtu.be/VDXvbHZYeKY)
|
| 145 |
+
- [Rebase Magic Tutorial](https://youtu.be/4XaToVut_hs)
|
| 146 |
+
|
| 147 |
+
## Installation
|
| 148 |
+
|
| 149 |
+
[](https://repology.org/project/lazygit/versions)
|
| 150 |
+
|
| 151 |
+
_Most of the above packages are maintained by third parties so be sure to vet them yourself and confirm that the maintainer is a trustworthy looking person who attends local sports games and gives back to their communities with barbeque fundraisers etc_
|
| 152 |
+
|
| 153 |
+
### Binary Releases
|
| 154 |
+
|
| 155 |
+
For Windows, Mac OS(10.12+) or Linux, you can download a binary release [here](../../releases).
|
| 156 |
+
|
| 157 |
+
### Homebrew
|
| 158 |
+
|
| 159 |
+
Normally the lazygit formula can be found in the Homebrew core but we suggest you tap our formula to get the frequently updated one. It works with Linux, too.
|
| 160 |
+
|
| 161 |
+
Tap:
|
| 162 |
+
|
| 163 |
+
```
|
| 164 |
+
brew install jesseduffield/lazygit/lazygit
|
| 165 |
+
```
|
| 166 |
+
|
| 167 |
+
Core:
|
| 168 |
+
|
| 169 |
+
```
|
| 170 |
+
brew install lazygit
|
| 171 |
+
```
|
| 172 |
+
|
| 173 |
+
### MacPorts
|
| 174 |
+
|
| 175 |
+
Latest version built from github releases.
|
| 176 |
+
Tap:
|
| 177 |
+
|
| 178 |
+
```
|
| 179 |
+
sudo port install lazygit
|
| 180 |
+
```
|
| 181 |
+
|
| 182 |
+
### Void Linux
|
| 183 |
+
|
| 184 |
+
Packages for Void Linux are available in the distro repo
|
| 185 |
+
|
| 186 |
+
They follow upstream latest releases
|
| 187 |
+
|
| 188 |
+
```sh
|
| 189 |
+
sudo xbps-install -S lazygit
|
| 190 |
+
```
|
| 191 |
+
|
| 192 |
+
### Scoop (Windows)
|
| 193 |
+
|
| 194 |
+
You can install `lazygit` using [scoop](https://scoop.sh/). It's in the `extras` bucket:
|
| 195 |
+
|
| 196 |
+
```sh
|
| 197 |
+
# Add the extras bucket
|
| 198 |
+
scoop bucket add extras
|
| 199 |
+
|
| 200 |
+
# Install lazygit
|
| 201 |
+
scoop install lazygit
|
| 202 |
+
```
|
| 203 |
+
|
| 204 |
+
### Arch Linux
|
| 205 |
+
|
| 206 |
+
Packages for Arch Linux are available via pacman and AUR (Arch User Repository).
|
| 207 |
+
|
| 208 |
+
There are two packages. The stable one which is built with the latest release
|
| 209 |
+
and the git version which builds from the most recent commit.
|
| 210 |
+
|
| 211 |
+
- Stable: `sudo pacman -S lazygit`
|
| 212 |
+
- Development: <https://aur.archlinux.org/packages/lazygit-git/>
|
| 213 |
+
|
| 214 |
+
Instruction of how to install AUR content can be found here:
|
| 215 |
+
<https://wiki.archlinux.org/index.php/Arch_User_Repository>
|
| 216 |
+
|
| 217 |
+
### Fedora and RHEL
|
| 218 |
+
|
| 219 |
+
Packages for Fedora/RHEL and CentOS Stream are available via [Copr](https://copr.fedorainfracloud.org/coprs/atim/lazygit/) (Cool Other Package Repo).
|
| 220 |
+
|
| 221 |
+
```sh
|
| 222 |
+
sudo dnf copr enable atim/lazygit -y
|
| 223 |
+
sudo dnf install lazygit
|
| 224 |
+
```
|
| 225 |
+
|
| 226 |
+
### Solus Linux
|
| 227 |
+
|
| 228 |
+
```sh
|
| 229 |
+
sudo eopkg install lazygit
|
| 230 |
+
```
|
| 231 |
+
|
| 232 |
+
### Ubuntu
|
| 233 |
+
|
| 234 |
+
```sh
|
| 235 |
+
LAZYGIT_VERSION=$(curl -s "https://api.github.com/repos/jesseduffield/lazygit/releases/latest" | grep -Po '"tag_name": "v\K[^"]*')
|
| 236 |
+
curl -Lo lazygit.tar.gz "https://github.com/jesseduffield/lazygit/releases/latest/download/lazygit_${LAZYGIT_VERSION}_Linux_x86_64.tar.gz"
|
| 237 |
+
tar xf lazygit.tar.gz lazygit
|
| 238 |
+
sudo install lazygit /usr/local/bin
|
| 239 |
+
```
|
| 240 |
+
|
| 241 |
+
Verify the correct installation of lazygit:
|
| 242 |
+
|
| 243 |
+
```sh
|
| 244 |
+
lazygit --version
|
| 245 |
+
```
|
| 246 |
+
|
| 247 |
+
### Funtoo Linux
|
| 248 |
+
|
| 249 |
+
Funtoo Linux has an autogenerated lazygit package in [dev-kit](https://github.com/funtoo/dev-kit/tree/1.4-release/dev-vcs/lazygit):
|
| 250 |
+
|
| 251 |
+
```sh
|
| 252 |
+
sudo emerge dev-vcs/lazygit
|
| 253 |
+
```
|
| 254 |
+
### Gentoo Linux
|
| 255 |
+
|
| 256 |
+
Lazygit is not (yet) in main Gentoo portage, however an ebuild is available in [cova overlay](https://github.com/cova-fe/cova-overlay/tree/main/dev-vcs/lazygit)
|
| 257 |
+
|
| 258 |
+
You can either add the overlay to your system and install lazygit as usual:
|
| 259 |
+
|
| 260 |
+
```sh
|
| 261 |
+
sudo eselect repository enable cova
|
| 262 |
+
sudo emaint sync -r cova
|
| 263 |
+
sudo emerge dev-vcs/lazygit
|
| 264 |
+
```
|
| 265 |
+
|
| 266 |
+
Or you can download the ebuild and install it manually; please consider the example below just as a suggestion to be adapted to your system.
|
| 267 |
+
|
| 268 |
+
```sh
|
| 269 |
+
su
|
| 270 |
+
LAZYGIT_VERSION="0.39.3" # Replace with the version you want from cova-overlay
|
| 271 |
+
cd /usr/overlay/dev-vcs/ # Replace your overlay path
|
| 272 |
+
mkdir lazygit
|
| 273 |
+
cd lazygit
|
| 274 |
+
curl -O https://raw.githubusercontent.com/cova-fe/cova-overlay/main/dev-vcs/lazygit/lazygit-${LAZYGIT_VERSION}.ebuild
|
| 275 |
+
ebuild lazygit-${LAZYGIT_VERSION}.ebuild manifest
|
| 276 |
+
emerge lazygit
|
| 277 |
+
```
|
| 278 |
+
|
| 279 |
+
### FreeBSD
|
| 280 |
+
|
| 281 |
+
```sh
|
| 282 |
+
pkg install lazygit
|
| 283 |
+
```
|
| 284 |
+
|
| 285 |
+
### Conda
|
| 286 |
+
|
| 287 |
+
Released versions are available for different platforms, see <https://anaconda.org/conda-forge/lazygit>
|
| 288 |
+
|
| 289 |
+
```sh
|
| 290 |
+
conda install -c conda-forge lazygit
|
| 291 |
+
```
|
| 292 |
+
|
| 293 |
+
### Go
|
| 294 |
+
|
| 295 |
+
```sh
|
| 296 |
+
go install github.com/jesseduffield/lazygit@latest
|
| 297 |
+
```
|
| 298 |
+
|
| 299 |
+
Please note:
|
| 300 |
+
If you get an error claiming that lazygit cannot be found or is not defined, you
|
| 301 |
+
may need to add `~/go/bin` to your $PATH (MacOS/Linux), or `%HOME%\go\bin`
|
| 302 |
+
(Windows). Not to be mistaken for `C:\Go\bin` (which is for Go's own binaries,
|
| 303 |
+
not apps like lazygit).
|
| 304 |
+
|
| 305 |
+
### Chocolatey (Windows)
|
| 306 |
+
|
| 307 |
+
You can install `lazygit` using [Chocolatey](https://chocolatey.org/):
|
| 308 |
+
|
| 309 |
+
```sh
|
| 310 |
+
choco install lazygit
|
| 311 |
+
```
|
| 312 |
+
|
| 313 |
+
### Manual
|
| 314 |
+
|
| 315 |
+
You'll need to [install Go](https://golang.org/doc/install)
|
| 316 |
+
|
| 317 |
+
```
|
| 318 |
+
git clone https://github.com/jesseduffield/lazygit.git
|
| 319 |
+
cd lazygit
|
| 320 |
+
go install
|
| 321 |
+
```
|
| 322 |
+
|
| 323 |
+
You can also use `go run main.go` to compile and run in one go (pun definitely intended)
|
| 324 |
+
|
| 325 |
+
## Usage
|
| 326 |
+
|
| 327 |
+
Call `lazygit` in your terminal inside a git repository.
|
| 328 |
+
|
| 329 |
+
```sh
|
| 330 |
+
$ lazygit
|
| 331 |
+
```
|
| 332 |
+
|
| 333 |
+
If you want, you can
|
| 334 |
+
also add an alias for this with `echo "alias lg='lazygit'" >> ~/.zshrc` (or
|
| 335 |
+
whichever rc file you're using).
|
| 336 |
+
|
| 337 |
+
### Keybindings
|
| 338 |
+
|
| 339 |
+
You can check out the list of keybindings [here](/docs/keybindings).
|
| 340 |
+
|
| 341 |
+
### Changing Directory On Exit
|
| 342 |
+
|
| 343 |
+
If you change repos in lazygit and want your shell to change directory into that repo on exiting lazygit, add this to your `~/.zshrc` (or other rc file):
|
| 344 |
+
|
| 345 |
+
```
|
| 346 |
+
lg()
|
| 347 |
+
{
|
| 348 |
+
export LAZYGIT_NEW_DIR_FILE=~/.lazygit/newdir
|
| 349 |
+
|
| 350 |
+
lazygit "$@"
|
| 351 |
+
|
| 352 |
+
if [ -f $LAZYGIT_NEW_DIR_FILE ]; then
|
| 353 |
+
cd "$(cat $LAZYGIT_NEW_DIR_FILE)"
|
| 354 |
+
rm -f $LAZYGIT_NEW_DIR_FILE > /dev/null
|
| 355 |
+
fi
|
| 356 |
+
}
|
| 357 |
+
```
|
| 358 |
+
|
| 359 |
+
Then `source ~/.zshrc` and from now on when you call `lg` and exit you'll switch directories to whatever you were in inside lazygit. To override this behaviour you can exit using `shift+Q` rather than just `q`.
|
| 360 |
+
|
| 361 |
+
### Undo/Redo
|
| 362 |
+
|
| 363 |
+
See the [docs](/docs/Undoing.md)
|
| 364 |
+
|
| 365 |
+
## Configuration
|
| 366 |
+
|
| 367 |
+
Check out the [configuration docs](docs/Config.md).
|
| 368 |
+
|
| 369 |
+
### Custom Pagers
|
| 370 |
+
|
| 371 |
+
See the [docs](docs/Custom_Pagers.md)
|
| 372 |
+
|
| 373 |
+
### Custom Commands
|
| 374 |
+
|
| 375 |
+
If lazygit is missing a feature, there's a good chance you can implement it yourself with a custom command!
|
| 376 |
+
|
| 377 |
+
See the [docs](docs/Custom_Command_Keybindings.md)
|
| 378 |
+
|
| 379 |
+
## Contributing
|
| 380 |
+
|
| 381 |
+
We love your input! Please check out the [contributing guide](CONTRIBUTING.md).
|
| 382 |
+
For contributor discussion about things not better discussed here in the repo, join the [discord channel](https://discord.gg/ehwFt2t4wt)
|
| 383 |
+
|
| 384 |
+
<a href="https://discord.gg/ehwFt2t4wt"><img src='../assets/discord.png' width='75'></a>
|
| 385 |
+
|
| 386 |
+
Check out this [video](https://www.youtube.com/watch?v=kNavnhzZHtk) walking through the creation of a small feature in lazygit if you want an idea of where to get started.
|
| 387 |
+
|
| 388 |
+
### Debugging Locally
|
| 389 |
+
|
| 390 |
+
Run `lazygit --debug` in one terminal tab and `lazygit --logs` in another to view the program and its log output side by side
|
| 391 |
+
|
| 392 |
+
## Donate
|
| 393 |
+
|
| 394 |
+
If you would like to support the development of lazygit, consider [sponsoring me](https://github.com/sponsors/jesseduffield) (github is matching all donations dollar-for-dollar for 12 months)
|
| 395 |
+
|
| 396 |
+
## FAQ
|
| 397 |
+
|
| 398 |
+
### What do the commit colors represent?
|
| 399 |
+
|
| 400 |
+
- Green: the commit is included in the master branch
|
| 401 |
+
- Yellow: the commit is not included in the master branch
|
| 402 |
+
- Red: the commit has not been pushed to the upstream branch
|
| 403 |
+
|
| 404 |
+
## Shameless Plug
|
| 405 |
+
|
| 406 |
+
If you want to see what I (Jesse) am up to in terms of development, follow me on
|
| 407 |
+
[twitter](https://twitter.com/DuffieldJesse) or check out my [blog](https://jesseduffield.com/)
|
| 408 |
+
|
| 409 |
+
```
|
| 410 |
+
``` asdfas
|
| 411 |
+
|
| 412 |
+
## Alternatives
|
| 413 |
+
|
| 414 |
+
```
|
| 415 |
+
If you find that lazygit doesn't quite satisfy your requirements, these may be a better fit:
|
| 416 |
+
|
| 417 |
+
- [GitUI](https://github.com/Extrawurst/gitui)
|
| 418 |
+
- [tig](https://github.com/jonas/tig)
|
multi_sheets.xlsx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:30d7708d6526c219907ef84e586203903c8b28828c6205fa4808a8effd47918b
|
| 3 |
+
size 38442
|
normal.pptx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4af62512a81fb9769bc9ebbf787768f70edb539e00638c855c5d5d454f48e563
|
| 3 |
+
size 6851085
|
short.pdf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:46b6091e0e84d92ed2880ee5c24a6cf618693ebf8390a9804f4297a5c66b8686
|
| 3 |
+
size 110502
|
short.rtf
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
short_image.pdf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:db84f788bd660b05f9a8e92d60d34daee5e81afd1535656fbf3f7fecbff5f189
|
| 3 |
+
size 400565
|
short_image.pptx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:abe3a1291a0bc68a4f3d10ae53e1531b9ffa52d885205bc03a448819b6775396
|
| 3 |
+
size 55385
|
with_image.docx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9efb9b2c0e55434225515ebd8d4f47a0601bc34686c73774e8c76f50ad9917b6
|
| 3 |
+
size 183712
|
with_image.odt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0f1ec6e15ca30afb6b33b171bd80504ca59b830c0e594162af4e656286407812
|
| 3 |
+
size 251679
|
with_table.jpg
ADDED
|
Git LFS Details
|