This repository has been archived by the owner on Feb 10, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* remove cmdline input, use coc_todolist split window only * remove useless notification methods, use coc buildin notification * use eslintrc.js instead of tslint.json * remap j,k,gg,G,etc. in coc_todolist edit window * use events.ts to add BufWriteCmd
- Loading branch information
Showing
22 changed files
with
443 additions
and
681 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
src/events.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
module.exports = { | ||
env: { | ||
node: true, | ||
}, | ||
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'], | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
ecmaVersion: 2018, | ||
sourceType: 'module', | ||
}, | ||
plugins: ['@typescript-eslint'], | ||
rules: { | ||
'@typescript-eslint/explicit-function-return-type': 'off', | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
'@typescript-eslint/no-non-null-assertion': 'off', | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
" ============================================================================ | ||
" FileName: coc_todolist.vim | ||
" Author: voldikss <[email protected]> | ||
" GitHub: https://github.com/voldikss | ||
" ============================================================================ | ||
|
||
" https://stackoverflow.com/a/26318602/8554147 | ||
function! coc_todolist#get_buf_info() abort | ||
let save_virtualedit = &virtualedit | ||
set virtualedit=all | ||
norm! g$ | ||
let width = virtcol('.') | ||
let &virtualedit = save_virtualedit | ||
return [bufnr('%'), width] | ||
endfunction |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
" ============================================================================ | ||
" FileName: coc_todolist.vim | ||
" Author: voldikss <[email protected]> | ||
" GitHub: https://github.com/voldikss | ||
" ============================================================================ | ||
|
||
let s:pattern = '─\w\+─' | ||
|
||
function! s:map_down() abort | ||
if search(s:pattern, 'W') != 0 | ||
normal! j | ||
normal! 0 | ||
endif | ||
call s:rematch() | ||
endfunction | ||
|
||
function! s:map_up() abort | ||
call search(s:pattern, 'bW') | ||
call search(s:pattern, 'bW') | ||
normal! j | ||
normal! 0 | ||
call s:rematch() | ||
endfunction | ||
|
||
function! s:map_gg() abort | ||
normal! gg | ||
call search(s:pattern, 'W') | ||
normal! j | ||
normal! 0 | ||
call s:rematch() | ||
endfunction | ||
|
||
function! s:map_G() abort | ||
normal! G | ||
call search(s:pattern, 'bW') | ||
normal! j | ||
normal! 0 | ||
call s:rematch() | ||
endfunction | ||
|
||
function! s:rematch() abort | ||
call clearmatches() | ||
let toplnum = line('.') | ||
let botlnum = search(s:pattern, 'nW') | ||
if botlnum == 0 | ||
let botlnum = line('$') | ||
else | ||
let botlnum -= 1 | ||
endif | ||
let pattern = join(map(range(toplnum, botlnum), { k,v -> '\%' . v . 'l.*' }), '\|') | ||
call matchadd('CocTodolistSelect', pattern) | ||
endfunction | ||
|
||
nmap <buffer><silent> j :<C-u>call <SID>map_down()<CR> | ||
nmap <buffer><silent> k :<C-u>call <SID>map_up()<CR> | ||
nmap <buffer><silent> <down> :<C-u>call <SID>map_down()<CR> | ||
nmap <buffer><silent> <up> :<C-u>call <SID>map_up()<CR> | ||
nmap <buffer><silent> gg :<C-u>call <SID>map_gg()<CR> | ||
nmap <buffer><silent> G :<C-u>call <SID>map_G()<CR> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,12 +13,13 @@ | |
"todolist" | ||
], | ||
"engines": { | ||
"coc": "^0.0.74" | ||
"coc": "^0.0.80" | ||
}, | ||
"scripts": { | ||
"clean": "rimraf lib", | ||
"watch": "webpack --watch", | ||
"build": "webpack" | ||
"build": "webpack", | ||
"prepare": "npx npm-run-all clean build" | ||
}, | ||
"activationEvents": [ | ||
"*" | ||
|
@@ -27,66 +28,15 @@ | |
"configuration": { | ||
"type": "object", | ||
"properties": { | ||
"todolist.enable": { | ||
"type": "boolean", | ||
"default": true, | ||
"description": "whether enable this extension" | ||
}, | ||
"todolist.maxsize": { | ||
"type": "number", | ||
"default": 5000, | ||
"description": "maxsize of todolist" | ||
}, | ||
"todolist.dateFormat": { | ||
"type": "string", | ||
"default": "YYYY-MM-DD HH:mm", | ||
"description": "dates format" | ||
}, | ||
"todolist.autoUpload": { | ||
"type": "boolean", | ||
"default": false, | ||
"description": "upload your todolist every day" | ||
}, | ||
"todolist.monitor": { | ||
"type": "boolean", | ||
"default": false, | ||
"description": "monitor the todolist and remind you at the time" | ||
}, | ||
"todolist.promptForReminder": { | ||
"type": "boolean", | ||
"default": true, | ||
"description": "whether to ask users to set a reminder for every new todo item" | ||
}, | ||
"todolist.easyMode": { | ||
"type": "boolean", | ||
"default": false, | ||
"description": "Open a todo edit window when create/edit a todo item" | ||
}, | ||
"todolist.floatwin.background": { | ||
"type": "string", | ||
"default": "", | ||
"description": "notification floating window background(e.g. #000000)" | ||
}, | ||
"todolist.floatwin.winblend": { | ||
"type": "number", | ||
"default": 0, | ||
"description": "opacity of notification floating window" | ||
}, | ||
"todolist.floatwin.width": { | ||
"type": "number", | ||
"default": 30, | ||
"description": "width of notification floating window" | ||
}, | ||
"todolist.notify": { | ||
"type": "string", | ||
"default": "floating", | ||
"description": "how to notify you", | ||
"enum": [ | ||
"floating", | ||
"virtual", | ||
"echo", | ||
"none" | ||
] | ||
} | ||
} | ||
}, | ||
|
@@ -107,39 +57,38 @@ | |
"title": "export todolist as a json or yaml file", | ||
"command": "todolist.export" | ||
}, | ||
{ | ||
"title": "close notification", | ||
"command": "todolist.closeNotice" | ||
}, | ||
{ | ||
"title": "clear all todos", | ||
"command": "todolist.clear" | ||
}, | ||
{ | ||
"title": "clear notification", | ||
"title": "clear open todolist gist", | ||
"command": "todolist.browserOpenGist" | ||
} | ||
] | ||
}, | ||
"author": "[email protected]", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"@chemzqm/neovim": "^5.2.10", | ||
"@types/js-yaml": "^3.12.5", | ||
"@types/node": "^14.14.10", | ||
"@types/node": "^14.14.16", | ||
"@types/uuid": "^8.3.0", | ||
"@typescript-eslint/eslint-plugin": "^4.11.1", | ||
"@typescript-eslint/parser": "^4.11.1", | ||
"@voldikss/tsconfig": "^1.0.0", | ||
"@voldikss/tslint-config": "^1.0.6", | ||
"coc.nvim": "^0.0.79", | ||
"js-yaml": "^3.14.0", | ||
"coc.nvim": "^0.0.80", | ||
"eslint": "^7.16.0", | ||
"js-yaml": "^3.14.1", | ||
"moment": "^2.29.1", | ||
"moment-timezone": "^0.5.32", | ||
"path": "^0.12.7", | ||
"request-light": "^0.4.0", | ||
"rimraf": "^3.0.2", | ||
"ts-loader": "^8.0.11", | ||
"tslint": "^6.1.3", | ||
"typescript": "^4.1.2", | ||
"uuid": "^8.3.1", | ||
"webpack": "^5.8.0", | ||
"webpack-cli": "^4.2.0" | ||
"ts-loader": "^8.0.12", | ||
"typescript": "^4.1.3", | ||
"uuid": "^8.3.2", | ||
"webpack": "^5.11.1", | ||
"webpack-cli": "^4.3.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.