Skip to content

enrongtsai/dotfiles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Intro

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.

Useful utils

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.
  • 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)
  • 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
  • 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)
  • 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

Screenshot

Usage

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

Requirements

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 '...'

Useful plugins

vim

tmux

About

A set of vim, tmux, git, and bash configuration files.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published