我尝试把我的这个笔记使用lvim进行编辑, 感觉还挺爽

记录一下最近在做的事情, 基本上是开发环境的配置, 我居然实现了godot+lunarvim, 然后用lvim代替了obsidian和vscode, 这真是太库拉l
main
Yogi 2023-10-11 00:46:36 +08:00
parent 3a6054d6dc
commit 726baede9b
24 changed files with 910 additions and 62 deletions

188
.obsidian.vimrc Normal file
View File

@ -0,0 +1,188 @@
""""""""""""""""""""""
" Leader
""""""""""""""""""""""
" let mapleader=,
" can't set leaders in Obsidian vim, so the key just has to be used consistently.
" However, it needs to be unmapped, to not trigger default behavior: https://github.com/esm7/obsidian-vimrc-support#some-help-with-binding-space-chords-doom-and-spacemacs-fans
unmap ,
" map ; to : in normal mode, so that I dont rely on the shift key
" nmap ; :
" no modifier key for jumping to next word
nmap + *
" Have j and k navigate visual lines rather than logical ones
nmap j gj
nmap k gk
" I like using H and L for beginning/end of line
nmap H ^
nmap L $
" nmap J 5j
" nmap K 5k
" Moving to next/prev paragraph
nmap [ {
nmap ] }
" Yank to system clipboard
set clipboard=unnamed
" Surround
exmap surround_wiki surround [[ ]]
exmap surround_double_quotes surround " "
exmap surround_single_quotes surround ' '
exmap surround_brackets surround ( )
exmap surround_square_brackets surround [ ]
exmap surround_curly_brackets surround { }
exmap surround_chinese_double_quotes surround “ ”
exmap surround_chinese_brackets surround 「 」
" NOTE: must use 'map' and not 'nmap'
map [[ :surround_wiki
nunmap s
vunmap s
map s" :surround_double_quotes
map s' :surround_single_quotes
map s( :surround_brackets
map s) :surround_brackets
map s[ :surround_square_brackets
map s{ :surround_curly_brackets
map s} :surround_curly_brackets
" Surround 中文双引号
map s] :surround_chinese_brackets
map s\ :surround_chinese_brackets
map ss :surround_chinese_double_quotes
map sy :surround_chinese_double_quotes
" Surround Admonition https://github.com/esm7/obsidian-vimrc-support/discussions/146
exmap CodeBlockAdmonitionNote obcommand code-block-from-selection:17f30753-d5f4-4953-abed-5027a25ede58
map san :CodeBlockAdmonitionNote
exmap CodeBlockSelectionAdmonitionNote jscommand { editor.setSelections([selection]); this.app.commands.commands['code-block-from-selection:17f30753-d5f4-4953-abed-5027a25ede58'].callback() }
vmap san :CodeBlockSelectionAdmonitionNote
exmap CodeBlockAdmonitionBrainstorm obcommand code-block-from-selection:36a8b91d-c4f1-4ac4-999c-7bfc53c998c1
map sab :CodeBlockAdmonitionBrainstorm
exmap CodeBlockSelectionAdmonitionBrainstorm jscommand { editor.setSelections([selection]); this.app.commands.commands['code-block-from-selection:36a8b91d-c4f1-4ac4-999c-7bfc53c998c1'].callback() }
vmap sab :CodeBlockSelectionAdmonitionBrainstorm
exmap CodeBlockAdmonitionQuote obcommand code-block-from-selection:91dc799c-4f7e-4d75-9cde-d9e6db990a5a
map saq :CodeBlockAdmonitionQuote
exmap CodeBlockSelectionAdmonitionQuote jscommand { editor.setSelections([selection]); this.app.commands.commands['code-block-from-selection:91dc799c-4f7e-4d75-9cde-d9e6db990a5a'].callback() }
vmap saq :CodeBlockSelectionAdmonitionQuote
exmap CodeBlockAdmonitionContext obcommand code-block-from-selection:cb332ef3-8053-42b0-88c9-a233e6dae6d0
map sac :CodeBlockAdmonitionContext
exmap CodeBlockSelectionAdmonitionContext jscommand { editor.setSelections([selection]); this.app.commands.commands['code-block-from-selection:cb332ef3-8053-42b0-88c9-a233e6dae6d0'].callback() }
vmap sac :CodeBlockSelectionAdmonitionContext
exmap CodeBlockAdmonitionRoutine obcommand code-block-from-selection:31f32950-d8df-4d8a-9ca3-91a34d2a67ab
map sar :CodeBlockAdmonitionRoutine
exmap CodeBlockSelectionAdmonitionRoutine jscommand { editor.setSelections([selection]); this.app.commands.commands['code-block-from-selection:31f32950-d8df-4d8a-9ca3-91a34d2a67ab'].callback() }
vmap sar :CodeBlockSelectionAdmonitionRoutine
exmap CodeBlockAdmonitionThink obcommand code-block-from-selection:655b28f0-353f-479e-bc5a-c0b422b987c9
map sat :655b28f0-353f-479e-bc5a-c0b422b987c9
exmap CodeBlockSelectionAdmonitionThink jscommand { editor.setSelections([selection]); this.app.commands.commands['code-block-from-selection:655b28f0-353f-479e-bc5a-c0b422b987c9'].callback() }
vmap sat :CodeBlockSelectionAdmonitionThink
" Emulate Folding https://vimhelp.org/fold.txt.html#fold-commands
exmap togglefold obcommand editor:toggle-fold
nmap zo :togglefold
exmap unfoldall obcommand editor:unfold-all
nmap zR :unfoldall
exmap foldall obcommand editor:fold-all
nmap zM :foldall
" Emulate Tab Switching https://vimhelp.org/tabpage.txt.html#gt
" requires Pane Relief: https://github.com/pjeby/pane-relief
exmap tabnext obcommand pane-relief:go-next
nmap gt :tabnext
exmap tabprev obcommand pane-relief:go-prev
nmap gT :tabprev
" Same as CMD+\
nmap g\ :tabnext
exmap openlink obcommand editor:open-link-in-new-leaf
nmap go :openlink
nmap gd :openlink
" [g]oto [f]ile (= Follow Link under cursor)
exmap followLinkUnderCursor obcommand editor:follow-link
nmap gf :followLinkUnderCursor
" Link Jump (similar to Vimium's f)
exmap linkjump obcommand mrj-jump-to-link:activate-lightspeed-jump
nmap ,f :linkjump
" g; go to last change - https://vimhelp.org/motion.txt.html#g%3B
nmap g; u<C-r>
" exmap cursorBackward obcommand heycalmdown-navigate-cursor-history:cursor-position-backward
" exmap cursorForward heycalmdown-navigate-cursor-history:cursor-position-forward
" nmap g; :cursorBackward
" nmap g' :cursorForward
" mapping next/previous heading
exmap nextHeading jsfile .obsidian.markdown-helper.js {jumpHeading(true)}
exmap prevHeading jsfile .obsidian.markdown-helper.js {jumpHeading(false)}
nmap g] :nextHeading
nmap g[ :prevHeading
exmap scrollToCenterTop70p jsfile .obsidian.markdown-helper.js {scrollToCursor(0.7)}
nmap zz :scrollToCenterTop70p
" rename file
exmap renameFile obcommand Obsidian-VimEx:file-rename-modal
nmap gr :renameFile
" mapping vs/hs as workspace split
exmap vs obcommand workspace:split-vertical
exmap sp obcommand workspace:split-vertical
exmap hs obcommand workspace:split-horizontal
nmap <C-w>v :vs
nmap <C-w>s :hs
" window controls
exmap wq obcommand workspace:close
exmap q obcommand workspace:close
" focus
exmap focusLeft obcommand editor:focus-left
exmap focusRight obcommand editor:focus-right
exmap focusBottom obcommand editor:focus-bottom
exmap focusTop obcommand editor:focus-top
nmap <C-w>h :focusLeft
nmap <C-w>l :focusRight
nmap <C-w>j :focusBottom
nmap <C-w>k :focusTop
" Blockquote
exmap toggleBlockquote obcommand editor:toggle-blockquote
nmap ,< :toggleBlockquote
nmap ,> :toggleBlockquote
" complete a Markdown task
exmap toggleTask obcommand editor:toggle-checklist-status
nmap ,x :toggleTask
" Zoom in/out
exmap zoomIn obcommand obsidian-zoom:zoom-in
exmap zoomOut obcommand obsidian-zoom:zoom-out
nmap zi :zoomIn
nmap zo :zoomOut
nmap &a :zoomOut
nmap &b :nextHeading
nmap &c :zoomIn
nmap &d :prevHeading
nmap z] &a&b&c
nmap z[ &a&d&c
" Stille Mode
exmap toggleStille obcommand obsidian-stille:toggleStille
nmap zs :toggleStille
nmap ,s :toggleStille

View File

@ -1,5 +1,8 @@
{
"promptDelete": false,
"attachmentFolderPath": "Aseets",
"alwaysUpdateLinks": true
"alwaysUpdateLinks": true,
"vimMode": false,
"showLineNumber": true,
"useMarkdownLinks": true
}

View File

@ -0,0 +1,3 @@
[
"obsidian-better-command-palette"
]

View File

@ -1 +1,26 @@
{}
{
"darlal-switcher-plus:switcher-plus:open-commands": [
{
"modifiers": [
"Mod"
],
"key": "P"
}
],
"darlal-switcher-plus:switcher-plus:open": [
{
"modifiers": [
"Mod"
],
"key": "O"
}
],
"darlal-switcher-plus:switcher-plus:open-symbols": [
{
"modifiers": [
"Mod"
],
"key": "I"
}
]
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,10 @@
{
"id": "obsidian-better-command-palette",
"name": "Better Command Palette",
"version": "0.17.1",
"minAppVersion": "0.12.0",
"description": "A command palette that does all of the things you want it to do.",
"author": "Alex Bieg",
"authorUrl": "www.github.com/AlexBieg",
"isDesktopOnly": false
}

View File

@ -0,0 +1,79 @@
.better-command-palette .better-command-palette-title {
color: var(--text-accent);
margin: 5px;
}
.better-command-palette .hidden-items-header {
margin: 0px;
margin-left: 13px;
margin-top: 10px;
font-size: 15px;
color: var(--text-faint);
}
.better-command-palette .hidden-items-header:hover {
color: var(--text-muted);
cursor: pointer;
}
.better-command-palette .suggestion-item.hidden {
color: var(--text-accent);
}
.better-command-palette .suggestion-item.hidden .suggestion-flair {
transform: rotate(45deg);
}
.better-command-palette .suggestion-item .suggestion-flair {
color: var(--text-faint);
margin-right: 10px;
}
.better-command-palette .suggestion-item .suggestion-hotkey {
white-space: nowrap;
margin-left: 10px;
padding: 0px 10px;
}
.better-command-palette .suggestion-item .suggestion-content svg {
margin: 0px 5px;
color: var(--text-muted);
}
.better-command-palette .suggestion-item .suggestion-aux {
flex-direction: row-reverse;
}
.better-command-palette .suggestion-item .suggestion-title {
display: flex;
align-items: center;
}
.better-command-palette .suggestion-item .suggestion-note {
flex: 1;
}
.better-command-palette .suggestion-item .unresolved {
color: var(--text-muted);
}
.better-command-palette .suggestion-item .unresolved::after {
content: "(Unresolved link)";
color: var(--text-faint);
margin-left: 10px;
}
/* Settings Styles */
.macro-setting {
flex-wrap: wrap;
}
.macro-setting .setting-item-name {
font-weight: bold;
}
.macro-setting .macro-main-settings {
width: 100%;
display: grid;
grid-template-columns: 80% 20%;
border-top: solid 1px var(--background-modifier-border);
margin-top: 10px;
}
.macro-setting .macro-main-settings * {
margin-top: 10px;
}
.macro-setting .macro-command {
display: flex;
align-items: center;
width: 100%;
}
.macro-setting .macro-command button {
margin-left: 30px;
margin-right: 20px;
}

View File

@ -4,19 +4,15 @@
"type": "split",
"children": [
{
"id": "19312355a28b9d05",
"id": "4b0a608721888c78",
"type": "tabs",
"children": [
{
"id": "daf761d0297d992f",
"id": "32c3ce4c80742947",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "README.md",
"mode": "source",
"source": false
}
"type": "empty",
"state": {}
}
}
]
@ -69,8 +65,7 @@
}
],
"direction": "horizontal",
"width": 300,
"collapsed": true
"width": 300
},
"right": {
"id": "008332ab0f5949de",
@ -79,14 +74,48 @@
{
"id": "35484acf1a42a40b",
"type": "tabs",
"dimension": 47.23809523809523,
"children": [
{
"id": "853e57e78eb9785c",
"type": "leaf",
"state": {
"type": "localgraph",
"state": {
"options": {
"collapse-filter": false,
"search": "",
"localJumps": 1,
"localBacklinks": true,
"localForelinks": true,
"localInterlinks": false,
"showTags": false,
"showAttachments": false,
"hideUnresolved": false,
"collapse-color-groups": true,
"colorGroups": [],
"collapse-display": false,
"showArrow": true,
"textFadeMultiplier": -2.6,
"nodeSizeMultiplier": 1,
"lineSizeMultiplier": 1,
"collapse-forces": true,
"centerStrength": 0.518713248970312,
"repelStrength": 10,
"linkStrength": 1,
"linkDistance": 250,
"scale": 1.5204648971557617,
"close": true
}
}
}
},
{
"id": "8c626ec87463284e",
"type": "leaf",
"state": {
"type": "backlink",
"state": {
"file": "README.md",
"collapseAll": false,
"extraContext": false,
"sortOrder": "alphabetical",
@ -103,7 +132,6 @@
"state": {
"type": "outgoing-link",
"state": {
"file": "README.md",
"linksCollapsed": false,
"unlinkedCollapsed": true
}
@ -116,27 +144,30 @@
"type": "tag",
"state": {
"sortOrder": "frequency",
"useHierarchy": true
"useHierarchy": false
}
}
},
}
]
},
{
"id": "a3d6ffbe49e6cc2b",
"type": "tabs",
"dimension": 52.76190476190477,
"children": [
{
"id": "30292489daefa915",
"type": "leaf",
"state": {
"type": "outline",
"state": {
"file": "README.md"
}
"state": {}
}
}
],
"currentTab": 3
]
}
],
"direction": "horizontal",
"width": 300,
"collapsed": true
"width": 300
},
"left-ribbon": {
"hiddenItems": {
@ -150,24 +181,38 @@
"random-note:Open random note": false
}
},
"active": "daf761d0297d992f",
"active": "32c3ce4c80742947",
"lastOpenFiles": [
"破解享乐的欲望牢笼.md",
"局域网共享文件方法.md",
"Vim Superpower.md",
"TODO模板.md",
"有关Godot和Lunarvim如何结合使用.md",
"linux安装与应用.md",
"Lunarvim.md",
"Linux Setup.md",
"lazygit.md",
"neovim.md",
"youtube.be/CPLdltN7wge.md",
"youtube.be",
"vim.md",
"Aseets/dev2.png~",
"WorldTreeModule.md",
"软件工程.md",
"GDShader.md",
"Think in UML.canvas",
"README.md",
"Git.md",
"Awesome window manager.md",
"局域网共享文件方法.md",
"Vim Superpower.md",
"Pasted image 20231008173544.png.md",
"Aseets/Procedure.jpeg",
"Godot GDScript Trick.md",
"Aseets/Pasted image 20231008173544.png",
"破解享乐的欲望牢笼.md",
"Aseets/vimEdit.png",
"ObsidianNotes/README.md",
"ObsidianNotes",
"Git.md",
"Godot GDScript Trick.md",
"Aseets/dev2.png",
"Awesome window manager.md",
"Aseets/Dev.png",
"Linux Setup.md",
"软件工程.md",
"Aseets/Procedure.jpeg",
"Ability.md",
"平铺式窗口管理软件.md",
"Aseets/85dbdd074d403555e95e832745425c43.jpeg",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 747 KiB

After

Width:  |  Height:  |  Size: 747 KiB

BIN
Aseets/vimEdit.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 KiB

31
GDShader.md Normal file
View File

@ -0,0 +1,31 @@
#GODOT
### 基础语法
``` glsl
// gdscript 如何传递数据给 material
ShaderMaterial.set_shader_parameter
// Shader 的 vertex 如何传递 worldPosition 给 fragment 使用
声明变量时不用uniform 而是用 varying
// 如何读取repeat的贴图 (如果是主贴图的话, 需要在导入设置或者在CanvasItem内的Texture中 选择 repeat)
uniform sampler2D noise : repeat_enable;
或者去fract uv 获得小数部分然后采样
// 如何uniform 一个可以编辑的颜色
uniform vec4 new_color : source_color = vec4(1,1,1,1);
// 如何uniform 一个range float
uniform float test: hint_range(0.0, 1.0, 0.1) = .5;
```
### Example : 顶点中获得世界坐标并传递给片元(2D)
``` glsl
varying vec2 worldPos;
void vertex() {
worldPos = (MODEL_MATRIX * vec4(VERTEX, 0.0, 1.0)).xy;
}
void fragment(){
//do some thing..
}
```
- [For More Detail Document](https://docs.godotengine.org/zh_CN/4.x/tutorials/shaders/shader_reference/index.html)

10
Git.md
View File

@ -2,14 +2,16 @@
每次都需要输入帐号密码的解决方案, 这个类似记住密码的功能吧
全局配置:
`git config --global credential.helper store`
> git config --global credential.helper store
当前仓库:
`git config credential.helper store
> git config credential.helper store
优先找当前, 然后找全局.
`git config --global user.name yogi
`git config --global user.email 1273750265@qq.com
> git config --global user.name yogi
>git config --global user.email 1273750265@qq.com
也有生成ssh 公 私钥的, 然后把公钥发到服务器的 .ssh 目录的对应文件内的... 但是我测试下来发现是失败的, 原因是因为我是一个类似 github 的仓库, 填入后没生效, 不确定是什么原因

40
Lunarvim.md Normal file
View File

@ -0,0 +1,40 @@
## 常用
- C + w + s or C + w + v 分屏
- `C+\`Terminal
- 窗口导航
- C + (hjkl)
- leader b 标签导航
- 退出
- leader + q
- :q
- leader + e 文件树
- leader s 搜索
- leader f 打开文件
- 搜索
- / 向后搜索, 其中 `\<value\>` 代表整词搜索
- ? 向前搜索
- :% 替换 :%s/搜索值/替换值/g 代表替换当前文档的所有搜索值为目标值 比如 :%s/a/b/g
- 搜索输入完毕后, 按回车, 然后按n 可以下一个
- 进入编辑模式可以用 i a o s O S C
- 但是还有实用的 A I 分别可以在尾行和首行插入
- 撤销与重做 u `<C+r>`
- 递进与回退 `<C+.>` `C+,>` 这里可以组合其他按键使用 比如组合键加数字键 但是这个组合键要按两次,不知道为啥
- 翻页可以用 `<C+d>` `<C+f` `<C+u>` `<C+b>`
> tips: 以上的 C 都是 Control 的意思 `<>`代表组合键
TreeSetter安装不同语言:
:TSInstall+tab 可以搜索自己想要安装的语言, 安装即可
:MarkdownPreview 实时在浏览器中浏览markdown
## Reference
[好用视频教程](https://www.youtube.com/watch?v=l-P6COY7GeQ)
lazygit 挺好用
[vim 快捷键](https://devhints.io/vim)
[Lunarvim 特殊快捷键](https://www.lunarvim.org/zh-Hans/docs/master/beginners-guide/keybinds-overview)
[有关Godot和Lunarvim如何结合使用](有关Godot和Lunarvim如何结合使用.md)

View File

@ -1,5 +1,7 @@
# ObsidianNotes
此仓库是我的Obsidina笔记的第二个仓库, 前一个仓库在坚果云里面, 但是那个有下载限制, 于是我直接把新仓库做到了我这个私人服务器中.
此仓库是我的 Obsidian 笔记的第二个仓库, 前一个仓库在坚果云里面, 但是那个有下载限制, 于是我直接把新仓库做到了我这个私人服务器中.
使用方法就是下载完毕后, 使用 Obsidian 打开这个文件夹即可
使用方法就是下载完毕后, 使用Obisidan打开这个文件夹即可

View File

@ -4,36 +4,36 @@
{"id":"f7a5a05e3b3adbee","type":"group","x":-880,"y":-360,"width":907,"height":1440,"label":"基于顺序流程开发 (面向流程开发)"},
{"id":"01381dfb0d849945","type":"group","x":177,"y":120,"width":707,"height":180,"label":"节点(对象)"},
{"id":"5598149665daee13","type":"group","x":-96,"y":-840,"width":246,"height":380,"label":"现实因果"},
{"id":"3dd7047c8798b5be","type":"text","text":"因","x":98,"y":-320,"width":67,"height":60},
{"id":"e55941a9e3bc5761","type":"text","text":"节点A","x":218,"y":-100,"width":111,"height":60},
{"id":"e151bed3b296b893","type":"file","file":"WorldTreeModule.md","x":2080,"y":-352,"width":1120,"height":2132},
{"id":"43c25dad51fed755","type":"text","text":"## 流程划分\n- 进入游戏\n- 新建存档\n- 配置角色存档\n- 读取存档\n- 进入主场景\n- 打开战斗场景\n- 关闭战斗场景\n- 退出主场景\n- 写入存档\n- 游戏结束","x":1760,"y":-352,"width":192,"height":363},
{"id":"c38d1a12d50745c6","type":"text","text":"## 大地图解决方案\n\n## 必做方案\n- 从美术那里获得`大地图`(比如一个种族的地图)\n- 程序切图变成`小地图`且批量命名\n\n### 普通 2D 方案\n- 详情参考`2DPathFindExample'\n- 配置流产\n\t- 一张`小地图` 可以作为一个 `场景` 使用\n\t- 每个场景中, 配置 `物理碰撞` `AI寻路` `城池` `副本` 等等\n- 此做法类似我们早期使用Unity实现的方法思路, 但是他有更方便的 2D 功能\n#### 优劣分析\n- 优: 自定义能力极强\n- 劣: 相比较其他方案, 批量修改处理不易\n- 劣: 相比较其他方案, 需要实现大地图编辑器, 从而实现游戏内配置, 方便进行直观的配置 (运行增删查改, 动态加载等等)\n\n### Tile Map方案\n- 详情参考 `TileMapExample`\n- 配置流程\n\t- (笔刷) 先配置 每个网格资源 本身的属性 (比如 可以AI导航区域, 碰撞区域, 颜色, 材质, 高度 等等)\n\t- (底色) 用`小地图`做背景\n\t- (画图) 再在把网格刷在地图上\n- 网格中的物体: 1. 可交互 2.可挡路 3.可以动态消失和增加\n\n### 优劣分析\n- 优: 性能不错, 我测试下来性能可以接受\n- 劣: Godot在编辑时, 有可能会闪退 具体原因不明\n- 劣: 因为是基于网格的, 所以具体的网格都是以格子为基准的, 比如 \"材质\" \"高度\" \"导航区域\" \"碰撞区域\". 没有其他方式的那种自定义的方式自由 (必须是格子图)\n","x":3280,"y":-352,"width":960,"height":1090},
{"id":"56c4798c604b529d","type":"text","text":"## Route Map\n- 游戏框架分析\n- 代码架构分析\n- 游戏模块分析\n- 游戏模块 UML 图制作\n- 代码实现\n\t- 大地图解决方案\n\t- 战斗模块\n\t\t- 战斗模块配置功能(能力与效果)\n\t- 存档初始化模块\n\t- 大地图模块\n","x":1203,"y":-352,"width":517,"height":732},
{"id":"7dc171478dd606af","type":"text","text":"战斗角色是使用的回合计数\n大地图角色使用时间计数\n\n是否可以\n战斗时 时间暂停\n一个回合结束时, 增加对应游戏时间\n(这样会有一些意想不到的效果, 比如当前回合结束后, 刚好经过了一天, 一天一时间一过, 角色某个效果会触发, 比如回复满血)","x":1308,"y":420,"width":412,"height":300},
{"id":"c33ab99b87004926","type":"text","text":"果","x":898,"y":-320,"width":67,"height":60},
{"id":"4ae0834068c8c432","type":"text","text":"封装/特性/继承/聚合/多态","x":584,"y":220,"width":280,"height":50},
{"id":"6ecc964c9042cafe","type":"text","text":"结果","x":744,"y":140,"width":120,"height":50},
{"id":"02979079622fc748","type":"text","text":"节点D","x":731,"y":-100,"width":111,"height":60},
{"id":"be3e0105f3877ef9","type":"text","text":"- 对象眼界狭窄, 只关心和自己相关的几个对象, 不关心和自己无关的\n- 没有特性的可以称之为类, 被赋予特性后, 可以被称之为实例\n- 需求发生改变时, 一般是直接新增类. 不会大幅度的影响其他对象.\n- 举例\n\t- 面向对象就像是把建造一辆车这个目标, 分解成建造每一个零部件后组装\n\t- 当车辆更新换代的时候, 用于组装的类会发生变更(可以重载或是继承), 也会新增一些新的对象类型(同样可以是继承和承载)","x":233,"y":660,"width":583,"height":260},
{"id":"b78f0a5a2d476e66","type":"text","text":"``` python\nfunc main(i)\n\ta = nodeA.do(i)\n\tb = nodeB.do(a)\n\te = nodeE.do(a)\n\tf = nodeF.do(b,a,e)\n\tc = nodeC.do(b)\n\to = nodeD.do(c,f)\n\treturn o\n```","x":233,"y":360,"width":583,"height":280},
{"id":"ccc50c45875e8121","type":"text","text":"节点F","x":550,"y":-45,"width":111,"height":60},
{"id":"baeb4b1fe957ac3e","type":"text","text":"节点C","x":550,"y":-175,"width":111,"height":60},
{"id":"6e4257fdd05e9ae8","type":"text","text":"功能计算","x":444,"y":140,"width":160,"height":50},
{"id":"7aab729a19843255","type":"text","text":"节点B","x":358,"y":-175,"width":111,"height":60},
{"id":"301c14f628e0d44e","type":"text","text":"节点E","x":390,"y":15,"width":111,"height":60},
{"id":"67cc784857841adc","type":"text","text":"特性","x":320,"y":220,"width":160,"height":50},
{"id":"e55941a9e3bc5761","type":"text","text":"节点A","x":218,"y":-100,"width":111,"height":60},
{"id":"6cd0aa5fd7e08b73","type":"text","text":"数据","x":197,"y":140,"width":131,"height":50},
{"id":"3dd7047c8798b5be","type":"text","text":"因","x":98,"y":-320,"width":67,"height":60},
{"id":"1e71eae3e8ab4dd7","type":"text","text":"果","x":44,"y":-540,"width":67,"height":60},
{"id":"20e8d9b9baff4d3d","type":"text","text":"因","x":-76,"y":-540,"width":67,"height":60},
{"id":"a1a7be26d20eaca1","type":"text","text":"抽象","x":-19,"y":-660,"width":96,"height":29},
{"id":"3749392e088d5fa1","type":"text","text":"现实","x":-19,"y":-820,"width":96,"height":29},
{"id":"4ae0834068c8c432","type":"text","text":"封装/特性/继承/聚合/多态","x":584,"y":220,"width":280,"height":50},
{"id":"6cd0aa5fd7e08b73","type":"text","text":"数据","x":197,"y":140,"width":131,"height":50},
{"id":"be3e0105f3877ef9","type":"text","text":"- 对象眼界狭窄, 只关心和自己相关的几个对象, 不关心和自己无关的\n- 没有特性的可以称之为类, 被赋予特性后, 可以被称之为实例\n- 需求发生改变时, 一般是直接新增类. 不会大幅度的影响其他对象.\n- 举例\n\t- 面向对象就像是把建造一辆车这个目标, 分解成建造每一个零部件后组装\n\t- 当车辆更新换代的时候, 用于组装的类会发生变更(可以重载或是继承), 也会新增一些新的对象类型(同样可以是继承和承载)","x":233,"y":660,"width":583,"height":260},
{"id":"ccc50c45875e8121","type":"text","text":"节点F","x":550,"y":-45,"width":111,"height":60},
{"id":"6ecc964c9042cafe","type":"text","text":"结果","x":744,"y":140,"width":120,"height":50},
{"id":"6e4257fdd05e9ae8","type":"text","text":"功能计算","x":444,"y":140,"width":160,"height":50},
{"id":"301c14f628e0d44e","type":"text","text":"节点E","x":390,"y":15,"width":111,"height":60},
{"id":"56c4798c604b529d","type":"text","text":"## Route Map\n- 游戏框架分析\n- 代码架构分析\n- 游戏模块分析\n- 游戏模块 UML 图制作\n- 代码实现\n\t- 大地图解决方案\n\t- 战斗模块\n\t\t- 战斗模块配置功能(能力与效果)\n\t- 存档初始化模块\n\t- 大地图模块\n","x":1203,"y":-352,"width":517,"height":732},
{"id":"7dc171478dd606af","type":"text","text":"战斗角色是使用的回合计数\n大地图角色使用时间计数\n\n是否可以\n战斗时 时间暂停\n一个回合结束时, 增加对应游戏时间\n(这样会有一些意想不到的效果, 比如当前回合结束后, 刚好经过了一天, 一天一时间一过, 角色某个效果会触发, 比如回复满血)","x":1308,"y":420,"width":412,"height":300},
{"id":"43c25dad51fed755","type":"text","text":"## 流程划分\n- 进入游戏\n- 新建存档\n- 配置角色存档\n- 读取存档\n- 进入主场景\n- 打开战斗场景\n- 关闭战斗场景\n- 退出主场景\n- 写入存档\n- 游戏结束","x":1760,"y":-352,"width":192,"height":363},
{"id":"c202cf6940c88b13","type":"text","text":"## 模块划分\n- 流程模块(状态机)\n\t- 游戏初始化\n\t- 存档配置流程\n\t- 游戏时间流程\n- 资源模块(读写模块)\n\t- 读取指定路径下的场景文件\n\t- 保存到执行路径下的对应文件位置\n- 存档模块(对存档进行 增删改查)\n\t- 游戏设置存档结构 (分辨率,画质,特效等级 etc...)\n\t- 游戏存档结构\n\t\t- 角色信息\n\t\t- 任务信息\n\t\t- 时间信息\n\t\t- 大地图信息\n\t- 读取存档后, 对存档进行处理\n\t- 写入存档时, 对存档进行处理\n- 场景模块(对场景进行切换)\n\t- 加载场景\n\t- 删除场景\n\t- 切换场景(删除与加载同时进行)\n\t- 场景分级 (对场景树进行管理)\n- 标签模块\n\t- 角色标签,技能标签,效果标签等标签 (主要是字符串)\n\t- 标签需要可以进行检测判断(包含,不包含,必须包含,必须不包含)\n\t- 标签需要方便配置(标签的配置工具)\n\t- 标签需要方便在脚本中使用 (标签配置导出标签常量类 方便调用)\n- 游戏时间模块\n\t- 现实 总时间 统计\n\t- 现实 战斗时间 统计\n\t- 游戏 时间 累加\n\t- 游戏 战斗回合 累加\n- 任务模块\n\t- 接任务\n\t- 交任务\n\t- 任务链(任务依赖)\n\t- 任务监听\n- 大地图模块\n\t- 配置模块(这里我打算使用 Godot 中的 Tilemap 进行配置), 后期可以把配置表导出成文本方便调试与修改\n\t- 角色与摄像机大地图移动功能(碰撞与层级与检测)\n\t- 大地图动态(增删改查)\n\t- 基于游戏时间进行动态变更\n- 战斗模块\n\t- 角色\n\t\t- 属性\n\t\t- 常用方法\n\t- 能力\n\t\t- 能力的脚本继承, 能力功能实现 (触发特效 或 特殊判断条件)\n\t\t- 配置能力属性(CD, 消耗等)\n\t\t- 对指定角色添加与删除效果 (添加灼伤buff等)\n\t- 效果\n\t\t- 效果的脚本继承,状态功能实现 (修改属性或触发特效)\n\t\t- 配置效果属性(持续时间, 间隔时间等)\n\t\t- 对角色产生效果的常用方法(添加血量上限等)\n\t- 战斗数据\n\t\t- 战斗网格\n\t\t- 战斗角色\n\t- 战斗回合切换\n\t\t- 回合匹配\n- AI模块(敌人AI)\n\t- blackboard数据\n\t- AI行为树\n\t- 行为树配置功能\n- 角色配置模块 (配置基础属性, 能力, 掉落ID)\n\t- NPC\n\t- 敌人\n\t- 自身\n- 掉落模块(ID 关联, 有嵌套)\n- 常量配置表\n\t- 资源路径配置(UI路径, 场景路径, 角色路径, 技能路径, 效果路径)\n- 全局事件模块\n\t- 全局的各种事件触发 (玩家选择角色, 玩家选择地面, 进入战斗事件等)\n- UI模块\n\t- 监听游戏中不同数据的变化\n\t- 打开与关闭UI\n\t- 触发不同特效\n- 本地化模块\n\t- 翻译功能(表)\n","x":2080,"y":-352,"width":1120,"height":2132},
{"id":"c38d1a12d50745c6","type":"text","text":"## 大地图解决方案\n\n## 必做方案\n- 从美术那里获得`大地图`(比如一个种族的地图)\n- 程序切图变成`小地图`且批量命名\n\n### 普通 2D 方案\n- 详情参考`2DPathFindExample'\n- 配置流产\n\t- 一张`小地图` 可以作为一个 `场景` 使用\n\t- 每个场景中, 配置 `物理碰撞` `AI寻路` `城池` `副本` 等等\n- 此做法类似我们早期使用Unity实现的方法思路, 但是他有更方便的 2D 功能\n#### 优劣分析\n- 优: 自定义能力极强\n- 劣: 相比较其他方案, 批量修改处理不易\n- 劣: 相比较其他方案, 需要实现大地图编辑器, 从而实现游戏内配置, 方便进行直观的配置 (运行增删查改, 动态加载等等)\n\n### Tile Map方案\n- 详情参考 `TileMapExample`\n- 配置流程\n\t- (笔刷) 先配置 每个网格资源 本身的属性 (比如 可以AI导航区域, 碰撞区域, 颜色, 材质, 高度 等等)\n\t- (底色) 用`小地图`做背景\n\t- (画图) 再在把网格刷在地图上\n- 网格中的物体: 1. 可交互 2.可挡路 3.可以动态消失和增加\n\n### 优劣分析\n- 优: 性能不错, 我测试下来性能可以接受\n- 劣: Godot在编辑时, 有可能会闪退 具体原因不明\n- 劣: 因为是基于网格的, 所以具体的网格都是以格子为基准的, 比如 \"材质\" \"高度\" \"导航区域\" \"碰撞区域\". 没有其他方式的那种自定义的方式自由 (必须是格子图)\n","x":3280,"y":-352,"width":960,"height":1090},
{"id":"02979079622fc748","type":"text","text":"节点D","x":731,"y":-100,"width":111,"height":60},
{"id":"baeb4b1fe957ac3e","type":"text","text":"节点C","x":550,"y":-175,"width":111,"height":60},
{"id":"7aab729a19843255","type":"text","text":"节点B","x":358,"y":-175,"width":111,"height":60},
{"id":"2f08f916dda4c384","type":"file","file":"Aseets/Procedure.jpeg","x":-731,"y":470,"width":586,"height":550},
{"id":"a58cc0223dab5c53","type":"text","text":"- 依赖关系\n- 固定流程\n- 需求变更时, 不容易修改\n- 随着需求发生变化, 节点的复杂度和因果关系也会大幅度变化\n- 举例\n\t- 面向流程就像一次性把建造一辆车设定成目标, 然后分析整个流产的线路, 使得这个产线能一次性就把车生产出来\n\t- 而车辆会随时更新换代, 所以车的管线也会经常大改, 每次大改都会伤筋动骨","x":-731,"y":95,"width":583,"height":285},
{"id":"4d32b080f139a489","type":"text","text":"因","x":-728,"y":-338,"width":67,"height":60},
{"id":"150aa8c33533e9d6","type":"text","text":"果","x":-215,"y":-335,"width":67,"height":60},
{"id":"a86a7ac36ae3f4f0","type":"text","text":"``` python\nfunc main(i)\n\ta = get(i)\n\tb = ClacA(a)\n\te = ClacE(a)\n\tf = CalcF(b,a,e)\n\tc = CalcC(b)\n\to = CalcO(c,f)\n\treturn o\n\n# 需求变更时, 新写方法, 插入/删除流程\n```","x":-728,"y":-245,"width":583,"height":285},
{"id":"a5b1c2cce5f1efbb","type":"text","text":"功能计算","x":-519,"y":-333,"width":160,"height":50}
{"id":"a5b1c2cce5f1efbb","type":"text","text":"功能计算","x":-519,"y":-333,"width":160,"height":50},
{"id":"2f08f916dda4c384","type":"file","file":"Aseets/Procedure.jpeg","x":-731,"y":470,"width":586,"height":550},
{"id":"a58cc0223dab5c53","type":"text","text":"- 依赖关系\n- 固定流程\n- 需求变更时, 不容易修改\n- 随着需求发生变化, 节点的复杂度和因果关系也会大幅度变化\n- 举例\n\t- 面向流程就像一次性把建造一辆车设定成目标, 然后分析整个流产的线路, 使得这个产线能一次性就把车生产出来\n\t- 而车辆会随时更新换代, 所以车的管线也会经常大改, 每次大改都会伤筋动骨","x":-731,"y":95,"width":583,"height":285},
{"id":"4d32b080f139a489","type":"text","text":"因","x":-728,"y":-338,"width":67,"height":60}
],
"edges":[
{"id":"c0b4be46a6f0aeb1","fromNode":"3749392e088d5fa1","fromSide":"bottom","toNode":"a1a7be26d20eaca1","toSide":"top"},

View File

@ -1,2 +1,2 @@
Vim 从入门到精通
https://www.cnblogs.com/lijia0511/p/5644566.html
https://www.cnblogs.com/lijia0511/p/5644566.html

97
WorldTreeModule.md Normal file
View File

@ -0,0 +1,97 @@
#worldtree
## 模块划分
- 流程模块(状态机)
- 游戏初始化
- 存档配置流程
- 游戏时间流程
- 资源模块(读写模块)
- 读取指定路径下的场景文件
- 保存到执行路径下的对应文件位置
- 存档模块(对存档进行 增删改查)
- 游戏设置存档结构 (分辨率,画质,特效等级 etc...)
- 游戏存档结构
- 角色信息
- 任务信息
- 时间信息
- 大地图信息
- 读取存档后, 对存档进行处理
- 写入存档时, 对存档进行处理
- 场景模块(对场景进行切换)
- 加载场景
- 删除场景
- 切换场景(删除与加载同时进行)
- 场景分级 (对场景树进行管理)
- 标签模块
- 角色标签,技能标签,效果标签等标签 (主要是字符串)
- 标签需要可以进行检测判断(包含,不包含,必须包含,必须不包含)
- 标签需要方便配置(标签的配置工具)
- 标签需要方便在脚本中使用 (标签配置导出标签常量类 方便调用)
- 游戏时间模块
- 现实 总时间 统计
- 现实 战斗时间 统计
- 游戏 时间 累加
- 游戏 战斗回合 累加
- 任务模块
- 接任务
- 交任务
- 任务链(任务依赖)
- 任务监听
- 大地图模块
- 配置模块, 后期可以把配置表导出成文本方便调试与修改
- 角色与摄像机大地图移动功能(碰撞与层级与检测)
- 大地图动态(增删改查)
- 基于游戏时间进行动态变更
- 区域配置
- 画区域
- 配置区域类型
- 地形
- 森林 移速-0.3
- 丘陵 移速-0.5
- 山脉 移速-0.5 + 需要天赋才能移动
- 海洋 只有船只才能移动
- 事件
- 如果事件可能包含战斗,那么从怪物区域中取得对应的怪物数据, 如果当前不在怪物区域,那么说明配置有误
- Tag:陆地/海洋, 战斗/探索/奇遇
- 名字+描述+备注
- n*选项
- 消耗
- 结果
- 概率触发
- 怪物区域
- 名称+等级+n*种类
- 战斗模块
- 角色
- 属性
- 常用方法
- 能力
- 能力的脚本继承, 能力功能实现 (触发特效 或 特殊判断条件)
- 配置能力属性(CD, 消耗等)
- 对指定角色添加与删除效果 (添加灼伤buff等)
- 效果
- 效果的脚本继承,状态功能实现 (修改属性或触发特效)
- 配置效果属性(持续时间, 间隔时间等)
- 对角色产生效果的常用方法(添加血量上限等)
- 战斗数据
- 战斗网格
- 战斗角色
- 战斗回合切换
- 回合匹配
- AI模块(敌人AI)
- blackboard数据
- AI行为树
- 行为树配置功能
- 角色配置模块 (配置基础属性, 能力, 掉落ID)
- NPC
- 敌人
- 自身
- 掉落模块(ID 关联, 有嵌套)
- 常量配置表
- 资源路径配置(UI路径, 场景路径, 角色路径, 技能路径, 效果路径)
- 全局事件模块
- 全局的各种事件触发 (玩家选择角色, 玩家选择地面, 进入战斗事件等)
- UI模块
- 监听游戏中不同数据的变化
- 打开与关闭UI
- 触发不同特效
- 本地化模块
- 翻译功能(表)

4
lazygit.md Normal file
View File

@ -0,0 +1,4 @@
可以按?打开快捷方式的keymap
>[Lazygit tutorial](https://www.youtube.com/watch?v=hwC4JduRHyg)
>[lunavim + lazygit 教程](https://www.youtube.com/watch?v=l-P6COY7GeQ)
>[github 仓库](https://github.com/jesseduffield/lazygit)

93
linux安装与应用.md Normal file
View File

@ -0,0 +1,93 @@
## 问题:
ubuntu 我解压了 nvim程序后, 如何让他可以用指令直接生效
## 答案:
要让解压后的 Neovim通常缩写为 nvim程序可以通过命令行直接启动你可以将它的可执行文件添加到系统的 PATH 环境变量中,或者创建一个符号链接到一个目录在 PATH 中。
以下是两种方法中的一种,你可以根据个人喜好选择其中一种:
**方法一:将可执行文件添加到 PATH 环境变量**
1. 打开一个终端窗口。
2. 使用 `cd` 命令导航到解压后 Neovim 可执行文件所在的目录。
例如,如果你解压了 Neovim 到 `/home/你的用户名/nvim`,你可以使用以下命令:
```shell
cd /home/你的用户名/nvim
```
3. 确保可执行文件在当前目录中,你可以运行 `ls` 命令检查。
4. 现在,你可以使用以下命令将当前目录添加到 PATH 环境变量中:
```shell
export PATH=$PATH:$(pwd)
```
这会将当前目录添加到 PATH 中,使得系统可以找到 Neovim 可执行文件。
5. 为了使这个更改永久生效,你可以将上述命令添加到你的 shell 配置文件中,如 `~/.bashrc``~/.zshrc`,这样每次登录时都会自动加载。
**方法二:创建符号链接**
1. 打开一个终端窗口。
2. 使用 `cd` 命令导航到解压后 Neovim 可执行文件所在的目录,就像方法一中一样。
3. 使用以下命令创建一个符号链接到一个在 PATH 中的目录,比如 `/usr/local/bin`
```shell
sudo ln -s $(pwd)/nvim /usr/local/bin/nvim
```
这将在 `/usr/local/bin` 目录中创建一个名为 `nvim` 的符号链接,使得你可以通过 `nvim` 命令启动 Neovim。
现在,你应该能够在终端中直接使用 `nvim` 命令启动 Neovim 编辑器了。请注意,你需要适当替换命令中的路径和用户名。
## 别名
### Bash
打开配置(bash) 如果是zsh是另一个
```Shell
lvim ~/.bashrc
```
```shell
# 配置别名
alias cd_worldtree='cd ~/Projects/WorldTree/'
```
刷新
```Shell
source ~/.bashrc
```
## zsh
```shell
lvim ~/.zshrc
```
```
alias _worldtree="cd ~/Projects/WorldTree/"
```
```shell
source ~/.zshrc
```
### 我的别名配置
```shell
# 我的别名配置
# 常用指令
alias v='lvim'
alias g='lazygit'
alias x='exit'
# 指令结合路径
alias v_bashrc='v ~/.bashrc'
alias v_worldtree='v ~/Projects/WorldTree/'
alias cd_worldtree='cd ~/Projects/WorldTree/'
# 程序快捷方式
alias _godot='~/Software/Godot/Godot4'
# 指令组合
alias _work='godot | lvim_worldtree'
```

19
neovim.md Normal file
View File

@ -0,0 +1,19 @@
## 常用快捷键:
- / 搜索
- super nh 取消搜索高亮
- super sv 或 super sh 水平or垂直分屏
- 自动补全
- ctrl + b or ctrl + f 翻页
- ctrl + e 取消自动补全
- 添加新的语法服务使用 :Mason 然后/搜索 选择后按i 安装
## 个性化快捷键:
- Visual模式
- 选中后 J K 多行移动
- normal
- super nh 取消搜索高亮
- 文档
- super e 展开文档tree
- tab预览 or 回车打开
## Reference
https://www.bilibili.com/video/BV1Td4y1578E/?spm_id_from=333.337.search-card.all.click&vd_source=ba468568caebc92479698e83c28be8b0

97
vim.md Normal file
View File

@ -0,0 +1,97 @@
# Vim
少数派 obsidian vim config
https://sspai.com/post/78030
bilibili vim 收藏夹
vscode + vim
https://www.bilibili.com/video/BV1z541177Jy?p=5&vd_source=ba468568caebc92479698e83c28be8b0
## 切换模式
- ecs 退出到普通模式
- v visual
- 进入编辑模式
- i/I Insert
- a/A Append
- o/O One line
- : 命令模式
## 指针移动
- i j k l 移动
- b w
https://github.com/ahrencode/Miscellaneous/blob/master/vim-cheatsheet.pdf
![[vimEdit.png]]
## 普通模式:操作符 + 动作
## 可组合操作符号
- d delete 剪切
- c change 剪切并进入编辑模式
- y yank 复制
- v visual 选中并进入 visual mode
## 动作
- i inner 内置 比如 i"选中 a"Test"b 中的 Test
- a around 包含内置字符和包含符号 比如a" a"Test"b 中的"Test"
- iw 选中单词
- i( 选中括号内的
- a( 选中括号和括号内的
- gu 小写
- gU 大写
## 组合3(可组合操作符+动作)
- ciw change inner world 剪切光标所在的单词 然后进入编辑模式
- diw delete inner world 删除光标所在的单词
- ci< change inner <
- ci( change inner ( 修改括号内的字符
- da< delete around <
- yi(/yib yank inner brackets 复制小括号内的字符
- yi{/yiB yank inner brackets 复制大括号内的字符
- `ca[` change around `[` 剪切中括号和中括号内的字符 然后进入编辑模式
- die delete inner entire 删除全部
- viw 选中单词 然后 d 可以删除
- 总结
- 操作符 + i/w/f + 特殊符号
## 不可组合操作符
- yy 复制一行
- dd 剪切一行
- p 粘帖
- u 撤销
- C+r Redo
- m+字符 标签
- ``+字符` 跳转到标签
- ~ 字符大小写切换
- guu 行小写
- gUU 行大写
- gd go define
- ctrl + o 回到上个指针所在位置
- gh go hover 鼠标悬浮 显示代码Tips提示
- gt go tag 向后标签 4gt向后4个标签...
- gT go Tag 向前标签
- Contrl + 0 跳转到左侧标签(VSCode) 然后 jk 可以上下选择文件 space展开 enter/l 编辑
### 重复命令
- 2dd 删除两行
- 2gg 跳转到index为2的行
- 其他类似
### 组合2
- 操作符 + w/b/p
## VsCode中
### 多指针
### surround
- s surround 包含符号 比如 s" a"Test"b 选中 ""
- ysiw + 符号 可以把词用双引号套住 我不明白为什么可以 但是就是可以
### 打开VimSetting中的 vim.easymotion 的话
然后设置 vim.leader 可以设置 `<leader>` 键位
可以类似ChromePlugin的Vim一样, 用一些快捷键直接跳转到字符
具体其他指令可以在 Vim 插件的readme中找到, 这里我只写我常用的
我把 leader 键位设置成了 空格
- 空 + 空 + w 向后跳转到词头
- 空 + 空 + b 向前跳转到词头
- 空 + 空 + e 向后跳转到词尾
- 空 + 空 + j 向上跳转到行
- 空 + 空 + k 向下跳转到行
- 空 + 空 + f + 字母 向下搜索
- 空 + 空 + F + 字母 向上搜索
具体看: https://github.com/VSCodeVim/Vim

View File

View File

@ -0,0 +1,91 @@
```shell
lvim ~/.config/lvim/config.lua
```
```lua
-- Read the docs: https://www.lunarvim.org/docs/configuration
-- Video Tutorials: https://www.youtube.com/watch?v=sFA9kX-Ud_c&list=PLhoH5vyxr6QqGu0i7tt_XoVK9v-KvZ3m6
-- Forum: https://www.reddit.com/r/lunarvim/
-- Discord: https://discord.com/invite/Xb9B4Ny
-- Disable use space to instead of tab
vim.o.expandtab = false
-- DAP configuration
local dap = require('dap')
dap.adapters.godot = {
type = "server",
host = '127.0.0.1',
port = 6006,
}
dap.configurations.gdscript = {
{
type = "godot",
request = "launch",
name = "Launch scene",
project = "${workspaceFolder}",
launch_scene = true,
}
}
-- LSP Mappings.
-- See `:help vim.diagnostic.*` for documentation on any of the below functions
local opts = { noremap=true, silent=true }
vim.keymap.set('n', '<space>e', vim.diagnostic.open_float, opts)
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts)
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts)
vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist, opts)
-- Use an on_attach function to only map the following keys
-- after the language server attaches to the current buffer
local on_attach = function(client, bufnr)
-- Enable completion triggered by <c-x><c-o>
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
-- Mappings.
-- See `:help vim.lsp.*` for documentation on any of the below functions
local bufopts = { noremap=true, silent=true, buffer=bufnr }
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts)
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts)
vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts)
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts)
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, bufopts)
vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, bufopts)
vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, bufopts)
vim.keymap.set('n', '<space>wl', function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end, bufopts)
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, bufopts)
vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, bufopts)
vim.keymap.set('n', '<space>ca', vim.lsp.buf.code_action, bufopts)
vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts)
vim.keymap.set('n', '<space>f', function() vim.lsp.buf.format { async = true } end, bufopts)
local _notify = client.notify
client.notify = function (method, params)
if method == 'textDocument/didClose' then
-- Godot doesn't implement didClose yet
return
end
_notify(method, params)
end
end
-- LSP Config for Godot
local lsp_flags = {
-- This is the default in Nvim 0.7+
debounce_text_changes = 150,
}
require'lspconfig'.gdscript.setup{
on_attach = on_attach,
flags = lsp_flags,
filetypes = { "gd", "gdscript", "gdscript3" },
}
```
[有关Godot和Lunarvim如何结合使用](https://github.com/LunarVim/LunarVim/issues/3292#issuecomment-1754531163)

View File

@ -29,4 +29,8 @@
9. 减少触发的钩子(在物理层面减少容易接触到的浪费时间的入口, 比如手机上的App 等):
- 尝试把手机上的, 电脑上的, 容易获得的浪费时间的入口给移除, 从而让自己不那么容易立即满足
最重要的是,要明白破解享乐的欲望牢笼是一个长期的过程,需要耐心和坚定的决心。不要期望立刻就能彻底改变,但通过逐步采取这些方法,你可以渐渐减少享乐欲望的影响,更有目的地追求更有意义的生活。如果觉得无法自行控制享乐欲望,不妨寻求专业心理咨询的帮助。
最重要的是,要明白破解享乐的欲望牢笼是一个长期的过程,需要耐心和坚定的决心。不要期望立刻就能彻底改变,但通过逐步采取这些方法,你可以渐渐减少享乐欲望的影响,更有目的地追求更有意义的生活。如果觉得无法自行控制享乐欲望,不妨寻求专业心理咨询的帮助。
## 我的回答
1. 要有事情干
2. 要是对自己未来有好处的事情