Navigation Menu

Skip to content

Commit

Permalink
Add "Ctrl + /" and "Shift + Ctrl + /" to insert today's date and time (
Browse files Browse the repository at this point in the history
  • Loading branch information
amedora authored and Rokt33r committed Apr 12, 2019
1 parent 89e9a84 commit aea9673
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions browser/components/CodeEditor.js
Expand Up @@ -197,6 +197,26 @@ export default class CodeEditor extends React.Component {
'Cmd-T': function (cm) {
// Do nothing
},
'Ctrl-/': function (cm) {
if (global.process.platform === 'darwin') { return }
const dateNow = new Date()
cm.replaceSelection(dateNow.toLocaleDateString())
},
'Cmd-/': function (cm) {
if (global.process.platform !== 'darwin') { return }
const dateNow = new Date()
cm.replaceSelection(dateNow.toLocaleDateString())
},
'Shift-Ctrl-/': function (cm) {
if (global.process.platform === 'darwin') { return }
const dateNow = new Date()
cm.replaceSelection(dateNow.toLocaleString())
},
'Shift-Cmd-/': function (cm) {
if (global.process.platform !== 'darwin') { return }
const dateNow = new Date()
cm.replaceSelection(dateNow.toLocaleString())
},
Enter: 'boostNewLineAndIndentContinueMarkdownList',
'Ctrl-C': cm => {
if (cm.getOption('keyMap').substr(0, 3) === 'vim') {
Expand Down

0 comments on commit aea9673

Please sign in to comment.