Obsidian使用 Spaced Repetition 制作闪念卡片

Obsidian使用 Spaced Repetition 制作闪念卡片

该文作为基础的闪念卡片的使用说明,介绍几种闪念卡片定义的方式,便于后续查阅,参考:

基本规则

  • 单个确定为 Flashcards 的笔记文件中可以存放多个闪念卡片。
  • 会根据记忆程度来设立需要复习的时间

卡片分组

在 Tab 中使用 / 可以引出卡片界面的层级,只需要在设置里设定最高层的分组,后续的分组用 / 引出即可。

image.png

使用以下的标签就能实现上述的分组结果:#vocabulary/day00;需要注意到的是只有至少一个问答时才会显示在对应的表中。


VsCode's RegExp Catch 正则捕获

VsCode's RegExp Catch 正则捕获

本篇简单介绍一些 VsCode 进行文本替换和查找的一些特殊的正则,该文会随着自己的使用来逐步记录,目前主要内容如下:

  • 捕获组合及其替换模式

这里不会介绍正则表达式的语法,对其基本语法感兴趣可以查看如下链接 VsCode使用正则表达式,以及我之前写过的基础的正则表达式 一文,下面进入正题;

Intro 正则搜索

正则表达式主要思路为模式匹配,通过符号表达来指定一种模式,识别所有符合该模式的字符组合,而非某些特定的文字,因此可以简化我们的搜索和替换过程,下面以一个例子说明。

例如有一个文件配置如下,而我们希望找到其中所有 user_config ,查看每个 user 的设置是否正确,由于 username 的长度和内容都不是一样的,所以这里需要使用正则来进行搜索:

1
2
3
4
5
zxc1_config=123
some content we dont need
asd2_config=234
and some other infomation or comment
qwer3_config=345

对应该场景的正则表达则为 +*_config= 或者 [a-z, 0-9]*_config= 等写法均可,效果如下:

image.png

可以看到我们需要的内容都被高亮了,这也就方便了我们进行一些复杂的文字处理,而搜索,也就是正则最基本也是最正统的用法,这里不再多说。


转)vimscript in 5 minus
Vim 01 Recorder

Vim 01 Recorder

Chose Your Dotfile to start the vim

1
vim -u {path to your .vimrc}

Recorder of Vim

This Chapter mainly introduces the Recorder in vim,Which is used to do some repeated operations.This function is also called a macro.

for more information try :help recording

This section will introduce related concept/function of recording function. Which help us to understand how this works, and what we should pay attention to it.

register of vim: register is a superset of macro, it contains more function. In this part we should know, register can store some string or operations to help subsequent use.

Status:
Using :registers or :reg to check those we have registered, or add the registers’s name behind to show those u’re interested in.

1
2
3
4
5
:reg a b c 
--- Registers ---
"a register a content
"b register b content
"c register c content

Lifecycle
The information in registers will not disappear with the window closed. But maybe with the system-level’s open-close. we should test this!!! So we can store some snippet,pwd,etc.


VsCode's Configuration

VsCode's Configuration

Debug

配置Launch.json 能够帮助我们更好的进行debug的操作,有一些比较特别的文件名和相关编码。

  • ${workspaceFolder} 指代当前运行目录
  • ${file}指代当前文件

找到launch文件并打开,自定义JSON:执行工作文件夹下的main.py进行调试。

1
2
3
4
5
6
7
8
9
{
"name": "experiment",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/main.py",
"console": "integratedTerminal",
"args": ["--data_path","${workspaceFolder}/data",
"--mode","0","--resume","false"]
},

默认 JSON:执行当前文件


Vim 00 Basic Opeation

Vim 00 Basic Opeation

this is the Note record the vimtutor (the basic usage of vim.)
@Aiken 2021

delete command

Most of the command can use NUM to repeat it.
d num command means delete num times with args below:
c means del and change mode to insert:


Vim Configuration 03 Spacevim Setup

Vim Configuration 03 Spacevim Setup

