Mostly I use a single termux tab to open tmux, and launch everything in that tmux.
zsh - shell
nvim - file editor, makrdown/vimwiki
ranger - file manager
newsboat - RSS subscription (news, blog, youtube, reddit, github)
After installation, use tmux-launcher
in zsh to start
Personally, I use termux to:
- Pull and test code (golang/shell scripts mostly); fix bugs and commit.
- Login to remote machines (zsh → SSH)
- Write some quick markdown notes (vimwiki + markdown plugins) and render in browser
- Preview RSS feeds and open them in browser/newpipe/reddit app
- termux widget shortcuts (on android launcher screen)
- bin/tmux-launcher script (in tmux)
- touch/click on tmux tab (only for switching)
- ranger (open files in vim or start zsh)
I use termux-widget for shortcuts, corresponding to the apps listed above. Apps can be opened and closed in any order, and their tmux tabs will be put in a pre-defined order. The shortcut scripts have to run in the foreground to bring Termux app to foreground with a new tab. They finishes instantly so termux switches back to the last tab which is tmux. The tmux tab/window would have been changed to the desired app already.
Before you begin, install termux:style. Choose any powerline font as you wish; personally I use Meslo. In termux, long press and release → More... → Style → CHOOSE FONT → Meslo.
pkg install git tmux neovim zsh ranger newsboat fzf fasd bat curl
Change zsh to your default shell:
chsh -s zsh
exit, open termux again and you should be in zsh instead of bash
oh-my-zsh should be installed before copying the dotfiles.
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
git clone https://github.com/zdharma/fast-syntax-highlighting.git \
~ZSH_CUSTOM/plugins/fast-syntax-highlighting
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
zsh plugins can slow down your shell prompt a bit; consider removing them from .zshrc plugins=(...) if it is too slow for you.
(I cannot find the source for zle-vi-visual at the mean while. I think it was made back in the days when zsh didn't support vi visual mode or text objects properly. I will find a way to upload it or just remove it from .zshrc.)
If you already have any of the dotfiles, just backup or merge the files before continuing.
git clone https://github.com/sangowen/termux-dotfiles
cd termux-dotfiles/
cp -r .config .fzf .newsboat .shortcuts .termux .tmux-themepack .tmux.conf .zshrc .profile bin ../
cp .oh-my-zsh/themes/gruvbox.zsh-theme ~/.oh-my-zsh/themes/gruvbox.zsh-theme
cd data/data/com.termux/files/usr/etc
cp zprofile profile zshrc /data/data/com.termux/files/usr/etc/
general:
- vi key binding for most of the components.
tmux:
- Other than the
ctrl+b
default prefix, I set backtick as my secondary prefix. The backtick key can then be put in extra-keys.
ranger:
- s for zsh in current folder
- → or on files to edit in neovim
- z is fasd, jump around recently/frequently visited folers
- bat for file preview
zsh:
- qq for quit