Skip to content

Commit 6a07827

Browse files
committed
feat(paste_image): add keymap for pasting images from the clipboard
1 parent 79687d1 commit 6a07827

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ require('opencode').setup({
112112
['<leader>oR'] = { 'rename_session' }, -- Rename current session
113113
['<leader>op'] = { 'configure_provider' }, -- Quick provider and model switch from predefined list
114114
['<leader>oz'] = { 'toggle_zoom' }, -- Zoom in/out on the Opencode windows
115+
['<leader>ov'] = { 'paste_image'}, -- Paste image from clipboard into current session
115116
['<leader>od'] = { 'diff_open' }, -- Opens a diff tab of a modified file since the last opencode prompt
116117
['<leader>o]'] = { 'diff_next' }, -- Navigate to next file diff
117118
['<leader>o['] = { 'diff_prev' }, -- Navigate to previous file diff
@@ -135,6 +136,7 @@ require('opencode').setup({
135136
['@'] = { 'mention', mode = 'i' }, -- Insert mention (file/agent)
136137
['/'] = { 'slash_commands', mode = 'i' }, -- Pick a command to run in the input window
137138
['#'] = { 'context_items', mode = 'i' }, -- Manage context items (current file, selection, diagnostics, mentioned files)
139+
['<M-v>'] = { 'paste_image', mode = 'i' }, -- Paste image from clipboard as attachment
138140
['<C-i>'] = { 'focus_input', mode = { 'n', 'i' } }, -- Focus on input window and enter insert mode at the end of the input from the output window
139141
['<tab>'] = { 'toggle_pane', mode = { 'n', 'i' } }, -- Toggle between input and output panes
140142
['<up>'] = { 'prev_prompt_history', mode = { 'n', 'i' } }, -- Navigate to previous prompt in history

lua/opencode/config.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ M.defaults = {
6161
['@'] = { 'mention', mode = 'i' },
6262
['/'] = { 'slash_commands', mode = 'i' },
6363
['#'] = { 'context_items', mode = 'i' },
64+
['<M-v>'] = { 'paste_image', mode = 'i' },
6465
['<tab>'] = { 'toggle_pane', mode = { 'n', 'i' } },
6566
['<up>'] = { 'prev_prompt_history', mode = { 'n', 'i' } },
6667
['<down>'] = { 'next_prompt_history', mode = { 'n', 'i' } },

0 commit comments

Comments
 (0)