This repository keeps my Vim settings, Tmux configuration and other dotfiles. The configuration implements an IDE like python development environment on a terminal, which benefits cross-platform development on localhost and remote machines using SSH.
Note:
The default Vim <Leader>
is \
, and the default Tmux prefix
is Ctrl-b
.
-
A persist history autosave workspace between sessions by self defined function and thaerkh/vim-workspace plugin.
- Leaving Vim with
<Leader>
+q
(auto-create if workspace hasn't create) - Create/Remove workspace with
<Leader>
+s
- Entering workspace with only
vim
command in the workspace directory.
- Leaving Vim with
-
A self defined Vim command to save & execute current python file in a new create horizontal tmux pane by using benmills/vimux plugin.
- save & execute current python file in a specified Conda env with
<Leader>
+p
(To change the execute environment, please reconfig the command in.vimrc
)
- save & execute current python file in a specified Conda env with
-
A self defined Tmux command to toggle a new window with
nvidia-smi
&htop
splits for monitor GPU, CPU and RAM usage. Useful system-status monitor while training models.- Toggle a new window for monitor system-status with
prefix
+W
- Toggle a new window for monitor system-status with
-
Continuous saving of Tmux environment using tmux-plugins/tmux-resurrect & tmux-plugins/tmux-continuum, when remote machines encounter an unexpected shutdown it will automatically restore the environment when Tmux started.
- Config the save interval with
set -g @continuum-save-interval '15'
in~/.tmux.conf
. (default, 15 minutes)
- Config the save interval with
-
Seamless navigation between tmux panes and vim splits using christoomey/vim-tmux-navigator
<ctrl-h>
=> Left<ctrl-j>
=> Down<ctrl-k>
=> Up<ctrl-l>
=> Right<ctrl-\>
=> Previous split
To automatically distribute dotfiles, clone this repo by following steps:
$ git clone --bare <https://github.com/enrongtsai/dotfiles.git> $HOME/.cfg
$ echo ".cfg" >> .gitignore
$ alias config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'
$ config checkout
$ config config --local status.showUntrackedFiles no
Note 1: If your $HOME folder already have some stock configuration files which would be overwritten by Git, back up the offending files to a backup folder by following scripts:
$ mkdir -p .config-backup && \
config checkout 2>&1 | egrep "\s+\." | awk {'print $1'} | \
xargs -I{} mv {} .config-backup/{}
Note 2:
You can add the alias definition to your .bashrc
by following scripts:
echo "alias config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'" >> $HOME/.bashrc
Install plugins via vim-plug
Reload .vimrc and :PlugInstall
to install plugins.
Note:
You can add new plugin to ~/.vimrc
with Plug '.../...'
between call plug#begin()
and call plug#end()
.
Install plugins via TPM
Installs and loads tmux
plugins:
- Reload TMUX environment press
prefix
+r
- Install plugins press
prefix
+I
- Update plugins press
prefix
+U
- Uninstall plugins not on the plugin list press
prefix
+alt
+u
Note:
You can add new plugin to ~/.tmux.conf
with set -g @plugin '...'
- neoclide/coc.nvim
- dense-analysis/ale
- cjrh/vim-conda
- junegunn/fzf
- junegunn/fzf.vim
- sainnhe/sonokai
- ryanoasis/vim-devicons
- yggdroot/indentline
- sainnhe/tmuxline.vim
- christoomey/vim-tmux-navigator
- scrooloose/nerdtree
- jistr/vim-nerdtree-tabs
- itchyny/lightline.vim
- itchyny/vim-gitbranch
- macthecadillac/lightline-gitdiff
- maximbaz/lightline-ale
- benmills/vimux
- easymotion/vim-easymotion
- tpope/vim-commentary
- tpope/vim-surround
- romainl/vim-cool
- thaerkh/vim-workspace
- jiangmiao/auto-pairs
- vim-python/python-syntax
- jeetsukumaran/vim-pythonsense
- heavenshell/vim-pydocstring
- tmhedberg/SimpylFold
- liuchengxu/vista.vim