Compare commits
2 Commits
36687b2f3c
...
2dc143a839
Author | SHA1 | Date | |
---|---|---|---|
2dc143a839 | |||
5c62ff219c |
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,3 +1,3 @@
|
||||
# Ignore all plugin files in subdirectories
|
||||
*/
|
||||
zsh-*/
|
||||
local
|
||||
|
99
tasks.yaml
99
tasks.yaml
@ -1,99 +0,0 @@
|
||||
---
|
||||
- name: zsh install packages
|
||||
become: '{{package_become}}'
|
||||
package:
|
||||
name: zsh
|
||||
state: present
|
||||
|
||||
- name: zsh install Debian packages
|
||||
when: ansible_os_family == "Debian"
|
||||
become: true
|
||||
apt:
|
||||
name:
|
||||
- pinentry-curses
|
||||
- silversearcher-ag
|
||||
- unzip
|
||||
- zsh-doc
|
||||
state: present
|
||||
|
||||
- name: zsh install macOS packages
|
||||
when: ansible_os_family == "Darwin"
|
||||
become: false
|
||||
homebrew:
|
||||
name: the_silver_searcher
|
||||
state: present
|
||||
|
||||
- name: zsh clone plugin repos
|
||||
git:
|
||||
repo: '{{item.repo}}'
|
||||
dest: '{{item.dest}}'
|
||||
with_items:
|
||||
- repo: https://github.com/zsh-users/zsh-autosuggestions.git
|
||||
dest: ~/.config/zsh/zsh-autosuggestions
|
||||
- repo: https://github.com/zsh-users/zsh-history-substring-search.git
|
||||
dest: ~/.config/zsh/zsh-history-substring-search
|
||||
- repo: https://github.com/zsh-users/zsh-syntax-highlighting.git
|
||||
dest: ~/.config/zsh/zsh-syntax-highlighting
|
||||
- repo: https://github.com/zsh-users/zsh-completions.git
|
||||
dest: ~/.config/zsh/zsh-completions
|
||||
- repo: https://github.com/junegunn/fzf.git
|
||||
dest: ~/.config/zsh/fzf
|
||||
|
||||
- name: zsh install fzf binaries
|
||||
command:
|
||||
cmd: ~/.config/zsh/fzf/install --bin
|
||||
creates: ~/.config/zsh/fzf/bin/fzf
|
||||
|
||||
- name: zsh create directories
|
||||
file:
|
||||
state: directory
|
||||
dest: '{{item}}'
|
||||
with_items:
|
||||
- ~/.local/bin
|
||||
- ~/.local/share/zsh/site-functions
|
||||
|
||||
- name: zsh create symbolic links
|
||||
file:
|
||||
state: link
|
||||
src: '{{item.src}}'
|
||||
dest: '{{item.dest}}'
|
||||
with_items:
|
||||
- src: ~/.config/zsh/zlogin
|
||||
dest: ~/.zlogin
|
||||
- src: ~/.config/zsh/zlogout
|
||||
dest: ~/.zlogout
|
||||
- src: ~/.config/zsh/zprofile
|
||||
dest: ~/.zprofile
|
||||
- src: ~/.config/zsh/zshenv
|
||||
dest: ~/.zshenv
|
||||
- src: ~/.config/zsh/zshrc
|
||||
dest: ~/.zshrc
|
||||
- src: ~/.config/zsh/prompt_fresh_setup
|
||||
dest: ~/.local/share/zsh/site-functions/prompt_fresh_setup
|
||||
- src: ~/.config/zsh/build/_build-dir
|
||||
dest: ~/.local/share/zsh/site-functions/_build-dir
|
||||
- src: ~/.config/zsh/sandbox/_sandbox
|
||||
dest: ~/.local/share/zsh/site-functions/_sandbox
|
||||
- src: ~/.config/zsh/layout/_layout
|
||||
dest: ~/.local/share/zsh/site-functions/_layout
|
||||
- src: ~/.config/zsh/notes/_note
|
||||
dest: ~/.local/share/zsh/site-functions/_note
|
||||
- src: ~/.config/zsh/fzf/bin/fzf
|
||||
dest: ~/.local/bin/fzf
|
||||
- src: ~/.config/zsh/fzf/bin/fzf-tmux
|
||||
dest: ~/.local/bin/fzf-tmux
|
||||
- src: ~/.config/zsh/cmake-uninstall
|
||||
dest: ~/.local/bin/cmake-uninstall
|
||||
- src: ~/.config/zsh/$
|
||||
dest: ~/.local/bin/$
|
||||
|
||||
- name: zsh get absolute path
|
||||
shell: command -v zsh
|
||||
register: zsh
|
||||
changed_when: false
|
||||
|
||||
- name: zsh set default shell
|
||||
user:
|
||||
name: '{{lookup("env", "USER")}}'
|
||||
shell: '{{zsh.stdout}}'
|
||||
become: true
|
22
url/_url
Normal file
22
url/_url
Normal file
@ -0,0 +1,22 @@
|
||||
#compdef url
|
||||
|
||||
_url() {
|
||||
local ret=1 context curcontext="$curcontext" state line
|
||||
typeset -A opt_args
|
||||
|
||||
_arguments -C -w -s \
|
||||
'(-h --help)'{-h,--help}'[show this help message and exit]' \
|
||||
'1: :->command'
|
||||
|
||||
case $state in
|
||||
(command)
|
||||
declare -a commands
|
||||
local commands=(
|
||||
encode:'encode unencoded text'
|
||||
decode:'decode encoded text'
|
||||
)
|
||||
_describe -t commands command commands && ret=0 ;;
|
||||
esac
|
||||
|
||||
return ret
|
||||
}
|
22
url/url
Executable file
22
url/url
Executable file
@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
from argparse import ArgumentParser
|
||||
from urllib import parse
|
||||
|
||||
|
||||
def main():
|
||||
cli = ArgumentParser(description=__doc__)
|
||||
cli.add_argument('command', choices=['encode', 'decode'])
|
||||
cli.add_argument('text')
|
||||
args = cli.parse_args()
|
||||
print({
|
||||
'encode': parse.quote_plus,
|
||||
'decode': parse.unquote_plus,
|
||||
}[args.command](args.text))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
main()
|
||||
except KeyboardInterrupt:
|
||||
exit(130)
|
Loading…
x
Reference in New Issue
Block a user