From 22bbedd73e2b31b5188b38ca3166e146c5f3d431 Mon Sep 17 00:00:00 2001 From: InigoGutierrez Date: Mon, 8 May 2023 09:42:29 +0200 Subject: Bunch of changes. --- stow/vim/.vim/ftplugin/sh/sh.vim | 2 +- stow/vim/.vim/ftplugin/sh/snippets/template.txt | 10 ++++++---- stow/vim/.vim/ftplugin/tex/tex.vim | 2 +- stow/vim/.vim/ftplugin/typescript/typescript.vim | 4 ++-- stow/vim/.vim/ftplugin/vimwiki/vimwiki.vim | 5 +++-- 5 files changed, 13 insertions(+), 10 deletions(-) (limited to 'stow/vim/.vim/ftplugin') diff --git a/stow/vim/.vim/ftplugin/sh/sh.vim b/stow/vim/.vim/ftplugin/sh/sh.vim index 58d39fe..f716617 100644 --- a/stow/vim/.vim/ftplugin/sh/sh.vim +++ b/stow/vim/.vim/ftplugin/sh/sh.vim @@ -11,7 +11,7 @@ setlocal textwidth=110 let mapleader = " " nnoremap C :sp ~/.vim/ftplugin/sh/sh.vim -nnoremap +x :!chmod 744 % +nnoremap +x :!chmod 744 % nnoremap x :w:!./% nnoremap X :w:!./% diff --git a/stow/vim/.vim/ftplugin/sh/snippets/template.txt b/stow/vim/.vim/ftplugin/sh/snippets/template.txt index 171dcf8..8b257fe 100644 --- a/stow/vim/.vim/ftplugin/sh/snippets/template.txt +++ b/stow/vim/.vim/ftplugin/sh/snippets/template.txt @@ -4,14 +4,16 @@ # # Usage: template.sh [-ac] [-b OPTARG] FILE... -usageMessage="Usage: ${0} [-ac] [-b OPTARG] FILE..." +scriptName="${0##*/}" + +usageMessage="Usage: ${scriptName} [-ac] [-b OPTARG] FILE..." error() { - printf '%s error: %s\n' "$0" "$*" >&2 + printf '%s error: %s\n' "$scriptName" "$*" >&2 } errorAndUsage() { - printf '%s error: %s\n%s\n' "$0" "$*" "$usageMessage" >&2 + printf '%s error: %s\n%s\n' "$scriptName" "$*" "$usageMessage" >&2 } # Process options @@ -31,7 +33,7 @@ while getopts ':ab:c' opt; do ;; '?' ) - printf '%s\n' "$usageMessage" + printf '%s\n' "$usageMessage" >&2 exit 1 esac diff --git a/stow/vim/.vim/ftplugin/tex/tex.vim b/stow/vim/.vim/ftplugin/tex/tex.vim index c57bbc5..0893e40 100644 --- a/stow/vim/.vim/ftplugin/tex/tex.vim +++ b/stow/vim/.vim/ftplugin/tex/tex.vim @@ -47,4 +47,4 @@ inoremap lenumerate \begin{enumerate}o litemize \begin{itemize}o\end{itemize}kkI\itemI<++>k<$a inoremap litem \item<++>k$a inoremap limage \begin{figure}[h]\begin{center}\includegraphics[width=\textwidth]{}\caption{<++>}\end{center}\end{figure}<++>4k$i -inoremap ltable \begin{table}[h]\makebox[\linewidth]{\centering\centering\begin{tabular}{ccxxx}\toprule<++>&<++>\\\midrule<++>&<++>\\\bottomrule\end{tabular}}\end{table}<++>?xxxcw +inoremap ltable \begin{table}[h]\makebox[\linewidth]{\begin{tabular}{ccxxx}\toprule<++>&<++>\\\midrule<++>&<++>\\\bottomrule\end{tabular}}\end{table}<++>?xxxcw diff --git a/stow/vim/.vim/ftplugin/typescript/typescript.vim b/stow/vim/.vim/ftplugin/typescript/typescript.vim index 65e3c1a..b91ea16 100644 --- a/stow/vim/.vim/ftplugin/typescript/typescript.vim +++ b/stow/vim/.vim/ftplugin/typescript/typescript.vim @@ -19,8 +19,8 @@ let mapleader = " " nnoremap C :sp ~/.vim/ftplugin/typescript/typescript.vim -nnoremap s :!tmux new-window -db -t 9 -n 'npm start' npm start -nnoremap S :!tmux new-window -b -t 9 -n 'npm start' 'tmux set -w remain-on-exit on; npm start' +nnoremap s :silent !~/scripts/tmux/tmux-npmStart.sh +nnoremap S :silent !~/scripts/tmux/tmux-npmStart.sh -r let mapleader = "," diff --git a/stow/vim/.vim/ftplugin/vimwiki/vimwiki.vim b/stow/vim/.vim/ftplugin/vimwiki/vimwiki.vim index c904efe..7d36f10 100644 --- a/stow/vim/.vim/ftplugin/vimwiki/vimwiki.vim +++ b/stow/vim/.vim/ftplugin/vimwiki/vimwiki.vim @@ -27,8 +27,9 @@ nnoremap C :sp ~/.vim/ftplugin/vimwiki/vimwiki.vim nnoremap temp :r ~/.vim/ftplugin/vimwiki/snips/template.txt nnoremap tp :r ~/.vim/ftplugin/vimwiki/snips/plantUml.txt/<+++>cf> -nnoremap c :w:!toPDF.sh "%" -nnoremap o :w:!toPDF.sh -o "%" +nnoremap c :silent w:!toPDF.sh "%" +nnoremap o :silent w:!toPDF.sh -o "%" +nnoremap O :silent w:!toPDF.sh -o "%" let mapleader = "," -- cgit v1.2.1