diff --git a/README.md b/README.md index 204b734..ddc2792 100644 --- a/README.md +++ b/README.md @@ -84,9 +84,13 @@ In case writing in a text input (e,g, new project/task, due date), you have to ` | Global | `p` | Go to Project list | | Global | `t` | Go to Task list | | Projects | `n` | New Project | +| Projects | `↑`/`k`/`Shift+Tab` | Go up in project list | +| Projects | `↓`/`j`/`Tab` | Go down in project list | | Tasks | `n` | New Task | -| Tasks | `Esc` | Go back to Projects Pane | -| Task Detail | `Esc` | Go back to Tasks Pane | +| Tasks | `Esc`/`h` | Go back to Projects Pane | +| Tasks | `↑`/`k`/`Shift+Tab` | Go up in task list | +| Tasks | `↓`/`j`/`Tab` | Go down in task list | +| Task Detail | `Esc`/`h` | Go back to Tasks Pane | | Task Detail | `Space` | Toggle task as done/pending | | Task Detail | `d` | Set Due date | | Task Detail | `↓`/`↑` | Scroll Up/Down the note editor | @@ -95,9 +99,36 @@ In case writing in a text input (e,g, new project/task, due date), you have to ` **Tips about using shortcuts efficiently:** -- `Esc` will bring you a step back - to previous pane in most cases. -- When you're in Project or Task list, use `↓`/`↑` to navigate the list. -- When you're in Project or Task list `Enter` will load currently selected Project/Task. +The interface has 3 primary panels +1. [**P**]rojects/Task lists +2. [**T**]asks of selected project or Tasklist +3. [**D**]etails/actions of selected Project or Task + +The following diagram shows navigation shortcuts between the panels. +``` ++------+----------------------+-----------------------+ +| P | T | D | +| | | | +| Entr=> ↓ ↑ Entr=> | +| | tab TAB | | +| <=Esc/h j k <=Esc/h | +| | | | ++------+----------------------+-----------------------+ +``` + +So, what it's trying to visualize is - +- Selecting an item with `Enter` will move you to right panel. That means - + - Selecting a Project will load it's tasks and move to Tasks panel + - Selecting a Task will load task detail and move to Detail panel +- Use `Esc` or `h` (like vim) to move to left panel. Details to Tasks to Projects. +- To navigate a list (Project list or Task list), + - Use `↓` or `j` or `Tab` to go down + - Use `↑` or `k` or `Shift+Tab` to go up + +Some More hints: +- If you are a vim user, think like -`j`/`k` for up/down list and `h` for go left +- Think `Esc` as a "step back" - to previous pane in most cases. +- When you're in a list (Projects or Tasks), `Enter` will load currently selected item. - After creating new Project, focus will automatically move to Tasks. Start adding tasks immediately by pressing `n`. - After creating new Task, focus will stay in "new task" input. So that you can add tasks quickly one after another. - After creating new Task, Press `Esc` when you're done creating tasks. diff --git a/app/projects.go b/app/projects.go index b8254ea..778fe6f 100644 --- a/app/projects.go +++ b/app/projects.go @@ -111,6 +111,10 @@ func (pane *ProjectPane) addSection(name string) { func (pane *ProjectPane) handleShortcuts(event *tcell.EventKey) *tcell.EventKey { switch event.Rune() { + case 'j': + pane.list.SetCurrentItem(pane.list.GetCurrentItem() + 1) + case 'k': + pane.list.SetCurrentItem(pane.list.GetCurrentItem() - 1) case 'n': app.SetFocus(pane.newProject) } diff --git a/app/task_detail.go b/app/task_detail.go index b09e0f5..fd172ec 100644 --- a/app/task_detail.go +++ b/app/task_detail.go @@ -259,9 +259,9 @@ func (td *TaskDetailPane) editInExternalEditor() { td.SetTask(td.task) } - app.ForceDraw() - // @TODO: Not working - fix it - app.EnableMouse(true) + // @TODO: Mouse events not being captured after returning from Suspend - fix it + // app.EnableMouse(true). + _ = os.Remove(tmpFileName) // app.SetFocus(td) @@ -298,6 +298,8 @@ func (td *TaskDetailPane) handleShortcuts(event *tcell.EventKey) *tcell.EventKey td.editInExternalEditor() case 'd': app.SetFocus(td.taskDate) + case 'h': + app.SetFocus(taskPane) case ' ': td.toggleTaskStatus() } diff --git a/app/tasks.go b/app/tasks.go index c2ff906..2393b47 100644 --- a/app/tasks.go +++ b/app/tasks.go @@ -100,6 +100,12 @@ func (pane *TaskPane) addTaskToList(i int) *tview.List { func (pane *TaskPane) handleShortcuts(event *tcell.EventKey) *tcell.EventKey { switch event.Rune() { + case 'j': + pane.list.SetCurrentItem(pane.list.GetCurrentItem() + 1) + case 'k': + pane.list.SetCurrentItem(pane.list.GetCurrentItem() - 1) + case 'h': + app.SetFocus(projectPane) case 'n': app.SetFocus(pane.newTask) }