Hacker News new | past | comments | ask | show | jobs | submit login

If you use vim as your IDE and haven't already, make use of nerdtree with its git addon[1] along with tmux.

I use different tmux colors for different environments so I know where I'm at instantly.

[1]https://medium.com/@victormours/a-better-nerdtree-setup-3d39...




Different colors are great even without Tmux. Even in my simple WSL environment I have aliases to open, say,

    alias liveTerm='urxvt -bg "#5b0000" -fb white &'
-so my production ssh will be red, staging green, another site purple, etc.


^^ whoops make that(too late to edit)

    -fg white


How are you setting your tmux colours in different environments?


I have this in my ~/.bashrc:

    declare -A TMUX_SSH_COLORS_TABLE                                                                                                
    TMUX_SSH_COLORS_TABLE=( \                                                                                                       
        ["server"]="fg=yellow bold,bg=black" \
        ["router"]="fg=red bold,bg=black" \                                                                                                                                                                                      
        ["desktop"]="fg=white bold,bg=black" \                                                                                      
    )                                                                                                                               
                                                                                                                                                                                                                                                                      
    function ssh {                                                                                                                  
        trap 'tmux select-pane -t:. -P "default"' RETURN                                                                            
        for arg; do                                                                                                                 
            local arg_value="${TMUX_SSH_COLORS_TABLE[$arg]}"                                                                        
            [[ -n "${arg_value}" ]] && tmux select-pane -t:. -P "${arg_value}"                                                      
            break                                                                                                                   
        done                                                                                                                        
        /usr/bin/ssh "$@"                                                                                                           
    }
On my laptop, `ssh desktop` will switch my tmux colors and then when ssh dies/quits/etc I go back to the default color scheme.


I hadn't thought of this approach. Thanks!




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: