]> www.git.dmfe.net Git - dotfiles/commitdiff
Update tmux script for running dev c session;
authorDmitry Fedotov <dm.fe@yandex.ru>
Mon, 13 Jan 2020 21:43:22 +0000 (00:43 +0300)
committerDmitry Fedotov <dm.fe@yandex.ru>
Mon, 13 Jan 2020 21:43:22 +0000 (00:43 +0300)
Update init script for c projects;
Update global vimrc;

tmux/tmux_dev_c.run.sh
vim/c-dev/initrc
vim/vimrc.symlink

index da170cf97a0340df6ba95fb511e42d23d8802034..f7644f1b68518ea6f012e8c886c2bafb60095cb7 100755 (executable)
@@ -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}"
index d31041b64cbc01009e81565f3e553759adbf64ea..5a63c43eb16e5701235ef4a0f2074660950af3a2 100644 (file)
@@ -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
index fe31d74c7d14d59a7304299398db12d035dcf3a9..52bc94793f4f202b384eff82972c2859873c9acc 100644 (file)
@@ -100,6 +100,9 @@ set nowrap
     map <leader>> :tabn<CR>
     map <leader>< :tabp<CR>
 
+" Buffers bindings
+    map <leader>x :bd %<CR>
+
 " Nerd tree
     map <leader>n :NERDTreeToggle<CR>
     autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif