mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-23 20:20:05 +08:00
Compare commits
2 Commits
e79d1ea754
...
0d66e31934
Author | SHA1 | Date | |
---|---|---|---|
|
0d66e31934 | ||
|
9584d22101 |
@ -152,7 +152,11 @@ function! s:mappings() abort
|
|||||||
call SpaceVim#mapping#space#langSPC('nmap', ['l', 'r'],
|
call SpaceVim#mapping#space#langSPC('nmap', ['l', 'r'],
|
||||||
\ 'call call('
|
\ 'call call('
|
||||||
\ . string(function('s:run_code_in_block'))
|
\ . string(function('s:run_code_in_block'))
|
||||||
\ . ', [])', 'run code in block', 1)
|
\ . ', [])', 'run-code-bl', 1)
|
||||||
|
call SpaceVim#mapping#space#langSPC('nmap', ['l', 'f'],
|
||||||
|
\ 'call call('
|
||||||
|
\ . string(function('s:format_code_block'))
|
||||||
|
\ . ', [])', 'format-code-block', 1)
|
||||||
call SpaceVim#mapping#space#langSPC('nmap', ['l','c'], 'GenTocGFM', 'create content at cursor', 1)
|
call SpaceVim#mapping#space#langSPC('nmap', ['l','c'], 'GenTocGFM', 'create content at cursor', 1)
|
||||||
call SpaceVim#mapping#space#langSPC('nmap', ['l','C'], 'RemoveToc', 'remove content', 1)
|
call SpaceVim#mapping#space#langSPC('nmap', ['l','C'], 'RemoveToc', 'remove content', 1)
|
||||||
call SpaceVim#mapping#space#langSPC('nmap', ['l','u'], 'UpdateToc', 'update content', 1)
|
call SpaceVim#mapping#space#langSPC('nmap', ['l','u'], 'UpdateToc', 'update content', 1)
|
||||||
@ -236,6 +240,15 @@ function! s:run_code_in_block() abort
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! s:format_code_block() abort
|
||||||
|
let cf = context_filetype#get()
|
||||||
|
if cf.filetype !=# 'markdown'
|
||||||
|
let command = printf('%s,%sFormat! %s', cf.range[0][0], cf.range[1][0], cf.filetype)
|
||||||
|
exe command
|
||||||
|
endif
|
||||||
|
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
function! SpaceVim#layers#lang#markdown#health() abort
|
function! SpaceVim#layers#lang#markdown#health() abort
|
||||||
call SpaceVim#layers#lang#markdown#plugins()
|
call SpaceVim#layers#lang#markdown#plugins()
|
||||||
|
@ -37,10 +37,10 @@ require('format').setup({
|
|||||||
custom_formatters = {
|
custom_formatters = {
|
||||||
lua = {
|
lua = {
|
||||||
exe = 'stylua',
|
exe = 'stylua',
|
||||||
args = {'-'},
|
args = { '-' },
|
||||||
stdin = true
|
stdin = true,
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -72,12 +72,16 @@ function M.run(argv)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function get_all_tags()
|
||||||
|
return vim.fn.systemlist('git tag')
|
||||||
|
end
|
||||||
|
|
||||||
function M.complete(ArgLead, CmdLine, CursorPos)
|
function M.complete(ArgLead, CmdLine, CursorPos)
|
||||||
local str = string.sub(CmdLine, 1, CursorPos)
|
local str = string.sub(CmdLine, 1, CursorPos)
|
||||||
if vim.regex([[^Git\s\+tag\s\+-\+$]]):match_str(str) then
|
if vim.regex([[^Git\s\+tag\s\+-\+$]]):match_str(str) then
|
||||||
return table.concat({'--list'}, '\n')
|
return table.concat({'--list', '-l', '-m', '-a', '-d'}, '\n')
|
||||||
else
|
else
|
||||||
return ''
|
return table.concat(get_all_tags(), '\n')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -99,7 +99,8 @@ npm install --global prettier
|
|||||||
| `SPC l C` | Normal/Visual | 删除目录 |
|
| `SPC l C` | Normal/Visual | 删除目录 |
|
||||||
| `SPC l k` | Normal/Visual | 为光标下的单词或者选中文本增加 URL 链接 |
|
| `SPC l k` | Normal/Visual | 为光标下的单词或者选中文本增加 URL 链接 |
|
||||||
| `SPC l K` | Normal/Visual | 为光标下的单词或者选中文本增加图片链接 |
|
| `SPC l K` | Normal/Visual | 为光标下的单词或者选中文本增加图片链接 |
|
||||||
| `SPC l r` | Normal/Visual | 运行区块中的代码 |
|
| `SPC l r` | Normal/Visual | 运行 Markdown 中当前代码块 |
|
||||||
|
| `SPC l f` | Normal/Visual | 格式化 Markdown 中当前代码块 |
|
||||||
| `SPC l u` | Normal/Visual | 更新目录 |
|
| `SPC l u` | Normal/Visual | 更新目录 |
|
||||||
| `SPC l p` | Normal | 通过浏览器实时预览当前文件 |
|
| `SPC l p` | Normal | 通过浏览器实时预览当前文件 |
|
||||||
| `SPC l t` | Normal | 切换待办事项状态 |
|
| `SPC l t` | Normal | 切换待办事项状态 |
|
||||||
|
@ -99,7 +99,8 @@ If you don't want to install php, you can use [mdctags](https://github.com/wsdje
|
|||||||
| `SPC l C` | Normal/Visual | Remove content |
|
| `SPC l C` | Normal/Visual | Remove content |
|
||||||
| `SPC l k` | Normal/Visual | Add URL link for word under cursor or slected word |
|
| `SPC l k` | Normal/Visual | Add URL link for word under cursor or slected word |
|
||||||
| `SPC l K` | Normal/Visual | Add picture link for word under cursor or slected word |
|
| `SPC l K` | Normal/Visual | Add picture link for word under cursor or slected word |
|
||||||
| `SPC l r` | Normal/Visual | Run code in block |
|
| `SPC l r` | Normal/Visual | Run code block |
|
||||||
|
| `SPC l f` | Normal/Visual | Format code block |
|
||||||
| `SPC l u` | Normal/Visual | Update content |
|
| `SPC l u` | Normal/Visual | Update content |
|
||||||
| `SPC l p` | Normal | Real-time markdown preview |
|
| `SPC l p` | Normal | Real-time markdown preview |
|
||||||
| `SPC l t` | Normal | toggle todo status |
|
| `SPC l t` | Normal | toggle todo status |
|
||||||
|
Loading…
Reference in New Issue
Block a user