Skip to content

Commit

Permalink
update readme showing how to change the value of 'desc'
Browse files Browse the repository at this point in the history
  • Loading branch information
snoblenet committed Aug 3, 2024
1 parent b3889b3 commit 2bb8338
Showing 1 changed file with 31 additions and 2 deletions.
33 changes: 31 additions & 2 deletions DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -847,13 +847,42 @@ require('orgmode').setup({
org_agenda = false,
org_capture = 'gC'
},
agenda = {
org_agenda_later = false
}
})
```

To change a key mapping's `lhs` but not its `desc`, provide a string or a table:

```lua
require('orgmode').setup({
org_agenda_files = {'~/Dropbox/org/*', '~/my-orgs/**/*'},
org_default_notes_file = '~/Dropbox/org/refile.org',
mappings = {
global = {
-- providing a string
org_agenda = '<D-a>',
-- providing a table
org_capture = { '<D-c>' }
},
}
})

To change a key mapping's `lhs` and its `desc`, provide a table:

```lua
require('orgmode').setup({
org_agenda_files = {'~/Dropbox/org/*', '~/my-orgs/**/*'},
org_default_notes_file = '~/Dropbox/org/refile.org',
mappings = {
global = {
org_capture = { '<D-c>', desc = 'Open Capture Prompt' }
}
}
})
```

(The `desc` value is displayed in tools like WhichKey.)

You can find the configuration file that holds all default mappings [here](./lua/orgmode/config/mappings/init.lua)

**NOTE**: All mappings are normal mode mappings (`nnoremap`) with exception of `org_return`
Expand Down

0 comments on commit 2bb8338

Please sign in to comment.