summaryrefslogtreecommitdiffstats
path: root/zsh/oh-my-zsh/plugins/geeknote
diff options
context:
space:
mode:
authorLibravatarLibravatar Biswakalyan Bhuyan <biswa@surgot.in> 2022-10-03 21:42:20 +0530
committerLibravatarLibravatar Biswakalyan Bhuyan <biswa@surgot.in> 2022-10-03 21:42:20 +0530
commitaf120ab348f2e1a5a39dec035ed9dcf84189a64e (patch)
tree2a3aadd7ce1b7b771dfe3fe7c983569726c8d7ed /zsh/oh-my-zsh/plugins/geeknote
downloaddotfiles-af120ab348f2e1a5a39dec035ed9dcf84189a64e.tar.gz
dotfiles-af120ab348f2e1a5a39dec035ed9dcf84189a64e.tar.bz2
dotfiles-af120ab348f2e1a5a39dec035ed9dcf84189a64e.zip
dotfiles
Diffstat (limited to 'zsh/oh-my-zsh/plugins/geeknote')
-rw-r--r--zsh/oh-my-zsh/plugins/geeknote/README.md10
-rw-r--r--zsh/oh-my-zsh/plugins/geeknote/_geeknote157
-rw-r--r--zsh/oh-my-zsh/plugins/geeknote/geeknote.plugin.zsh2
3 files changed, 169 insertions, 0 deletions
diff --git a/zsh/oh-my-zsh/plugins/geeknote/README.md b/zsh/oh-my-zsh/plugins/geeknote/README.md
new file mode 100644
index 0000000..95b3aa7
--- /dev/null
+++ b/zsh/oh-my-zsh/plugins/geeknote/README.md
@@ -0,0 +1,10 @@
+# Geeknote plugin
+
+This plugin provides autocompletion for [Geeknote](https://github.com/VitaliyRodnenko/geeknote)
+and an alias for `geeknote` called `gn`.
+
+To use it, add `geeknote` to the plugins array in your zshrc file:
+
+```zsh
+plugins=( ... geeknote ...)
+```
diff --git a/zsh/oh-my-zsh/plugins/geeknote/_geeknote b/zsh/oh-my-zsh/plugins/geeknote/_geeknote
new file mode 100644
index 0000000..a34be59
--- /dev/null
+++ b/zsh/oh-my-zsh/plugins/geeknote/_geeknote
@@ -0,0 +1,157 @@
+#compdef geeknote
+
+# Geeknote Autocomplete plugin for Zsh
+# Requires: Geeknote installed
+# Author : Ján Koščo (@s7anley)
+
+__login() {
+ # no arguments
+}
+
+__logout() {
+ _arguments \
+ '--force[Do not ask about logging out.]'
+}
+
+__settings() {
+ _arguments \
+ "--editor+[Set the editor, which use to edit and create notes.]::"
+}
+
+__create() {
+ _arguments \
+ '--title+[The note title.]::' \
+ '--content+[The note content.]::' \
+ '--tags+[One tag or the list of tags which will be added to the note.]::' \
+ '--notebook+[Set the notebook where to save note.]::' \
+ '--resource+[Add a resource to the note.]::'
+}
+
+__edit() {
+ _arguments \
+ '--note+[The name or ID from the previous search of a note to edit.]::' \
+ '--title+[Set new title of the note.]::' \
+ '--content+[Set new content of the note.]::' \
+ '--tags+[Set new list o tags for the note.]::' \
+ '--notebook+[Assign new notebook for the note.]::' \
+ '--resource+[Add a resource to the note.]::'
+}
+
+__find() {
+ _arguments \
+ '--search+[Text to search.]::' \
+ '--tags+[Notes with which tag/tags to search.]::' \
+ '--notebook+[In which notebook search the note.]::' \
+ '--date+[Set date in format dd.mm.yyyy or date range dd.mm.yyyy-dd.mm.yyyy.]::' \
+ '--count+[How many notes show in the result list.]::' \
+ '--with-url[Add direct url of each note in results to Evernote web-version.]' \
+ '--content-search[Search by content, not by title.]' \
+ '--exact-entry[Search for exact entry of the request.]'
+}
+
+__show() {
+ _arguments \
+ '--note+[The name or ID from the previous search of a note to show.]::' \
+ '--raw[Show the raw note body.]'
+}
+
+__remove() {
+ _arguments \
+ '--note+[The name or ID from the previous search of a note to remove.]::' \
+ '--force[Do not ask about removing.]'
+}
+
+__notebook-list() {
+ # no arguments
+}
+
+__notebook-create() {
+ _arguments \
+ '--title+[Set the title of new notebook.]::'
+}
+
+__notebook-edit() {
+ _arguments \
+ '--title+[Set the title of new notebook.]::' \
+ '--notebook+[The name of a notebook to rename.]::'
+}
+
+__tag-list() {
+ # no arguments
+}
+
+__tag-create() {
+ _arguments \
+ '--title+[Set the title of new tag.]::'
+}
+
+__tag-edit() {
+ _arguments \
+ '--tagname+[The name of a tag to rename.]::' \
+ '--title+[Set the new name of tag.]::'
+}
+
+__user() {
+ _arguments \
+ '--full[Show full information.]'
+}
+
+local -a _1st_arguments
+_1st_arguments=(
+ 'login':'Authorize in Evernote.'
+ 'logout':'Logout from Evernote.'
+ 'settings':'Show and edit current settings.'
+ 'create':'Create note in Evernote.'
+ 'edit':'Edit note in Evernote.'
+ 'find':'Search notes in Evernote.'
+ 'show':'Output note in the terminal.'
+ 'remove':'Remove note from Evernote.'
+ 'notebook-list':'Show the list of existing notebooks in your Evernote.'
+ 'notebook-create':'Create new notebook.'
+ 'notebook-edit':'Edit/rename notebook.'
+ 'tag-list':'Show the list of existing tags in your Evernote.'
+ 'tag-create':'Create new tag.'
+ 'tag-edit':'Edit/rename tag.'
+ 'user':'Show information about active user.'
+)
+
+_arguments '*:: :->command'
+
+if (( CURRENT == 1 )); then
+ _describe -t commands "geeknote command" _1st_arguments
+ return
+fi
+
+local -a _command_args
+case "$words[1]" in
+ login)
+ __login ;;
+ logout)
+ __logout ;;
+ settings)
+ __settings ;;
+ create)
+ __create ;;
+ edit)
+ __edit ;;
+ find)
+ __find ;;
+ show)
+ __show ;;
+ remove)
+ __remove ;;
+ notebook-list)
+ __notebook-list ;;
+ notebook-create)
+ __notebook-create ;;
+ notebook-edit)
+ __notebook-edit ;;
+ tag-list)
+ __tag-list ;;
+ tag-create)
+ __tag-create ;;
+ tag-edit)
+ __tag-edit ;;
+ user)
+ __user ;;
+esac
diff --git a/zsh/oh-my-zsh/plugins/geeknote/geeknote.plugin.zsh b/zsh/oh-my-zsh/plugins/geeknote/geeknote.plugin.zsh
new file mode 100644
index 0000000..8126d26
--- /dev/null
+++ b/zsh/oh-my-zsh/plugins/geeknote/geeknote.plugin.zsh
@@ -0,0 +1,2 @@
+#Alias
+alias gn='geeknote'