This extension is for writing notes in the markdown format to the VS code. Notes are placed in a single directory and are managed with filename based on date.
- Compatibility of memo command configuration file
config.toml
and placement directory - Memo: New/Edit/Grep/Config does not require the memo command.
- If you use Memo: Serve, you need to install memo command.
- Inspired by memo (Memo Life For You)
The following commands are supported.
Memo: New
- create memo (memo command is not necessary)Memo: Edit
- list/edit memo (memo command is not necessary)Memo: Grep
- grep memo (memo command is not necessary)Memo: Config
- configure (memo command is not necessary)Memo: Serve
- start http server (Requires memo command)
Unique command (memo command is not necessary): ``
Memo: Today's quick Memo
- Append to the file of today's dateMemo: Re:Date
- Change the date included in the file name to today's dateMemo: Todo
- Output items matching the specified pattern (experimental)Memo: Open Memo Folder
- Open the folder where the memo is stored in the new instance
-
Create a file with the entered value as
title
andfilename
. -
When you press enter with empty, create a file with
YY-MM-DD.md
. If a file with the same name already exists, it opens the file without overwriting it. -
When text is selected (selected on vscode or copy) on the editor and the command is executed, it can be used for title and file name.
-
The file is opened to the VS Code instance that executed the
Memo: Edit
command. -
The file is opened with
preview
state. -
Markdown Preview can be displayed at the same time by setting option
memo-life-for-you.openMarkdownPreview
- Open the
YY-MM-DD.md
file if it exists. If it does not exist, create it and open. - Every time you open, add a timestamp on the bottom line. example:
## 2017-10-19 Thu 06:38
- You can insert ISOweek and random-Emoji into the timestamp. example:
## [Week: 42/52] 😸 42 2017-10-19 Thu 06:26
- When text is selected on the editor and the command is executed, it can be used for title name.
- Since the writing is done, the file is opened with
not preview
.
-
List the file name and the first line of the file as
memo list
ormemo edit
. -
The files to be displayed in the list have only
.md
and.txt
extensions (default). Can be changed in thememo-life-for-you.listDisplayExtname
setting."memo-life-for-you.listDisplayExtname": [ "md", "txt" ],
-
Filter by keyword.
-
You can move the list with the keyboard (up/down cursor keys). And you can preview file contents
-
Markdown Preview can be displayed at the same time by setting option
memo-life-for-you.openMarkdownPreview
. -
selected file will be opened in the VS Code instance that executed the
Memo: Edit
command. -
The file is opened with
preview
state. -
At the same time, generate
Memo List
output panel which outputs file list.
- it is also possible to display Markdown Preview by setting
"memo-life-for-you.listMarkdownPreview": true
. However, in order to use this function, the Markdown preview Enhanced extension must be installed. - Markdown preview is displayed only when operating the keyboard.
- You can cancel by pressing the
ESC
key.
- Use
ripgrep
included in VS Code distribution. - By entering keyword or pattern, the search results are displayed on Quick Picker.
- Open by selecting a file and move the cursor to the corresponding line and column
- selected file will be opened in the VS Code instance that executed the
Memo: Grep
command - The file is opened with
preview
state. - At the same time, generate
Memo Grep
output panel which outputs file list.
Picker Items is created from the output of ripgrep
command. Therefore, picker items may not be generated correctly depending on the output.
You do not need to install it separately to use ripgrep that ships with VS Code.
Options to use:
--vimgrep
-- Show results with every match on its own line, including line numbers and column numbers.--color never
-- Do not use color in output.-g *.md
-- Include *.md files for searching that match the given glob.-S
-- Search case insensitively if the pattern is all lowercase.
You can specify options individually by preparing the ripgrep configuration file.
If memo-life-for-you.memoGrepUseRipGrepConfigFile
is set to true
, $HOME/.ripgreprc (Windows example:
C:\Users\Sato\.ripgreprc)
is used as the configuration file.
In addition, you can specify the configuration file. To use an arbitrary file, set the absolute path of the configuration file in memo-life-for-you.memoGrepUseRipGrepConfigFilePath
. (Example: "memo-life-for-you.memoGrepUseRipGrepConfigFilePath": "/Users/satokaz/.vscode-ripgreprc"
)
If the configuration file does not exist, an error occurs.
The following option is mandatory;
--vimgrep
Same settings as built-in options:
--vimgrep
--color never
--glob=*.md
--smart-case
See: https://github.com/BurntSushi/ripgrep/blob/master/GUIDE.md#configuration-file
- Open configure file on VS Code.
- Requires memo command. If you do not need this function, you do not need to install the memo command.
- Execute
memo serve
, start the built-in http server of the memo command. and display it in the browser. Manually you need to kill the process manually.
- Output items matching the specified pattern. The default pattern is
^.*@todo.*?:
. - It matches the pattern by writing
@todo:
as shown below
### todo example
* [ ] @todo: Submit to customer due:2018-04-18
* [x] Thank Mom for the meatballs @phone @todo: Impression of meatball
- @todo: Get back to the boss
It is useful for "copy and paste" from an editor or preview and saving to a file.
- Chrome must be installed
- Launch chrome with simple notepad mode
Execute select-all (Ctrl + A or ⌘A )and copy (Ctrl + C or ⌘C) on the vscode preview on the right side. Paste (Ctrl + P or ⌘P) to the Chroem on the left side:
In vscode insiders 1.26, select-all (ctrl + a or ⌘A) is supported in preview
With the memo-life-for-you.openChromeCustomizeURL
setting, you can customize it to your preferred URL.
default:
"memo-life-for-you.openChromeCustomizeURL": "data:text/html, <html contenteditable>"
When customizing, the comment column of https://coderwall.com/p/lhsrcq/one-line-browser-notepad is helpful.
macOS only enabled
Open the file that is opened in the active markdown editor with Typora. You need to install typora.
You can use memo template using Go's text/template format. A template receives the following attributes.
Title Date (format: %Y-%m-%d)
example:
---
title: {{.Title}}
date: {{.Date}}
---
{{.Title}}
===========
---
title: test
date: 2019-11-13
---
test
===========
glidenote/memolist.vim's template format is not supported.
If configuration files and directories do not exist, they are automatically created for the first time.
This file can also be used as it is with the memo command.
memodir - Destination directory of memo file (Required for this extension)
memotemplate - Destination file path of template file (Optional)
editor - editor command (not used by this extension)
column - Number of display columns (not used by this extension)
selectcmd - selector command (not used by this extension)
grepcmd - grep command (not used by this extension)
assetsdir - (not used by this extension)
pluginsdir - (not used by this extension)
templatedirfile - (not used by this extension)
default configuration:
macOS:
memodir = "/Users/satokaz/.config/memo/_posts"
memotemplate = ""
editor = "code"
column = 20
selectcmd = "peco"
grepcmd = "/Applications/Visual\\ Studio\\ Code\\ -\\ Insiders.app/Contents/Resources/app/node_modules/vscode-ripgrep/bin/rg -n --no-heading -S ${PATTERN} ${FILES}"
assetsdir = ""
pluginsdir = ""
templatedirfile = ""
Windows:
memodir = "C:\\Users\\Sato\\AppData\\Roaming\\memo\\_posts"
memotemplate = ""
editor = "code"
column = 20
selectcmd = "peco"
grepcmd = "grep -nH ${PATTERN} ${FILES}"
assetsdir = ""
pluginsdir = "C:\\Users\\Sato\\AppData\\Roaming\\memo\\plugins"
templatedirfile = ""
templatebodyfile = ""
Better TOML - Visual Studio Marketplace: Recommend to handle TOML file Extension
For windows: From the memo command, I do not know how to write the path to execute ripgrep that is included in VS Code. Therefore, it is necessary to set the grep command individually in Windows environment. (ripgrep command path:
c:\Program Files\Microsoft VS Code Insiders\resources\app\node_modules\vscode-ripgrep\bin\rg
)
If you use Serve command, This extension requires the memo command to work correctly.
memo
should be installed already
This extension contributes the following settings:
-
"memo-life-for-you.memoPath"
: Path to memo command (If you use Serve command)- ex: Mac/Linux:
"/Users/satokaz/golang/bin/memo"
- ex: Windows:
"C:/Users/Sato/go/bin/memo.exe"
- ex: Mac/Linux:
-
"memo-life-for-you.serve-addr"
: server address (If you use Serve command)memo serve --addr :8083
= ex: "memo-life-for-you.serve-addr": "8083" (default: "8080")
-
"memo-life-for-you.dateFormat"
: Follow format of date-fns. See: https://date-fns.org/v2.16.1/docs/format (default: "yyyy-MM-dd ddd HH:mm") -
memo-life-for-you.insertISOWeek
: Insert ISO Week when "Memo: Today's quick Memo" is executed -
memo-life-for-you.insertEmoji
: Insert random-Emoji when "Memo: Today's quick Memo" is executedexample:
## [Week: 42/52] 😸 42 2017-10-19 Thu 06:26
"memo-life-for-you.dateFormat": "yyyy-MM-dd ddd HH:mm", "memo-life-for-you.insertISOWeek": true, "memo-life-for-you.insertEmoji": true,
-
memo-life-for-you.displayFileBirthTime
: Display birthtime of file inMemo: Edit
additionally (default: false) -
memo-life-for-you.grepLineBackgroundColor
: Search results show keyword background color -
memo-life-for-you.grepKeywordBackgroundColor
: Search results show line background color -
memo-life-for-you.openMarkdownPreview
: Open Markdown Preview at the same time as opening the file in the editor (default: false) -
memo-life-for-you.openNewInstance
: Launch a new instance to create a new memo -
memo-life-for-you.listSortOrder
: Controls the order of Memo: List display. Selectable fromfilename
orbirthtime
ormtime
-
memo-life-for-you.memoGrepUseRipGrepConfigFile
: Do you want ripgrep to work with the configuration file (default: $HOME/.ripgreprc) -
memo-life-for-you.memoGrepUseRipGrepConfigFilePath
: If you set memoGrepUseRipGrepConfigFile to ture and want to use ripgrep config file located further in a specific place, set the path of config file (example: /Users/satokaz/.vscode-ripgreprc) -
memo-life-for-you.memoTodoUserePattern
: Define a pattern to recognize as Todo. (default: ^.@todo.?:) -
memo-life-for-you.memoNewFilenameFromClipboard
: Use the string stored in OS clipboard as the name of the newly created file (defaut: false), -
memo-life-for-you.memoNewFilenameFromSelection
: Use the selected string on vscode as the name of the newly create file (default: false), -
memo-life-for-you.memoNewFilNameDateSuffix
: Add a date related suffix after filename prefix (yyyy-MM-dd). The added string is passed to datefns.format(). See: https://date-fns.org/v2.16.1/docs/format (default: empty).example:
- If you specify
-dddd
, the filename is2018-05-24-Thursday.md
. - If you specify
-W
, the filename is2018-05-24-21.md
. - If you add a string, some characters may be formatted by datefns.format(). If you do not want to format it please escape the character with
\\
.
- If you specify
-
memo-life-for-you.openMarkdownPreviewUseMPE
: Ifmemo-life-for-you.openMarkdownPreview
is set totrue
, useMarkdown Preview Enhanced
(https://marketplace.visualstudio.com/items?itemName=shd101wyy.markdown-preview-enhanced) to open preview (default: false)" -
memo-life-for-you.openChromeCustomizeURL
: Define a customized URL for theMemo: Open Chrome with <html contenteditable>
command. -
memo-life-for-you.titlePrefix
: When executingMemo: Today's Quick Memo
, it automatically inserts the specified prefix string of the title
- "prefix": "insert date" - Add a snippet to enter the time of the format such as
## 2019-07-01 Mon 09:53
You can transparentize the quickitem list which displays the file list and search results. However, this setting also affects the sidebar.
"workbench.colorCustomizations": {
"quickInput.background": "#262626DD" // For a Dark theme
// "quickInput.background": "#F0F0F0DD" //For a light theme
},
The vscode command below will help you:
Execute View: Open Previous Recently Used Editor
from the command palette.
Alternatively, assign the workbench.action.openPreviousRecentlyUsedEditor
command to a shortcut key.
Without losing Memo:list or grep results, You can operate the editor and so on. Add the following to the settings:
"workbench.quickOpen.closeOnFocusLost": false
- If you open a file, the repository information that contains that file will be added to SCM view. (See When I Open Just One File in Initialized Git Folder - Source Control Shows Number of Changed Files · Issue #35555 · Microsoft/vscode)
Licensed under the MIT License.
Enjoy!