From e557ace5b84ba5dcfd615f252a26d5903deecc00 Mon Sep 17 00:00:00 2001 From: Dmitry Fedotov Date: Tue, 14 Jan 2020 00:43:22 +0300 Subject: [PATCH] Update tmux script for running dev c session; Update init script for c projects; Update global vimrc; --- tmux/tmux_dev_c.run.sh | 17 +++++++++++++---- vim/c-dev/initrc | 12 ++++++++++++ vim/vimrc.symlink | 3 +++ 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/tmux/tmux_dev_c.run.sh b/tmux/tmux_dev_c.run.sh index da170cf..f7644f1 100755 --- a/tmux/tmux_dev_c.run.sh +++ b/tmux/tmux_dev_c.run.sh @@ -1,7 +1,5 @@ #!/bin/sh -SESSION="dev-c" - while getopts "p:" opt; do case $opt in p) PRJ_DIR="${OPTARG}";; @@ -85,10 +83,13 @@ dot_header_template="${DOT_FILES_VIM_C_DEV}/header_template.txt" [[ ! -f "${l_ycm_conf}" ]] && cp "${dot_ycm_conf}" "${l_ycm_conf}" [[ ! -f "${l_header_template}" ]] && cp "${dot_header_template}" "${l_header_template}" +SESSION="dev-c" +IDE_WND_NAME="ide" +DEBUG_WND_NAME="debug" tmux_dev_c_conf="${DOT_FILES_TMUX}/.tmux_dev_c.conf" -tmux source "${tmux_dev_c_conf}" \; new-session -d -s "${SESSION}" -n ide +tmux source "${tmux_dev_c_conf}" \; new-session -d -s "${SESSION}" -n "${IDE_WND_NAME}" -tmux splitw -v -p 7 +tmux splitw -h -p 50 tmux selectp -t 2 tmux send-keys "cd ${PRJ_DIR}" Enter tmux send-keys "source ${PRJ_INIT_FILE}" Enter @@ -97,6 +98,14 @@ tmux send-keys "clear" Enter tmux selectp -t 1 tmux send-keys "cd ${PRJ_DIR}" Enter tmux send-keys "source ${PRJ_INIT_FILE}" Enter +tmux send-keys "clear" Enter tmux send-keys "vi -u ${l_vimrc} ${PRJ_DIR}" Enter +tmux new-window -n "${DEBUG_WND_NAME}" +tmux send-keys "cd ${PRJ_DIR}" Enter +tmux send-keys "source ${PRJ_INIT_FILE}" Enter +tmux send-keys "clear" Enter + +tmux select-window -t 1 + tmux attach-session -t "${SESSION}" diff --git a/vim/c-dev/initrc b/vim/c-dev/initrc index d31041b..5a63c43 100644 --- a/vim/c-dev/initrc +++ b/vim/c-dev/initrc @@ -53,4 +53,16 @@ clean() { [[ -d "${OUT_DIR}" ]] && make clean } +vpe() { + vi -u "${CFG_DIR}/.vimrc" "${PRJ_DIR}" +} + +lgdb() { + tail -f "${PRJ_DIR}/gdb.txt" +} + +srcp() { + source "${CFG_DIR}/.initrc" +} + # Following project specific variables should be added by tmux session start script diff --git a/vim/vimrc.symlink b/vim/vimrc.symlink index fe31d74..52bc947 100644 --- a/vim/vimrc.symlink +++ b/vim/vimrc.symlink @@ -100,6 +100,9 @@ set nowrap map > :tabn map < :tabp +" Buffers bindings + map x :bd % + " Nerd tree map n :NERDTreeToggle autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif -- 2.39.5