Add configs to setup a new machine

This commit is contained in:
D-X-Y 2021-02-24 00:41:03 -08:00
parent e8ab4c0885
commit c3e12956ae
5 changed files with 337 additions and 0 deletions

View File

@ -0,0 +1,137 @@
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
# append to the history file, don't overwrite it
shopt -s histappend
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
# If set, the pattern "**" used in a pathname expansion context will
# match all files and zero or more directories and subdirectories.
#shopt -s globstar
# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi
# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm-color|*-256color) color_prompt=yes;;
esac
# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
#force_color_prompt=yes
if [ -n "$force_color_prompt" ]; then
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
# We have color support; assume it's compliant with Ecma-48
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
# a case would tend to support setf rather than setaf.)
color_prompt=yes
else
color_prompt=
fi
fi
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt
# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
;;
*)
;;
esac
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi
# colored GCC warnings and errors
#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
# Add an "alert" alias for long running commands. Use like so:
# sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi
# DXY personalized enviornment
export TORCH_HOME="$HOME/.torch"
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/home/v-xuanyidong/miniconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/home/v-xuanyidong/miniconda3/etc/profile.d/conda.sh" ]; then
. "/home/v-xuanyidong/miniconda3/etc/profile.d/conda.sh"
else
export PATH="/home/v-xuanyidong/miniconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<

View File

@ -0,0 +1,11 @@
#!/bin/bash
script=$(readlink -f "$0")
script_dir=$(dirname "$script")
echo "script-directory: $script_dir"
cp ${script_dir}/tmux.conf ~/.tmux.conf
cp ${script_dir}/vimrc ~/.vimrc
wget https://repo.anaconda.com/miniconda/Miniconda3-4.7.12.1-Linux-x86_64.sh

View File

@ -0,0 +1,124 @@
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-q
bind-key C-q send-prefix
# reload config file (change file location to your the tmux.conf you want to use)
bind r source-file ~/.tmux.conf
# switch panes using Alt-arrow without prefix
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# Enable mouse control (clickable windows, panes, resizable panes)
# set -g mouse on
# don't rename windows automatically
set-option -g allow-rename off
# change the path
set -g status-left '#{pane_current_path}'
#bind '"' split-window -c "#{pane_current_path}"
#bind % split-window -h -c "#{pane_current_path}"
#bind c new-window -c "#{pane_current_path}"
######################
### DESIGN CHANGES ###
######################
# panes
set -g pane-border-fg black
set -g pane-active-border-fg brightred
## Status bar design
# status line
# set -g status-utf8 on
set -g status-justify left
set -g status-bg default
set -g status-fg colour12
set -g status-interval 2
# messaging
set -g message-fg black
set -g message-bg yellow
set -g message-command-fg blue
set -g message-command-bg black
#window mode
setw -g mode-bg colour6
setw -g mode-fg colour0
# window status
setw -g window-status-format " #F#I:#W#F "
setw -g window-status-current-format " #F#I:#W#F "
setw -g window-status-format "#[fg=magenta]#[bg=black] #I #[bg=cyan]#[fg=colour8] #W "
setw -g window-status-current-format "#[bg=brightmagenta]#[fg=colour8] #I #[fg=colour8]#[bg=colour14] #W "
setw -g window-status-current-bg colour0
setw -g window-status-current-fg colour11
setw -g window-status-current-attr dim
setw -g window-status-bg green
setw -g window-status-fg black
setw -g window-status-attr reverse
# Info on left (I don't have a session display for now)
set -g status-left ''
# loud or quiet?
set-option -g visual-activity off
set-option -g visual-bell off
set-option -g visual-silence off
set-window-option -g monitor-activity off
set-option -g bell-action none
set -g default-terminal "screen-256color"
# The modes {
setw -g clock-mode-colour colour135
setw -g mode-attr bold
setw -g mode-fg colour196
setw -g mode-bg colour238
# }
# The panes {
set -g pane-border-bg colour235
set -g pane-border-fg colour238
set -g pane-active-border-bg colour236
set -g pane-active-border-fg colour51
# }
# The statusbar {
set -g status-position bottom
set -g status-bg colour234
set -g status-fg colour137
set -g status-attr dim
set -g status-left ''
set -g status-right '#[fg=colour233,bg=colour241,bold] %d/%m #[fg=colour233,bg=colour245,bold] %H:%M:%S '
set -g status-right-length 50
set -g status-left-length 20
setw -g window-status-current-fg colour81
setw -g window-status-current-bg colour238
setw -g window-status-current-attr bold
setw -g window-status-current-format ' #I#[fg=colour250]:#[fg=colour255]#W#[fg=colour50]#F '
setw -g window-status-fg colour138
setw -g window-status-bg colour235
setw -g window-status-attr none
setw -g window-status-format ' #I#[fg=colour237]:#[fg=colour250]#W#[fg=colour244]#F '
setw -g window-status-bell-attr bold
setw -g window-status-bell-fg colour255
setw -g window-status-bell-bg colour1
# }
# The messages {
set -g message-attr bold
set -g message-fg colour232
set -g message-bg colour166
# }

