1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 13:40:05 +08:00

Compare commits

...

3 Commits

Author SHA1 Message Date
Eric Wong
b0aa79433a docs(zettelkasten): update readme 2024-12-18 00:46:21 +08:00
Eric Wong
97c166de11 ci(zettelkasten): detact zettelkasten syntax file 2024-12-18 00:37:25 +08:00
Eric Wong
40ea34694d feat(tabs): add tabs key bindings
- `SPC F d`: close current tab
- `SPC F D`: close other tabs
- `SPC F n`: create a new tab
2024-12-17 22:19:53 +08:00
8 changed files with 121 additions and 26 deletions

View File

@ -393,6 +393,9 @@ EOT
_detact_bundle vim-zettelkasten doc/vim-zettelkasten.txt _detact_bundle vim-zettelkasten doc/vim-zettelkasten.txt
_checkdir ftdetect _checkdir ftdetect
_detact_bundle vim-zettelkasten ftdetect/zettelkasten.lua _detact_bundle vim-zettelkasten ftdetect/zettelkasten.lua
_checkdir syntax
_detact_bundle vim-zettelkasten syntax/zkbrowser.vim
_detact_bundle vim-zettelkasten syntax/zktagstree.vim
_checkdir ftplugin _checkdir ftplugin
_detact_bundle vim-zettelkasten ftplugin/markdown.lua _detact_bundle vim-zettelkasten ftplugin/markdown.lua
_detact_bundle vim-zettelkasten ftplugin/zkbrowser.lua _detact_bundle vim-zettelkasten ftplugin/zkbrowser.lua

View File

@ -1768,6 +1768,7 @@ let g:_spacevim_mappings_space.l = {'name' : '+Language Specified'}
let g:_spacevim_mappings_space.s = {'name' : '+Searching/Symbol'} let g:_spacevim_mappings_space.s = {'name' : '+Searching/Symbol'}
let g:_spacevim_mappings_space.r = {'name' : '+Registers/rings/resume'} let g:_spacevim_mappings_space.r = {'name' : '+Registers/rings/resume'}
let g:_spacevim_mappings_space.d = {'name' : '+Debug'} let g:_spacevim_mappings_space.d = {'name' : '+Debug'}
let g:_spacevim_mappings_space.F = {'name' : '+Tabs'}
let g:_spacevim_mappings_space.e = {'name' : '+Errors/Encoding'} let g:_spacevim_mappings_space.e = {'name' : '+Errors/Encoding'}
let g:_spacevim_mappings_space.B = {'name' : '+Global buffers'} let g:_spacevim_mappings_space.B = {'name' : '+Global buffers'}
let g:_spacevim_mappings_space.f.v = {'name' : '+Vim/SpaceVim'} let g:_spacevim_mappings_space.f.v = {'name' : '+Vim/SpaceVim'}

View File

@ -68,7 +68,7 @@ let s:filename = expand('<sfile>:~')
let s:lnum = expand('<slnum>') + 2 let s:lnum = expand('<slnum>') + 2
function! SpaceVim#layers#foldsearch#config() function! SpaceVim#layers#foldsearch#config()
let g:_spacevim_mappings_space.F = {'name' : '+Foldsearch'} let g:_spacevim_mappings_space.F.name = '+Foldsearch/Tabs'
let lnum = expand('<slnum>') + s:lnum - 1 let lnum = expand('<slnum>') + s:lnum - 1
call SpaceVim#mapping#space#def('nnoremap', ['F', 'w'], 'call call(' call SpaceVim#mapping#space#def('nnoremap', ['F', 'w'], 'call call('
\ . string(s:_function('s:foldsearch_word')) . ', [])', \ . string(s:_function('s:foldsearch_word')) . ', [])',

View File

@ -643,6 +643,38 @@ function! SpaceVim#mapping#space#init() abort
call SpaceVim#mapping#space#def('nnoremap', ['s', 'c'], 'call SpaceVim#plugins#searcher#clear()', call SpaceVim#mapping#space#def('nnoremap', ['s', 'c'], 'call SpaceVim#plugins#searcher#clear()',
\ 'clear-search-results', 1) \ 'clear-search-results', 1)
" Tab key bindings:
let s:lnum = expand('<slnum>') + s:funcbeginline
call SpaceVim#mapping#space#def('nnoremap', ['F', 'D'], 'tabonly',
\ ['close-other-tabs',
\ [
\ 'SPC F D is to close all of other tabs',
\ '',
\ 'Definition: ' . s:file . ':' . s:lnum,
\ ]
\ ],
\ 1)
let s:lnum = expand('<slnum>') + s:funcbeginline
call SpaceVim#mapping#space#def('nnoremap', ['F', 'n'], 'tabnew',
\ ['create-new-tab',
\ [
\ 'SPC F D is to create a new tab',
\ '',
\ 'Definition: ' . s:file . ':' . s:lnum,
\ ]
\ ],
\ 1)
let s:lnum = expand('<slnum>') + s:funcbeginline
call SpaceVim#mapping#space#def('nnoremap', ['F', 'd'], 'tabclose',
\ ['close-current-tab',
\ [
\ 'SPC F D is to close current tab',
\ '',
\ 'Definition: ' . s:file . ':' . s:lnum,
\ ]
\ ],
\ 1)
"Symbol "Symbol
if has('nvim-0.7.0') if has('nvim-0.7.0')
nnoremap <silent> <plug>SpaceVim-plugin-iedit :lua require('spacevim.plugin.iedit').start()<cr> nnoremap <silent> <plug>SpaceVim-plugin-iedit :lua require('spacevim.plugin.iedit').start()<cr>

