Add copy_dotfiles script and other things
This commit is contained in:
		
							
								
								
									
										1
									
								
								.config/nvim/init.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								.config/nvim/init.lua
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
				
			|||||||
 | 
					print("print from init.lua file")
 | 
				
			||||||
							
								
								
									
										27
									
								
								.config/tmux/tmux.conf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								.config/tmux/tmux.conf
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,27 @@
 | 
				
			|||||||
 | 
					set -g default-terminal "tmux-255color"
 | 
				
			||||||
 | 
					set -s escape-time 0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					unbind C-b
 | 
				
			||||||
 | 
					set-option -g prefix C-a
 | 
				
			||||||
 | 
					bind-key C-a send-prefix
 | 
				
			||||||
 | 
					set -g status-style 'bg=#333333 fg=#5eacd3'
 | 
				
			||||||
 | 
					set -g base-index 1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					set-window-option -g mode-keys vi
 | 
				
			||||||
 | 
					bind -T copy-mode-vi v send-keys -X begin-selection
 | 
				
			||||||
 | 
					bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# vim-like pane switching
 | 
				
			||||||
 | 
					bind -r ^ last-window
 | 
				
			||||||
 | 
					bind -r k select-pane -U
 | 
				
			||||||
 | 
					bind -r j select-pane -D
 | 
				
			||||||
 | 
					bind -r h select-pane -L
 | 
				
			||||||
 | 
					bind -r l select-pane -R
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					bind -r D neww -c "#{pane_current_path}" "[[ -e TODO.md ]] && nvim TODO.md || nvim ~/personal/dev/todo.md"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					bind r source-file "~/.config/tmux/tmux.conf" \; display-message "tmux.conf reloaded"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# forget the find window.  That is for chumps
 | 
				
			||||||
 | 
					bind-key -r f run-shell "tmux neww ~/.local/bin/tmux-sessionizer"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
							
								
								
									
										55
									
								
								copy_dotfiles
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										55
									
								
								copy_dotfiles
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,55 @@
 | 
				
			|||||||
 | 
					#!/bin/zsh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					dry="0"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					execute() {
 | 
				
			||||||
 | 
					    log "execute $@"
 | 
				
			||||||
 | 
					    if [[ $dry != "1" ]]; then
 | 
				
			||||||
 | 
					        "$@"
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					log() {
 | 
				
			||||||
 | 
					    if [[ $dry != "1" ]]; then
 | 
				
			||||||
 | 
					        echo "$@"
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        echo "[DRY RUN]: $@"
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					while [[ $# > 0 ]]; do
 | 
				
			||||||
 | 
					    if [[ $1 == "--dry" ]]; then
 | 
				
			||||||
 | 
					        dry="1"
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					    shift
 | 
				
			||||||
 | 
					done
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					log "---------------- dotfiles ----------------"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					copy_dir() {
 | 
				
			||||||
 | 
					    from=$1
 | 
				
			||||||
 | 
					    to=$2
 | 
				
			||||||
 | 
					    pushd $from > /dev/null
 | 
				
			||||||
 | 
					    dirs=(`find . -mindepth 1 -maxdepth 1 -type d`)
 | 
				
			||||||
 | 
					    echo $dirs
 | 
				
			||||||
 | 
					    for dir in $dirs; do
 | 
				
			||||||
 | 
					        if [[ -d $to/$dir ]]; then
 | 
				
			||||||
 | 
					            execute rm -rf $to/$dir
 | 
				
			||||||
 | 
					        fi
 | 
				
			||||||
 | 
					        execute cp -rp $dir $to/$dir
 | 
				
			||||||
 | 
					    done
 | 
				
			||||||
 | 
					    popd > /dev/null
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					copy_file() {
 | 
				
			||||||
 | 
					    from=$1
 | 
				
			||||||
 | 
					    to=$2
 | 
				
			||||||
 | 
					    filename=$(basename $from)
 | 
				
			||||||
 | 
					    if [[ -e $to/$filename ]]; then
 | 
				
			||||||
 | 
					        execute rm $to/$filename
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					    execute cp -p $from $to/$filename
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					copy_dir .config $HOME/.config
 | 
				
			||||||
 | 
					# copy_file .zxcv $HOME
 | 
				
			||||||
							
								
								
									
										5
									
								
								pre_run_01
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										5
									
								
								pre_run_01
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,5 @@
 | 
				
			|||||||
 | 
					#!/bin/zsh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if [[ ! -d $HOME/bin ]]; then
 | 
				
			||||||
 | 
					    mkdir $HOME/bin
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
							
								
								
									
										2
									
								
								run
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								run
									
									
									
									
									
								
							@@ -30,7 +30,7 @@ done
 | 
				
			|||||||
script_dir=$(cd $(dirname "${ZSH_SOURCE[0]}") &> /dev/null && pwd)
 | 
					script_dir=$(cd $(dirname "${ZSH_SOURCE[0]}") &> /dev/null && pwd)
 | 
				
			||||||
log "run // script_dir: $script_dir -- args: $single_script_filter"
 | 
					log "run // script_dir: $script_dir -- args: $single_script_filter"
 | 
				
			||||||
cd $script_dir
 | 
					cd $script_dir
 | 
				
			||||||
scripts=$(find ./runs -maxdepth 1 -mindepth 1 -type f)
 | 
					scripts=(`find ./runs -maxdepth 1 -mindepth 1 -type f`)
 | 
				
			||||||
for script in $scripts; do
 | 
					for script in $scripts; do
 | 
				
			||||||
    if [[ -x $script ]]; then
 | 
					    if [[ -x $script ]]; then
 | 
				
			||||||
        if echo "$script" | grep -qv "$single_script_filter"; then
 | 
					        if echo "$script" | grep -qv "$single_script_filter"; then
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										3
									
								
								runs/dev_tools
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										3
									
								
								runs/dev_tools
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,3 @@
 | 
				
			|||||||
 | 
					#!/bin/zsh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					brew install git tmux
 | 
				
			||||||
@@ -1,3 +1,8 @@
 | 
				
			|||||||
#!/bin/zsh
 | 
					#!/bin/zsh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
echo "setup script for neovim"
 | 
					neovim_dir=$HOME/bin/neovim
 | 
				
			||||||
 | 
					git clone -b v0.10.3 https://github.com/neovim/neovim.git $neovim_dir
 | 
				
			||||||
 | 
					brew install cmake gettext lua5.1 liblua5.1-0-dev
 | 
				
			||||||
 | 
					cd $neovim_dir
 | 
				
			||||||
 | 
					make CMAKE_BUILD_TYPE=RelWithDebInfo
 | 
				
			||||||
 | 
					sudo make install
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user