View File

@ -0,0 +1,63 @@
color desert
"设置背景色每种配色有两种方案一个light、一个dark
"set background=light
""打开语法高亮
syntax enable
set background=dark
"colorscheme solarized
colorscheme desert
let g:solarized_termcolors=256
if has('gui_running')
set background=light
else
set background=dark
endif
"显示行号
"set number
""设置缩进有三个取值cindent(c风格)、smartindent(智能模式,其实不觉得有什么智能)、autoindent(简单的与上一行保持一致)
set cindent
"在windows版本中vim的退格键模式默认与vi兼容与我们的使用习惯不太符合下边这条可以改过来
"set backspace=indent,eol,start
""用空格键替换制表符
"set expandtab
"制表符占4个空格
"set tabstop=4
""默认缩进4个空格大小
"set shiftwidth=4
"增量式搜索
"set incsearch
""高亮搜索
set hlsearch
set statusline=[%F]%y%r%m%*%=[Line:%l/%L,Column:%c][%p%%]
set laststatus=2
set ruler
"有时中文会显示乱码,用一下几条命令解决
"let &termencoding=&encoding
"set fileencodings=utf-8,gbk
""很多插件都会要求的配置检测文件类型
:filetype on
:filetype plugin on
:filetype indent on
"下边这个很有用可以根据不同的文件类型执行不同的命令
""例如如果是c/c++类型
:autocmd FileType c,cpp,cuda :set foldmethod=syntax
:autocmd FileType c,cpp,cuda :set number
:autocmd FileType c,cpp,cuda :set cindent
:autocmd FileType c,cpp,cuda :set expandtab
:autocmd FileType c,cpp,cuda :set tabstop=4
:autocmd FileType c,cpp,cuda :set shiftwidth=4
"例如如果是python类型
:autocmd FileType python :set number
:autocmd FileType python :set foldmethod=syntax
:autocmd FileType python :set paste
:autocmd FileType python :set expandtab
:autocmd FileType python :set tabstop=2
:autocmd FileType python :set shiftwidth=2
"例如如果是python类型
:autocmd FileType matlab :set number
:autocmd FileType matlab :set foldmethod=syntax
:autocmd FileType matlab :set paste
:autocmd FileType matlab :set expandtab
:autocmd FileType matlab :set tabstop=2
:autocmd FileType matlab :set shiftwidth=2

View File

@ -21,6 +21,8 @@ This project implemented several neural architecture search (NAS) and hyper-para
- Active maintenance - Active maintenance
`git clone --recursive git@github.com:D-X-Y/Auto-Qlib.git`
## AutoDL-Projects Capabilities ## AutoDL-Projects Capabilities
At this moment, this project provides the following algorithms and scripts to run them. Please see the details in the link provided in the description column. At this moment, this project provides the following algorithms and scripts to run them. Please see the details in the link provided in the description column.