@Aiken 2021 this file is use to record how to config out vim’ by spacevim.
I’ll write this doc with three Parts:

  • Install and envs, Plugins(including the LSP), KeyShort
  • Attention: we have much to do if we want to install some other plugins.
    maybe it not a good way to set the vim.

INSTALL SPACEVIM AND CONFIG IT

Install: SpaceVim via the offical websize:

1
2
The COMMAND is like:
curl -sLf https://spacevim.org/cn/install.sh | bash

Vim Configuration 02 Nvim的插件配置

Vim Configuration 02 Nvim的插件配置

@Aikenhong 2021

Vim is a important consistant for editing file in shell. It’s Hightly Customized for Everyone, In this part I’ll Show my personal Vim comfigurations

And I’ll Discuss about the diff between Spacevim & Neovim.

Give a conclusion in advance: Recommand Config the Vim for Yourself

  • You only need to config once, then you should save it in the cloud.
  • You will Know all the Keyshot you setting up, and you can customize it as you want.

image-20211014192437083

Based on neovim

基于NeoVim进行配置,不采用SpaveVim的配置文件,这里需要建议采用最新的测试版的NeoVim(>= 0.5),Stable的NVim已经很久没有更新,对一些新的插件缺乏支持。

Install

Installing Neovim Download NeoVim Package and Install from source

or Install from neovim-ppa Like Following:

1
2
3
sudo add-apt-repository ppa:neovim-ppa/unstable
sudo apt-get update
sudo apt-get install neovim

Vim Configuration 01 vim的无插件基础设置

Vim Configuration 01 vim的无插件基础设置

该配置笔记于 20230521 重新整理。默认的 Vimrc 位置为 /usr/share/vim/vimrc,也可以在 vim 界面使用 :echo $MYVIMRC 查看当前的配置文件,默认使用的配置文件地址为 ~/.vimrc

参考文献地址:Good VimRC | Backspace | AutoCmd | VIM配置入门
配置文件地址:AikenDotfile,本文这里只介绍部分配置,一些过于常见的配置等等这里就不再介绍,在 dotfile 中对每行配置均有的细致的注释。

基于 VimScript) 该 blog 主要记录基础 vim 的配置文件编写,旨在使用基础 vim 的时候也能有一个较好的代码编辑体验,同时提供部分 keymap 集成一些简单的功能,方便文档编写时候的格式转换等。这个配置文件在后续配置 nvim 的时候部分配置也会沿用。

Vim 的基础配置

自动检测文件修改,以及对多个文件的 workspace 自动切换

1
2
3
" >>0-1 state detection.
set autoread " when file change outside, we will know
set autochdir " change workspace when we swtich file, when we open multi-file in one session.

鼠标和剪切板功能

设置 vim 对鼠标的支持,支持鼠标选择等

1
2
3
4
5
6
" reference the web get the best setting and use it always
" suppose the mouse operation
" but this function not work well in the weterm, we disable this part for work.
set mouse=a
"set selection=exclusive
"set selectmode=mouse,key

设置和系统同步的剪切板,WSL 下的剪切板设置可以参考下面文章 WSL2 clipboard not shared between Linux and Windows || Reddit - Dive into anything

1
2
3
4
5
6
7
8
9
10
11
12
" set the clipboard
set clipboard+=unnamed

" WSL yank support
let s:clip = '/mnt/c/WINDOWS/system32/clip.exe' " change this path according to your mount point
if executable(s:clip)
augroup WSLYank
autocmd!
autocmd TextYankPost * if v:event.operator ==# 'y' | call system(s:clip, @0) | endif
augroup END
endif

设置撤销历史记录

多次编辑同一个文件的时候保持 Undo 的历史记录,便于对同一个文件进行编辑。

1
2
3
4
" >>0-2 keep file history
set undofile " keep the undo history in file.
set undodir=~/.vim/.undo//
set history=1000

通过上述命令启用 undofile 的选项,并设置存储目录,这里需要注意的是,存储目录需要手动创建,undo 的历史记录才能生效。