diff --git a/.gitignore b/.gitignore index 733b991..c6510b7 100644 --- a/.gitignore +++ b/.gitignore @@ -5,5 +5,5 @@ /result /result-lib -# Vim plugins doc tags file -/*/vim/doc/tags +# Vim plugin doc tags file +/vim/doc/tags diff --git a/CHANGELOG.md b/CHANGELOG.md index bc88b96..1cfa952 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,11 +7,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -### Changed - -- Make use of cargo workspace feature -- [**BREAKING**] Because of workspace feature, the vim plugin is now accessible at `/email-manager/vim` instead of `/vim` - ### Fixed - Blur in list msg screenshot [#181] diff --git a/Cargo.toml b/Cargo.toml index cd627ac..3331029 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,11 +1,35 @@ -[workspace] -members = [ - "email-manager", - # "email-synchronizer", - # "contact-manager", - # "contact-synchronizer", - # "calendar-manager", - # "calendar-synchronizer", - # "task-manager", - # "task-synchronizer", -] +[package] +name = "himalaya" +description = "Command-line interface for email management" +version = "0.5.1" +authors = ["soywod "] +edition = "2018" + +[dependencies] +ammonia = "3.1.2" +anyhow = "1.0.44" +atty = "0.2.14" +chrono = "0.4.19" +clap = { version = "2.33.3", default-features = false, features = ["suggestions", "color"] } +env_logger = "0.8.3" +html-escape = "0.2.9" +imap = "3.0.0-alpha.4" +imap-proto = "0.14.3" +# This commit includes the de/serialization of the ContentType +# lettre = { version = "0.10.0-rc.1", features = ["serde"] } +lettre = { git = "https://github.com/TornaxO7/lettre/", branch = "master", features = ["serde"] } +log = "0.4.14" +mailparse = "0.13.6" +native-tls = "0.2" +regex = "1.5.4" +rfc2047-decoder = "0.1.2" +serde = { version = "1.0.118", features = ["derive"] } +serde_json = "1.0.61" +shellexpand = "2.1.0" +termcolor = "1.1" +terminal_size = "0.1.15" +toml = "0.5.8" +tree_magic = "0.2.3" +unicode-width = "0.1.7" +url = "2.2.2" +uuid = { version = "0.8", features = ["v4"] } diff --git a/README.md b/README.md index 2335814..595e6ce 100644 --- a/README.md +++ b/README.md @@ -1,44 +1,84 @@ -# :mage: Himalaya +# ðŸ“Ŧ Himalaya +[![gh-actions](https://github.com/soywod/himalaya/workflows/deployment/badge.svg)](https://github.com/soywod/himalaya/actions?query=workflow%3Adeployment) +[![gh-actions](https://github.com/soywod/himalaya/workflows/tests/badge.svg)](https://github.com/soywod/himalaya/actions?query=workflow%3Atests) +[![gh-actions](https://github.com/soywod/himalaya/workflows/nix-build/badge.svg)](https://github.com/soywod/himalaya/actions?query=workflow%3Anix-build) +[![Homebrew](https://img.shields.io/badge/dynamic/json.svg?url=https://formulae.brew.sh/api/formula/himalaya.json&query=$.versions.stable&label=homebrew)](https://formulae.brew.sh/formula/himalaya) -Himalaya is a suite of independent [Personal Information -Management](https://en.wikipedia.org/wiki/Personal_information_manager) -command-line tools. +Command-line interface for email management -![image](https://user-images.githubusercontent.com/10437171/138774902-7b9de5a3-93eb-44b0-8cfb-6d2e11e3b1aa.png) +*The project is under active development. Do not use in production before the +`v1.0.0` (see the [roadmap](https://github.com/soywod/himalaya/milestone/5)).* + +![image](https://user-images.githubusercontent.com/10437171/115144003-8a1b4880-a04a-11eb-80d2-245027e28591.png) + +## Motivation + +Bringing emails to the terminal is a *pain*. First, because they are sensitive +data. Secondly, the existing TUIs ([Mutt](http://www.mutt.org/), +[NeoMutt](https://neomutt.org/), [Alpine](https://alpine.x10host.com/), +[aerc](https://aerc-mail.org/)â€Ķ) are really hard to configure. They require time +and patience. + +The aim of Himalaya is to extract the email logic into a simple (yet solid) CLI +API that can be used directly from the terminal, from scripts, from UIsâ€Ķ +Possibilities are endless! + +## Installation + +```sh +curl -sSL https://raw.githubusercontent.com/soywod/himalaya/master/install.sh | PREFIX=~/.local sh +``` + +*See the +[wiki](https://github.com/soywod/himalaya/wiki/Installation:from-binary) for +other installation methods.* + +## Configuration + +```toml +# ~/.config/himalaya/config.toml + +name = "Your full name" +downloads-dir = "/abs/path/to/downloads" +signature = """ +Cordialement, +Regards, +""" + +[gmail] +default = true +email = "your.email@gmail.com" + +imap-host = "imap.gmail.com" +imap-port = 993 +imap-login = "your.email@gmail.com" +imap-passwd-cmd = "pass show gmail" + +smtp-host = "smtp.gmail.com" +smtp-port = 465 +smtp-login = "your.email@gmail.com" +smtp-passwd-cmd = "security find-internet-password -gs gmail -w" +``` + +*See the +[wiki](https://github.com/soywod/himalaya/wiki/Configuration:config-file) for +all the options.* ## Features -### :mailbox: [Email](https://github.com/soywod/himalaya/blob/set-up-multi-crate/email-manager/README.md) +- Mailbox listing +- Email listing and filtering +- Email composition based on `$EDITOR` +- Email manipulation (copy/move/delete) +- Multi-accounting +- IDLE mode for real-time notifications +- Vim plugin +- Completions for bash/zsh/fish +- JSON output +- â€Ķ -Himalaya proposes a command-line API to manage your emails (listing, searching, -reading, copying, moving, deletingâ€Ķ). It is also shipped with a [Vim -plugin](https://github.com/soywod/himalaya/blob/set-up-multi-crate/email-manager/vim/README.md). -A [TUI](https://github.com/soywod/himalaya/pull/155) and an [Emacs -plugin](https://github.com/soywod/himalaya/issues/142https://github.com/soywod/himalaya/issues/142) -are in progress by the community. A -[synchronizer](https://github.com/soywod/himalaya/blob/set-up-multi-crate/email-synchronizer/README.md) -should also come soon. - -### :card_index: [Contact](https://github.com/soywod/himalaya/blob/set-up-multi-crate/contact-manager/README.md) (TODO) - -Himalaya plans to propose a command-line API to manage your contacts through -the [CardDAV](https://en.wikipedia.org/wiki/CardDAV) protocol. It may come in -the future with a Vim plugin, an Emacs plugin, a TUI and a synchronizer. - -### :date: [Calendar](https://github.com/soywod/himalaya/blob/set-up-multi-crate/calendar-manager/README.md) (TODO) - -Himalaya plans to propose a command-line API to manage your calendar through -the [CalDAV](https://en.wikipedia.org/wiki/CalDAV) protocol. It may come in the -future with a Vim plugin, an Emacs plugin, a TUI and a synchronizer. - -### :stopwatch: [Tasks](https://github.com/soywod/himalaya/blob/set-up-multi-crate/task-manager/README.md) (TODO) - -Himalaya plans to propose a command-line API to manage your tasks and your time -through the [CalDAV](https://en.wikipedia.org/wiki/CalDAV) protocol. It may -come in the future with a Vim plugin, an Emacs plugin, a TUI and a -synchronizer. The tool already exists in [another -repository](https://github.com/soywod/unfog): it needs to be rewritten and -added to the Himalaya suite. +*See the [wiki](https://github.com/soywod/himalaya/wiki/Usage:msg:list) for all +the features.* ## Sponsoring @@ -47,3 +87,13 @@ added to the Himalaya suite. [![ko-fi](https://img.shields.io/badge/-Ko--fi-ff5e5a?logo=Ko-fi&logoColor=ffffff)](https://ko-fi.com/soywod) [![buy-me-a-coffee](https://img.shields.io/badge/-Buy%20Me%20a%20Coffee-ffdd00?logo=Buy%20Me%20A%20Coffee&logoColor=000000)](https://www.buymeacoffee.com/soywod) [![liberapay](https://img.shields.io/badge/-Liberapay-f6c915?logo=Liberapay&logoColor=222222)](https://liberapay.com/soywod) + +## Credits + +- [IMAP RFC3501](https://tools.ietf.org/html/rfc3501) +- [Iris](https://github.com/soywod/iris.vim), the himalaya predecessor +- [isync](https://isync.sourceforge.io/), an email synchronizer for offline usage +- [NeoMutt](https://neomutt.org/), an email terminal user interface +- [Alpine](http://alpine.x10host.com/alpine/alpine-info/), an other email terminal user interface +- [mutt-wizard](https://github.com/LukeSmithxyz/mutt-wizard), a tool over NeoMutt and isync +- [rust-imap](https://github.com/jonhoo/rust-imap), a rust IMAP lib diff --git a/email-manager/assets/himalaya.desktop b/assets/himalaya.desktop similarity index 55% rename from email-manager/assets/himalaya.desktop rename to assets/himalaya.desktop index aead51e..c5ed6aa 100644 --- a/email-manager/assets/himalaya.desktop +++ b/assets/himalaya.desktop @@ -3,9 +3,7 @@ Type=Application Name=himalaya DesktopName=Himalaya GenericName=Mail Reader -Comment=CLI email manager -Comment[lo]=CLI āš­āšĩāŧ€āšĄāš§āŧ„āš„āšĨāŧāš­āš™āš—āšĩāŧˆāš‚āš―āš™āš”āŧ‰āš§āšāšžāšēāšŠāšēRust -Comment[th]=CLI āļ­āļĩāđ€āļĄāļĨāđŒāđ„āļ„āļĨāđāļ­āļ™āļ—āđŒāļ—āļĩāđˆāđ€āļ‚āļĩāļĒāļ™āļ”āđ‰āļ§āļĒāļ āļēāļĐāļēRust +Comment=Command-line interface for email management Terminal=true Exec=himalaya %U Categories=Application;Network diff --git a/calendar-manager/Cargo.toml b/calendar-manager/Cargo.toml deleted file mode 100644 index 773f8ca..0000000 --- a/calendar-manager/Cargo.toml +++ /dev/null @@ -1,6 +0,0 @@ -[package] -name = "makalu" -version = "0.1.0" -edition = "2018" - -[dependencies] diff --git a/calendar-manager/README.md b/calendar-manager/README.md deleted file mode 100644 index 0803956..0000000 --- a/calendar-manager/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# :date: Makalu - -TODO diff --git a/calendar-manager/src/main.rs b/calendar-manager/src/main.rs deleted file mode 100644 index b976a3f..0000000 --- a/calendar-manager/src/main.rs +++ /dev/null @@ -1,3 +0,0 @@ -fn main() { - unimplemented!("The calendar manager is not implemented yet."); -} diff --git a/calendar-synchronizer/Cargo.toml b/calendar-synchronizer/Cargo.toml deleted file mode 100644 index e8ceb02..0000000 --- a/calendar-synchronizer/Cargo.toml +++ /dev/null @@ -1,6 +0,0 @@ -[package] -name = "makalu-sync" -version = "0.1.0" -edition = "2018" - -[dependencies] diff --git a/calendar-synchronizer/README.md b/calendar-synchronizer/README.md deleted file mode 100644 index 424b3a7..0000000 --- a/calendar-synchronizer/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# :date: :repeat: Makalu synchronizer - -TODO diff --git a/calendar-synchronizer/src/main.rs b/calendar-synchronizer/src/main.rs deleted file mode 100644 index 5c0b198..0000000 --- a/calendar-synchronizer/src/main.rs +++ /dev/null @@ -1,3 +0,0 @@ -fn main() { - unimplemented!("The calendar synchronizer is not implemented yet."); -} diff --git a/contact-manager/Cargo.toml b/contact-manager/Cargo.toml deleted file mode 100644 index 381a02e..0000000 --- a/contact-manager/Cargo.toml +++ /dev/null @@ -1,6 +0,0 @@ -[package] -name = "everest" -version = "0.1.0" -edition = "2018" - -[dependencies] diff --git a/contact-manager/README.md b/contact-manager/README.md deleted file mode 100644 index ca02fa6..0000000 --- a/contact-manager/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# :card_index: Everest - -TODO diff --git a/contact-manager/src/main.rs b/contact-manager/src/main.rs deleted file mode 100644 index b379e2d..0000000 --- a/contact-manager/src/main.rs +++ /dev/null @@ -1,3 +0,0 @@ -fn main() { - unimplemented!("The contact manager is not implemented yet."); -} diff --git a/contact-synchronizer/Cargo.toml b/contact-synchronizer/Cargo.toml deleted file mode 100644 index eacd867..0000000 --- a/contact-synchronizer/Cargo.toml +++ /dev/null @@ -1,6 +0,0 @@ -[package] -name = "everest-sync" -version = "0.1.0" -edition = "2018" - -[dependencies] diff --git a/contact-synchronizer/README.md b/contact-synchronizer/README.md deleted file mode 100644 index 58acef6..0000000 --- a/contact-synchronizer/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# :card_index: :repeat: Everest synchronizer - -TODO diff --git a/contact-synchronizer/src/main.rs b/contact-synchronizer/src/main.rs deleted file mode 100644 index ecef320..0000000 --- a/contact-synchronizer/src/main.rs +++ /dev/null @@ -1,3 +0,0 @@ -fn main() { - unimplemented!("The contact synchronizer is not implemented yet."); -} diff --git a/email-manager/Cargo.toml b/email-manager/Cargo.toml deleted file mode 100644 index e4c29d1..0000000 --- a/email-manager/Cargo.toml +++ /dev/null @@ -1,36 +0,0 @@ -[package] -name = "himalaya" -description = "CLI email manager" -version = "0.5.1" -authors = ["soywod "] -edition = "2018" -default-run = "himalaya" - -[dependencies] -ammonia = "3.1.2" -anyhow = "1.0.44" -atty = "0.2.14" -chrono = "0.4.19" -clap = { version = "2.33.3", default-features = false, features = ["suggestions", "color"] } -env_logger = "0.8.3" -html-escape = "0.2.9" -imap = "3.0.0-alpha.4" -imap-proto = "0.14.3" -# This commit includes the de/serialization of the ContentType -# lettre = { version = "0.10.0-rc.1", features = ["serde"] } -lettre = { git = "https://github.com/TornaxO7/lettre/", branch = "master", features = ["serde"] } -log = "0.4.14" -mailparse = "0.13.6" -native-tls = "0.2" -regex = "1.5.4" -rfc2047-decoder = "0.1.2" -serde = { version = "1.0.118", features = ["derive"] } -serde_json = "1.0.61" -shellexpand = "2.1.0" -termcolor = "1.1" -terminal_size = "0.1.15" -toml = "0.5.8" -tree_magic = "0.2.3" -unicode-width = "0.1.7" -url = "2.2.2" -uuid = { version = "0.8", features = ["v4"] } diff --git a/email-manager/README.md b/email-manager/README.md deleted file mode 100644 index 6dbb13b..0000000 --- a/email-manager/README.md +++ /dev/null @@ -1,92 +0,0 @@ -# :mailbox: Himalaya [![Homebrew](https://img.shields.io/badge/dynamic/json.svg?url=https://formulae.brew.sh/api/formula/himalaya.json&query=$.versions.stable&label=homebrew)](https://formulae.brew.sh/formula/himalaya) - -![image](https://user-images.githubusercontent.com/10437171/138774902-7b9de5a3-93eb-44b0-8cfb-6d2e11e3b1aa.png) - -## Motivation - -Bringing emails to the terminal is a *pain*. First, because they are sensitive -data. Secondly, the existing TUIs ([Mutt](http://www.mutt.org/), -[NeoMutt](https://neomutt.org/), [Alpine](https://alpine.x10host.com/), -[aerc](https://aerc-mail.org/)â€Ķ) are really hard to configure. They require time -and patience. - -The aim of Himalaya is to extract the email logic into a simple (yet solid) CLI -API that can be used directly from the terminal, from scripts, from UIsâ€Ķ -Possibilities are endless! - -## Installation - -```sh -# As root: -curl -sSL https://raw.githubusercontent.com/soywod/himalaya/master/email-manager/install.sh | sudo sh - -# As a regular user: -curl -sSL https://raw.githubusercontent.com/soywod/himalaya/master/email-manager/install.sh | PREFIX=~/.local sh -``` - -*See the [wiki](https://github.com/soywod/himalaya/wiki) for other installation -methods.* - -## Configuration - -```toml -# ~/.config/himalaya/config.toml - -name = "Your full name" -downloads-dir = "/abs/path/to/downloads" -signature = """ --- -Regards, -""" - -[gmail] -default = true -email = "your.email@gmail.com" - -imap-host = "imap.gmail.com" -imap-port = 993 -imap-login = "your.email@gmail.com" -imap-passwd-cmd = "pass show gmail" - -smtp-host = "smtp.gmail.com" -smtp-port = 465 -smtp-login = "your.email@gmail.com" -smtp-passwd-cmd = "security find-internet-password -gs gmail -w" -``` - -*See the -[wiki](https://github.com/soywod/himalaya/wiki/Configuration:config-file) for -all the options.* - -## Features - -- Mailbox listing -- Email listing and filtering -- Email composition based on `$EDITOR` -- Email manipulation (copy/move/delete) -- Multi-accounting -- IDLE mode for real-time notifications -- Vim plugin -- Completions for bash/zsh/fish -- JSON output -- â€Ķ - -*See the [wiki](https://github.com/soywod/himalaya/wiki) for all the features.* - -## Sponsoring - -[![github](https://img.shields.io/badge/-GitHub%20Sponsors-fafbfc?logo=GitHub%20Sponsors)](https://github.com/sponsors/soywod) -[![paypal](https://img.shields.io/badge/-PayPal-0079c1?logo=PayPal&logoColor=ffffff)](https://www.paypal.com/paypalme/soywod) -[![ko-fi](https://img.shields.io/badge/-Ko--fi-ff5e5a?logo=Ko-fi&logoColor=ffffff)](https://ko-fi.com/soywod) -[![buy-me-a-coffee](https://img.shields.io/badge/-Buy%20Me%20a%20Coffee-ffdd00?logo=Buy%20Me%20A%20Coffee&logoColor=000000)](https://www.buymeacoffee.com/soywod) -[![liberapay](https://img.shields.io/badge/-Liberapay-f6c915?logo=Liberapay&logoColor=222222)](https://liberapay.com/soywod) - -## Credits - -- [IMAP RFC3501](https://tools.ietf.org/html/rfc3501) -- [Iris](https://github.com/soywod/iris.vim), the himalaya predecessor -- [isync](https://isync.sourceforge.io/), an email synchronizer for offline usage -- [NeoMutt](https://neomutt.org/), an email terminal user interface -- [Alpine](http://alpine.x10host.com/alpine/alpine-info/), an other email terminal user interface -- [mutt-wizard](https://github.com/LukeSmithxyz/mutt-wizard), a tool over NeoMutt and isync -- [rust-imap](https://github.com/jonhoo/rust-imap), a rust IMAP lib diff --git a/email-manager/tests/imap_test.rs b/email-manager/tests/imap_test.rs deleted file mode 100644 index bbd901c..0000000 --- a/email-manager/tests/imap_test.rs +++ /dev/null @@ -1,150 +0,0 @@ -// FIXME: fix tests -// use std::convert::TryFrom; - -// use himalaya::{ -// domain::account::entity::Account, flag::model::Flags, imap::model::ImapConnector, -// mbox::model::Mboxes, msg::model::Msgs, -// }; - -// use imap::types::Flag; - -// use lettre::message::SinglePart; -// use lettre::Message; - -// fn get_account(addr: &str) -> Account { -// Account { -// name: None, -// downloads_dir: None, -// signature_delimiter: None, -// signature: None, -// default_page_size: None, -// default: Some(true), -// email: addr.into(), -// watch_cmds: None, -// imap_host: String::from("localhost"), -// imap_port: 3993, -// imap_starttls: Some(false), -// imap_insecure: Some(true), -// imap_login: addr.into(), -// imap_passwd_cmd: String::from("echo 'password'"), -// smtp_host: String::from("localhost"), -// smtp_port: 3465, -// smtp_starttls: Some(false), -// smtp_insecure: Some(true), -// smtp_login: addr.into(), -// smtp_passwd_cmd: String::from("echo 'password'"), -// } -// } - -// #[test] -// fn mbox() { -// let account = get_account("inbox@localhost"); -// let mut imap_conn = ImapConnector::new(&account).unwrap(); -// let names = imap_conn.list_mboxes().unwrap(); -// let mboxes: Vec = Mboxes::from(&names) -// .0 -// .into_iter() -// .map(|mbox| mbox.name) -// .collect(); -// assert_eq!(mboxes, vec![String::from("INBOX")]); -// imap_conn.logout(); -// } - -// #[test] -// fn msg() { -// // Preparations - -// // Get the test-account and clean up the server. -// let account = get_account("inbox@localhost"); - -// // Login -// let mut imap_conn = ImapConnector::new(&account).unwrap(); - -// // remove all previous mails first -// let fetches = imap_conn.list_msgs("INBOX", &10, &0).unwrap(); -// let msgs = if let Some(ref fetches) = fetches { -// Msgs::try_from(fetches).unwrap() -// } else { -// Msgs::new() -// }; - -// // mark all mails as deleted -// for msg in msgs.0.iter() { -// imap_conn -// .add_flags( -// "INBOX", -// &msg.get_uid().unwrap().to_string(), -// Flags::from(vec![Flag::Deleted]), -// ) -// .unwrap(); -// } -// imap_conn.expunge("INBOX").unwrap(); - -// // make sure, that they are *really* deleted -// assert!(imap_conn.list_msgs("INBOX", &10, &0).unwrap().is_none()); - -// // == Testing == -// // Add messages -// let message_a = Message::builder() -// .from("sender-a@localhost".parse().unwrap()) -// .to("inbox@localhost".parse().unwrap()) -// .subject("Subject A") -// .singlepart(SinglePart::builder().body("Body A".as_bytes().to_vec())) -// .unwrap(); - -// let message_b = Message::builder() -// .from("Sender B ".parse().unwrap()) -// .to("inbox@localhost".parse().unwrap()) -// .subject("Subject B") -// .singlepart(SinglePart::builder().body("Body B".as_bytes().to_vec())) -// .unwrap(); - -// smtp::send(&account, &message_a).unwrap(); -// smtp::send(&account, &message_b).unwrap(); - -// // -- Get the messages -- -// // TODO: check non-existance of \Seen flag -// let msgs = imap_conn.list_msgs("INBOX", &10, &0).unwrap(); -// let msgs = if let Some(ref fetches) = msgs { -// Msgs::try_from(fetches).unwrap() -// } else { -// Msgs::new() -// }; - -// // make sure that there are both mails which we sended -// assert_eq!(msgs.0.len(), 2); - -// let msg_a = msgs -// .0 -// .iter() -// .find(|msg| msg.headers.subject.clone().unwrap() == "Subject A") -// .unwrap(); - -// let msg_b = msgs -// .0 -// .iter() -// .find(|msg| msg.headers.subject.clone().unwrap() == "Subject B") -// .unwrap(); - -// // -- Checkup -- -// // look, if we received the correct credentials of the msgs. -// assert_eq!( -// msg_a.headers.subject.clone().unwrap_or_default(), -// "Subject A" -// ); -// assert_eq!(&msg_a.headers.from[0], "sender-a@localhost"); - -// assert_eq!( -// msg_b.headers.subject.clone().unwrap_or_default(), -// "Subject B" -// ); -// assert_eq!(&msg_b.headers.from[0], "Sender B "); - -// // TODO: search messages -// // TODO: read message (+ \Seen flag) -// // TODO: list message attachments -// // TODO: add/set/remove flags - -// // Logout -// imap_conn.logout(); -// } diff --git a/email-manager/vim/plugin/himalaya.vim b/email-manager/vim/plugin/himalaya.vim deleted file mode 100644 index 5c0a85c..0000000 --- a/email-manager/vim/plugin/himalaya.vim +++ /dev/null @@ -1,19 +0,0 @@ -if exists("g:loaded_himalaya") - finish -endif - -if !executable("himalaya") - throw "Himalaya CLI not found, see https://github.com/soywod/himalaya#installation" -endif - -" Backup cpo -let s:cpo_backup = &cpo -set cpo&vim - -command! -nargs=* Himalaya call himalaya#msg#list() - -" Restore cpo -let &cpo = s:cpo_backup -unlet s:cpo_backup - -let g:loaded_himalaya = 1 diff --git a/email-synchronizer/Cargo.toml b/email-synchronizer/Cargo.toml deleted file mode 100644 index 7d72047..0000000 --- a/email-synchronizer/Cargo.toml +++ /dev/null @@ -1,6 +0,0 @@ -[package] -name = "himalaya-sync" -version = "0.1.0" -edition = "2018" - -[dependencies] diff --git a/email-synchronizer/README.md b/email-synchronizer/README.md deleted file mode 100644 index af5a45e..0000000 --- a/email-synchronizer/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# :mailbox: :repeat: Himalaya synchronizer - -TODO diff --git a/email-synchronizer/src/main.rs b/email-synchronizer/src/main.rs deleted file mode 100644 index 97de372..0000000 --- a/email-synchronizer/src/main.rs +++ /dev/null @@ -1,3 +0,0 @@ -fn main() { - unimplemented!("The email synchronizer is not implemented yet."); -} diff --git a/flake.nix b/flake.nix index f2a229f..3c72d89 100644 --- a/flake.nix +++ b/flake.nix @@ -1,5 +1,5 @@ { - description = "CLI email manager"; + description = "Command-line interface for email management"; inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; diff --git a/email-manager/src/compl/compl_arg.rs b/src/compl/compl_arg.rs similarity index 100% rename from email-manager/src/compl/compl_arg.rs rename to src/compl/compl_arg.rs diff --git a/email-manager/src/compl/compl_handler.rs b/src/compl/compl_handler.rs similarity index 100% rename from email-manager/src/compl/compl_handler.rs rename to src/compl/compl_handler.rs diff --git a/email-manager/src/compl/mod.rs b/src/compl/mod.rs similarity index 100% rename from email-manager/src/compl/mod.rs rename to src/compl/mod.rs diff --git a/email-manager/src/config/account_entity.rs b/src/config/account_entity.rs similarity index 100% rename from email-manager/src/config/account_entity.rs rename to src/config/account_entity.rs diff --git a/email-manager/src/config/config_arg.rs b/src/config/config_arg.rs similarity index 100% rename from email-manager/src/config/config_arg.rs rename to src/config/config_arg.rs diff --git a/email-manager/src/config/config_entity.rs b/src/config/config_entity.rs similarity index 100% rename from email-manager/src/config/config_entity.rs rename to src/config/config_entity.rs diff --git a/email-manager/src/config/mod.rs b/src/config/mod.rs similarity index 100% rename from email-manager/src/config/mod.rs rename to src/config/mod.rs diff --git a/email-manager/src/domain/imap/imap_arg.rs b/src/domain/imap/imap_arg.rs similarity index 100% rename from email-manager/src/domain/imap/imap_arg.rs rename to src/domain/imap/imap_arg.rs diff --git a/email-manager/src/domain/imap/imap_handler.rs b/src/domain/imap/imap_handler.rs similarity index 100% rename from email-manager/src/domain/imap/imap_handler.rs rename to src/domain/imap/imap_handler.rs diff --git a/email-manager/src/domain/imap/imap_service.rs b/src/domain/imap/imap_service.rs similarity index 100% rename from email-manager/src/domain/imap/imap_service.rs rename to src/domain/imap/imap_service.rs diff --git a/email-manager/src/domain/imap/mod.rs b/src/domain/imap/mod.rs similarity index 100% rename from email-manager/src/domain/imap/mod.rs rename to src/domain/imap/mod.rs diff --git a/email-manager/src/domain/mbox/attr_entity.rs b/src/domain/mbox/attr_entity.rs similarity index 100% rename from email-manager/src/domain/mbox/attr_entity.rs rename to src/domain/mbox/attr_entity.rs diff --git a/email-manager/src/domain/mbox/attrs_entity.rs b/src/domain/mbox/attrs_entity.rs similarity index 100% rename from email-manager/src/domain/mbox/attrs_entity.rs rename to src/domain/mbox/attrs_entity.rs diff --git a/email-manager/src/domain/mbox/mbox_arg.rs b/src/domain/mbox/mbox_arg.rs similarity index 100% rename from email-manager/src/domain/mbox/mbox_arg.rs rename to src/domain/mbox/mbox_arg.rs diff --git a/email-manager/src/domain/mbox/mbox_entity.rs b/src/domain/mbox/mbox_entity.rs similarity index 100% rename from email-manager/src/domain/mbox/mbox_entity.rs rename to src/domain/mbox/mbox_entity.rs diff --git a/email-manager/src/domain/mbox/mbox_handler.rs b/src/domain/mbox/mbox_handler.rs similarity index 100% rename from email-manager/src/domain/mbox/mbox_handler.rs rename to src/domain/mbox/mbox_handler.rs diff --git a/email-manager/src/domain/mbox/mboxes_entity.rs b/src/domain/mbox/mboxes_entity.rs similarity index 100% rename from email-manager/src/domain/mbox/mboxes_entity.rs rename to src/domain/mbox/mboxes_entity.rs diff --git a/email-manager/src/domain/mbox/mod.rs b/src/domain/mbox/mod.rs similarity index 100% rename from email-manager/src/domain/mbox/mod.rs rename to src/domain/mbox/mod.rs diff --git a/email-manager/src/domain/mod.rs b/src/domain/mod.rs similarity index 100% rename from email-manager/src/domain/mod.rs rename to src/domain/mod.rs diff --git a/email-manager/src/domain/msg/envelope_entity.rs b/src/domain/msg/envelope_entity.rs similarity index 100% rename from email-manager/src/domain/msg/envelope_entity.rs rename to src/domain/msg/envelope_entity.rs diff --git a/email-manager/src/domain/msg/envelopes_entity.rs b/src/domain/msg/envelopes_entity.rs similarity index 100% rename from email-manager/src/domain/msg/envelopes_entity.rs rename to src/domain/msg/envelopes_entity.rs diff --git a/email-manager/src/domain/msg/flag_arg.rs b/src/domain/msg/flag_arg.rs similarity index 100% rename from email-manager/src/domain/msg/flag_arg.rs rename to src/domain/msg/flag_arg.rs diff --git a/email-manager/src/domain/msg/flag_entity.rs b/src/domain/msg/flag_entity.rs similarity index 100% rename from email-manager/src/domain/msg/flag_entity.rs rename to src/domain/msg/flag_entity.rs diff --git a/email-manager/src/domain/msg/flag_handler.rs b/src/domain/msg/flag_handler.rs similarity index 100% rename from email-manager/src/domain/msg/flag_handler.rs rename to src/domain/msg/flag_handler.rs diff --git a/email-manager/src/domain/msg/flags_entity.rs b/src/domain/msg/flags_entity.rs similarity index 100% rename from email-manager/src/domain/msg/flags_entity.rs rename to src/domain/msg/flags_entity.rs diff --git a/email-manager/src/domain/msg/mod.rs b/src/domain/msg/mod.rs similarity index 100% rename from email-manager/src/domain/msg/mod.rs rename to src/domain/msg/mod.rs diff --git a/email-manager/src/domain/msg/msg_arg.rs b/src/domain/msg/msg_arg.rs similarity index 100% rename from email-manager/src/domain/msg/msg_arg.rs rename to src/domain/msg/msg_arg.rs diff --git a/email-manager/src/domain/msg/msg_entity.rs b/src/domain/msg/msg_entity.rs similarity index 100% rename from email-manager/src/domain/msg/msg_entity.rs rename to src/domain/msg/msg_entity.rs diff --git a/email-manager/src/domain/msg/msg_handler.rs b/src/domain/msg/msg_handler.rs similarity index 100% rename from email-manager/src/domain/msg/msg_handler.rs rename to src/domain/msg/msg_handler.rs diff --git a/email-manager/src/domain/msg/msg_utils.rs b/src/domain/msg/msg_utils.rs similarity index 100% rename from email-manager/src/domain/msg/msg_utils.rs rename to src/domain/msg/msg_utils.rs diff --git a/email-manager/src/domain/msg/parts_entity.rs b/src/domain/msg/parts_entity.rs similarity index 100% rename from email-manager/src/domain/msg/parts_entity.rs rename to src/domain/msg/parts_entity.rs diff --git a/email-manager/src/domain/msg/tpl_arg.rs b/src/domain/msg/tpl_arg.rs similarity index 100% rename from email-manager/src/domain/msg/tpl_arg.rs rename to src/domain/msg/tpl_arg.rs diff --git a/email-manager/src/domain/msg/tpl_handler.rs b/src/domain/msg/tpl_handler.rs similarity index 100% rename from email-manager/src/domain/msg/tpl_handler.rs rename to src/domain/msg/tpl_handler.rs diff --git a/email-manager/src/domain/smtp/mod.rs b/src/domain/smtp/mod.rs similarity index 100% rename from email-manager/src/domain/smtp/mod.rs rename to src/domain/smtp/mod.rs diff --git a/email-manager/src/domain/smtp/smtp_service.rs b/src/domain/smtp/smtp_service.rs similarity index 100% rename from email-manager/src/domain/smtp/smtp_service.rs rename to src/domain/smtp/smtp_service.rs diff --git a/email-manager/src/main.rs b/src/main.rs similarity index 100% rename from email-manager/src/main.rs rename to src/main.rs diff --git a/email-manager/src/output/mod.rs b/src/output/mod.rs similarity index 100% rename from email-manager/src/output/mod.rs rename to src/output/mod.rs diff --git a/email-manager/src/output/output_arg.rs b/src/output/output_arg.rs similarity index 100% rename from email-manager/src/output/output_arg.rs rename to src/output/output_arg.rs diff --git a/email-manager/src/output/output_entity.rs b/src/output/output_entity.rs similarity index 100% rename from email-manager/src/output/output_entity.rs rename to src/output/output_entity.rs diff --git a/email-manager/src/output/output_utils.rs b/src/output/output_utils.rs similarity index 100% rename from email-manager/src/output/output_utils.rs rename to src/output/output_utils.rs diff --git a/email-manager/src/output/print.rs b/src/output/print.rs similarity index 100% rename from email-manager/src/output/print.rs rename to src/output/print.rs diff --git a/email-manager/src/output/print_table.rs b/src/output/print_table.rs similarity index 100% rename from email-manager/src/output/print_table.rs rename to src/output/print_table.rs diff --git a/email-manager/src/output/printer_service.rs b/src/output/printer_service.rs similarity index 100% rename from email-manager/src/output/printer_service.rs rename to src/output/printer_service.rs diff --git a/email-manager/src/ui/choice.rs b/src/ui/choice.rs similarity index 100% rename from email-manager/src/ui/choice.rs rename to src/ui/choice.rs diff --git a/email-manager/src/ui/editor.rs b/src/ui/editor.rs similarity index 100% rename from email-manager/src/ui/editor.rs rename to src/ui/editor.rs diff --git a/email-manager/src/ui/mod.rs b/src/ui/mod.rs similarity index 100% rename from email-manager/src/ui/mod.rs rename to src/ui/mod.rs diff --git a/email-manager/src/ui/table.rs b/src/ui/table.rs similarity index 100% rename from email-manager/src/ui/table.rs rename to src/ui/table.rs diff --git a/email-manager/src/ui/table_arg.rs b/src/ui/table_arg.rs similarity index 100% rename from email-manager/src/ui/table_arg.rs rename to src/ui/table_arg.rs diff --git a/task-manager/Cargo.toml b/task-manager/Cargo.toml deleted file mode 100644 index f4229b4..0000000 --- a/task-manager/Cargo.toml +++ /dev/null @@ -1,6 +0,0 @@ -[package] -name = "lhotse" -version = "0.1.0" -edition = "2018" - -[dependencies] diff --git a/task-manager/README.md b/task-manager/README.md deleted file mode 100644 index 96ed25e..0000000 --- a/task-manager/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# :stopwatch: Lhotse - -TODO diff --git a/task-manager/src/main.rs b/task-manager/src/main.rs deleted file mode 100644 index e7a11a9..0000000 --- a/task-manager/src/main.rs +++ /dev/null @@ -1,3 +0,0 @@ -fn main() { - println!("Hello, world!"); -} diff --git a/task-synchronizer/Cargo.toml b/task-synchronizer/Cargo.toml deleted file mode 100644 index 4d7bb86..0000000 --- a/task-synchronizer/Cargo.toml +++ /dev/null @@ -1,6 +0,0 @@ -[package] -name = "lhotse-sync" -version = "0.1.0" -edition = "2018" - -[dependencies] diff --git a/task-synchronizer/README.md b/task-synchronizer/README.md deleted file mode 100644 index c290b78..0000000 --- a/task-synchronizer/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# :stopwatch: :repeat: Lhotse synchronizer - -TODO diff --git a/task-synchronizer/src/main.rs b/task-synchronizer/src/main.rs deleted file mode 100644 index e7a11a9..0000000 --- a/task-synchronizer/src/main.rs +++ /dev/null @@ -1,3 +0,0 @@ -fn main() { - println!("Hello, world!"); -} diff --git a/email-manager/vim/README.md b/vim/README.md similarity index 98% rename from email-manager/vim/README.md rename to vim/README.md index b7d160a..8dd2abe 100644 --- a/email-manager/vim/README.md +++ b/vim/README.md @@ -8,7 +8,7 @@ this plugin with your favorite plugin manager. For example with [vim-plug](https://github.com/junegunn/vim-plug), add to your `.vimrc`: ```viml -Plug 'soywod/himalaya', {'rtp': 'email-manager/vim'} +Plug 'soywod/himalaya', {'rtp': 'vim'} ``` Then: diff --git a/email-manager/vim/autoload/himalaya/account.vim b/vim/autoload/himalaya/account.vim similarity index 100% rename from email-manager/vim/autoload/himalaya/account.vim rename to vim/autoload/himalaya/account.vim diff --git a/email-manager/vim/autoload/himalaya/mbox.vim b/vim/autoload/himalaya/mbox.vim similarity index 100% rename from email-manager/vim/autoload/himalaya/mbox.vim rename to vim/autoload/himalaya/mbox.vim diff --git a/email-manager/vim/autoload/himalaya/msg.vim b/vim/autoload/himalaya/msg.vim similarity index 100% rename from email-manager/vim/autoload/himalaya/msg.vim rename to vim/autoload/himalaya/msg.vim diff --git a/email-manager/vim/autoload/himalaya/request.vim b/vim/autoload/himalaya/request.vim similarity index 100% rename from email-manager/vim/autoload/himalaya/request.vim rename to vim/autoload/himalaya/request.vim diff --git a/email-manager/vim/autoload/himalaya/shared/bindings.vim b/vim/autoload/himalaya/shared/bindings.vim similarity index 100% rename from email-manager/vim/autoload/himalaya/shared/bindings.vim rename to vim/autoload/himalaya/shared/bindings.vim diff --git a/email-manager/vim/autoload/himalaya/shared/cli.vim b/vim/autoload/himalaya/shared/cli.vim similarity index 100% rename from email-manager/vim/autoload/himalaya/shared/cli.vim rename to vim/autoload/himalaya/shared/cli.vim diff --git a/email-manager/vim/autoload/himalaya/shared/log.vim b/vim/autoload/himalaya/shared/log.vim similarity index 100% rename from email-manager/vim/autoload/himalaya/shared/log.vim rename to vim/autoload/himalaya/shared/log.vim diff --git a/email-manager/vim/autoload/himalaya/shared/thread.vim b/vim/autoload/himalaya/shared/thread.vim similarity index 100% rename from email-manager/vim/autoload/himalaya/shared/thread.vim rename to vim/autoload/himalaya/shared/thread.vim diff --git a/email-manager/vim/autoload/himalaya/shared/utils.vim b/vim/autoload/himalaya/shared/utils.vim similarity index 100% rename from email-manager/vim/autoload/himalaya/shared/utils.vim rename to vim/autoload/himalaya/shared/utils.vim diff --git a/email-manager/vim/doc/himalaya.txt b/vim/doc/himalaya.txt similarity index 98% rename from email-manager/vim/doc/himalaya.txt rename to vim/doc/himalaya.txt index 5804a12..128fc16 100644 --- a/email-manager/vim/doc/himalaya.txt +++ b/vim/doc/himalaya.txt @@ -1,4 +1,4 @@ -*himalaya.txt* - CLI email manager +*himalaya.txt* - Command-line interface for email management _/ _/ _/_/_/ _/ _/ _/_/ _/ _/_/ _/ _/ _/_/ _/ _/ _/ _/_/ _/_/ _/ _/ _/ _/ _/ _/ _/ _/ _/ diff --git a/email-manager/vim/ftplugin/himalaya-msg-list.vim b/vim/ftplugin/himalaya-msg-list.vim similarity index 100% rename from email-manager/vim/ftplugin/himalaya-msg-list.vim rename to vim/ftplugin/himalaya-msg-list.vim diff --git a/email-manager/vim/ftplugin/himalaya-msg-read.vim b/vim/ftplugin/himalaya-msg-read.vim similarity index 100% rename from email-manager/vim/ftplugin/himalaya-msg-read.vim rename to vim/ftplugin/himalaya-msg-read.vim diff --git a/email-manager/vim/ftplugin/himalaya-msg-write.vim b/vim/ftplugin/himalaya-msg-write.vim similarity index 100% rename from email-manager/vim/ftplugin/himalaya-msg-write.vim rename to vim/ftplugin/himalaya-msg-write.vim diff --git a/email-manager/vim/lua/himalaya/mbox.lua b/vim/lua/himalaya/mbox.lua similarity index 100% rename from email-manager/vim/lua/himalaya/mbox.lua rename to vim/lua/himalaya/mbox.lua diff --git a/vim/plugin/himalaya.vim b/vim/plugin/himalaya.vim index a4523f0..5c0a85c 100644 --- a/vim/plugin/himalaya.vim +++ b/vim/plugin/himalaya.vim @@ -1 +1,19 @@ -echoerr 'Cannot load himalaya: please change the rtp path from "vim" to "email-manager/vim" (https://github.com/soywod/himalaya/tree/development/email-manager/vim).' +if exists("g:loaded_himalaya") + finish +endif + +if !executable("himalaya") + throw "Himalaya CLI not found, see https://github.com/soywod/himalaya#installation" +endif + +" Backup cpo +let s:cpo_backup = &cpo +set cpo&vim + +command! -nargs=* Himalaya call himalaya#msg#list() + +" Restore cpo +let &cpo = s:cpo_backup +unlet s:cpo_backup + +let g:loaded_himalaya = 1 diff --git a/email-manager/vim/syntax/himalaya-msg-list.vim b/vim/syntax/himalaya-msg-list.vim similarity index 100% rename from email-manager/vim/syntax/himalaya-msg-list.vim rename to vim/syntax/himalaya-msg-list.vim