View File

@ -8,6 +8,8 @@
<!-- vim-markdown-toc GFM --> <!-- vim-markdown-toc GFM -->
- [Install](#install) - [Install](#install)
- [Usage](#usage)
- [Screenshots](#screenshots)
- [Feedback](#feedback) - [Feedback](#feedback)
<!-- vim-markdown-toc --> <!-- vim-markdown-toc -->
@ -31,6 +33,34 @@ let g:zettelkasten_directory = 'D:\me\zettelkasten'
let g:zettelkasten_template_directory = 'D:\me\zettelkasten_template' let g:zettelkasten_template_directory = 'D:\me\zettelkasten_template'
``` ```
## Usage
**Commands:**
| Command | description |
| ----------------- | --------------------------------- |
| `:ZkNew` | create new note |
| `:ZkBrowse` | list note in browser window |
| `:ZkListTags` | filter tags in telescope |
| `:ZkListTemplete` | filte note templates in telescope |
**Key bindings in browser window:**
| key bindings | description |
| --------------- | ---------------------------------- |
| `F2` | open zettelkasten tags sidebar |
| `<LeftRelease>` | filter notes based on cursor tag |
| `gf` | open the note |
| `Ctrl-l` | clear tags filter pattarn |
| `Ctrl-] / K` | preview note in vim preview-window |
| `[I` | list references in quickfix-window |
## Screenshots
![](https://wsdjeg.net/images/zkbrowser.png)
![](https://wsdjeg.net/images/zettelkasten-tags-sidebar.png)
![](https://wsdjeg.net/images/zettelkasten-tags-filter.png)
![](https://wsdjeg.net/images/zettelkasten-complete-id.png)
## Feedback ## Feedback

View File

@ -1 +1,2 @@
exe 'set rtp+=' .. getcwd() exe 'set rtp+=' .. getcwd()
colorscheme default

View File

@ -48,10 +48,12 @@ lang: zh
- [增删注释](#增删注释) - [增删注释](#增删注释)
- [编辑历史](#编辑历史) - [编辑历史](#编辑历史)
- [文本编码格式](#文本编码格式) - [文本编码格式](#文本编码格式)
- [窗口管理](#窗口管理) - [窗口和标签页](#窗口和标签页)
- [窗口管理器](#窗口管理器)
- [常用编辑器窗口](#常用编辑器窗口) - [常用编辑器窗口](#常用编辑器窗口)
- [窗口操作常用快捷键](#窗口操作常用快捷键) - [窗口操作常用快捷键](#窗口操作常用快捷键)
- [缓冲区管理](#缓冲区管理) - [标签页操作快捷键](#标签页操作快捷键)
- [缓冲区与文件](#缓冲区与文件)
- [缓冲区操作](#缓冲区操作) - [缓冲区操作](#缓冲区操作)
- [新建空白 buffer](#新建空白-buffer) - [新建空白 buffer](#新建空白-buffer)
- [特殊 buffer](#特殊-buffer) - [特殊 buffer](#特殊-buffer)
@ -1248,7 +1250,9 @@ set enc=utf-8
write write
``` ```
### 窗口管理 ### 窗口和标签页
#### 窗口管理器
常用的窗口管理快捷键有一个统一的前缀,默认的前缀 `[Window]` 是按键 `s`,可以在配置文件中通过修改 常用的窗口管理快捷键有一个统一的前缀,默认的前缀 `[Window]` 是按键 `s`,可以在配置文件中通过修改
SpaceVim 选项 `window_leader` 的值来设为其它按键: SpaceVim 选项 `window_leader` 的值来设为其它按键:
@ -1339,7 +1343,17 @@ SpaceVim 选项 `window_leader` 的值来设为其它按键:
| `SPC w W` | 选择一个窗口 | | `SPC w W` | 选择一个窗口 |
| `SPC w x` | 切换窗口文件 | | `SPC w x` | 切换窗口文件 |
### 缓冲区管理 #### 标签页操作快捷键
标签页Tab操作相关快捷键都是以 `SPC F` 为前缀的:
| 快捷键 | 功能描述 |
| --------- | ------------------ |
| `SPC F d` | 关闭当前标签页 |
| `SPC F D` | 关闭其他所有标签页 |
| `SPC F n` | 新建一个新的标签页 |
### 缓冲区与文件
#### 缓冲区操作 #### 缓冲区操作

View File

@ -47,9 +47,11 @@ description: "General documentation about how to use SpaceVim, including the qui
- [Commenting](#commenting) - [Commenting](#commenting)
- [Undo tree](#undo-tree) - [Undo tree](#undo-tree)
- [Multi-Encodings](#multi-encodings) - [Multi-Encodings](#multi-encodings)
- [Window manager](#window-manager) - [Windows and Tabs](#windows-and-tabs)
- [Windows Manager](#windows-manager)
- [General Editor windows](#general-editor-windows) - [General Editor windows](#general-editor-windows)
- [Window manipulation key bindings](#window-manipulation-key-bindings) - [Window manipulation key bindings](#window-manipulation-key-bindings)
- [Tabs manipulation key bindings](#tabs-manipulation-key-bindings)
- [Buffers and Files](#buffers-and-files) - [Buffers and Files](#buffers-and-files)
- [Buffers manipulation key bindings](#buffers-manipulation-key-bindings) - [Buffers manipulation key bindings](#buffers-manipulation-key-bindings)
- [Create a new empty buffer](#create-a-new-empty-buffer) - [Create a new empty buffer](#create-a-new-empty-buffer)
@ -1351,7 +1353,9 @@ set enc=utf-8
write write
``` ```
### Window manager ### Windows and Tabs
#### Windows Manager
Window manager key bindings can only be used in normal mode. The default leader `[WIN]` is `s`, you Window manager key bindings can only be used in normal mode. The default leader `[WIN]` is `s`, you
can change it via `windows_leader` in the `[options]` section: can change it via `windows_leader` in the `[options]` section:
@ -1446,31 +1450,41 @@ Windows manipulation commands (start with `w`):
| `SPC w W` | select window using vim-choosewin | | `SPC w W` | select window using vim-choosewin |
| `SPC w x` | exchange current window with next one | | `SPC w x` | exchange current window with next one |
#### Tabs manipulation key bindings
Tab manipulation commands (start with `F`):
| Key Bindings | Descriptions |
| ------------ | ----------------- |
| `SPC F d` | close current tab |
| `SPC F D` | close other tabs |
| `SPC F n` | create a new tab |
### Buffers and Files ### Buffers and Files
#### Buffers manipulation key bindings #### Buffers manipulation key bindings
Buffer manipulation commands (start with `b`): Buffer manipulation commands (start with `b`):
| Key Bindings | Descriptions | | Key Bindings | Descriptions |
| -------------------- | ------------------------------------------------------------------------------ | | -------------------- | ------------------------------------------------------------------------ |
| `SPC <Tab>` | switch to alternate buffer in the current window (switch back and forth) | | `SPC <Tab>` | switch to alternate buffer in the current window (switch back and forth) |
| `SPC b .` | buffer transient state | | `SPC b .` | buffer transient state |
| `SPC b b` | switch to a buffer (via denite/unite) | | `SPC b b` | switch to a buffer (via denite/unite) |
| `SPC b d` | kill the current buffer (does not delete the visited file) | | `SPC b d` | kill the current buffer (does not delete the visited file) |
| `SPC b D` | kill a visible buffer using vim-choosewin | | `SPC b D` | kill a visible buffer using vim-choosewin |
| `SPC b Ctrl-d` | kill other buffers | | `SPC b Ctrl-d` | kill other buffers |
| `SPC b Ctrl-Shift-d` | kill buffers using a regular expression | | `SPC b Ctrl-Shift-d` | kill buffers using a regular expression |
| `SPC b e` | erase the content of the buffer (ask for confirmation) | | `SPC b e` | erase the content of the buffer (ask for confirmation) |
| `SPC b n` | switch to next buffer avoiding special buffers | | `SPC b n` | switch to next buffer avoiding special buffers |
| `SPC b m` | open _Messages_ buffer | | `SPC b m` | open _Messages_ buffer |
| `SPC b o` | kill all saved buffers and windows except the current one | | `SPC b o` | kill all saved buffers and windows except the current one |
| `SPC b p` | switch to previous buffer avoiding special buffers | | `SPC b p` | switch to previous buffer avoiding special buffers |
| `SPC b P` | copy clipboard and replace buffer (useful when pasting from a browser) | | `SPC b P` | copy clipboard and replace buffer (useful when pasting from a browser) |
| `SPC b R` | revert the current buffer (reload from disk) | | `SPC b R` | revert the current buffer (reload from disk) |
| `SPC b s` | switch to the _scratch_ buffer (create it if needed) | | `SPC b s` | switch to the _scratch_ buffer (create it if needed) |
| `SPC b w` | toggle read-only (writable state) | | `SPC b w` | toggle read-only (writable state) |
| `SPC b Y` | copy whole buffer to clipboard (useful when copying to a browser) | | `SPC b Y` | copy whole buffer to clipboard (useful when copying to a browser) |
#### Create a new empty buffer #### Create a new empty buffer