Permalink
Browse files

Added some helpers for graphviz and tex in the XPTemplate configurati…

…on, as well as added some config for Gundo and ConqueShell
  • Loading branch information...
1 parent 9db6c66 commit 27043da6edabd45555a8a24220c3b28e345307bc Derek Wyatt committed Oct 31, 2011
Showing with 113 additions and 5 deletions.
  1. +2 −0 .gitignore
  2. +31 −0 after/ftplugin/tex.vim
  3. +2 −0 bundle/from_github.md
  4. +20 −0 vimrc
  5. +24 −0 xpt-personal/ftplugin/dot/dot.xpt.vim
  6. +34 −5 xpt-personal/ftplugin/tex/tex.xpt.vim
View
@@ -22,5 +22,7 @@ vim-json
vim-signs
vim-mwutils
vim-completion
+vim-javascript
+vim-conque
*.swp
passwords.vim
View
@@ -0,0 +1,31 @@
+
+" When I'm editing some LaTeX, I use PDF files to handle any inserted images and
+" LaTeX has some difficulty lining them up right, so I explicitly state the
+" viewport. To get the bounding box from the PDF file, I have a script called
+" 'getbb'. This function is /very/ specific to my needs. It pulls the filename
+" from the current line, which always looks something like this:
+"
+" \includegraphics[scale=0.5, viewport = 40 39 703 153]{target/filename.pdf}
+"
+" Pulls out the filename (i.e. target/filename.pdf), runs 'getbb' on that and
+" inserts the output back overtop of the "viewport = 40 39 703 153".
+"
+" The couple of mappings make everything real easy to use.
+function! UpdateBoundingBox()
+ let l = getline('.')
+ let f = substitute(l, '.*{\(.*\)}.*$', '\1', '')
+ if f =~? '[^/]\+/[^/]\+\.pdf'
+ if filereadable('getbb')
+ let bb = system('getbb ' . f)
+ let bb = substitute(bb, '.$', '', '')
+ :s/\zsviewport.*\ze\]/\=bb/
+ else
+ echoerr "Can't find getbb... are you in the right directory?"
+ endif
+ else
+ echoerr "Couldn't get a pdf file from the current line."
+ endif
+endfunction
+
+nmap <buffer> ,bb :call UpdateBoundingBox()<cr>
+nmap <buffer> ,abb :g/includegraphics.*viewport/execute ':call UpdateBoundingBox()'<cr>
View
@@ -22,3 +22,5 @@
* **Signs**: `git clone https://github.com/MarcWeber/vim-addon-signs.git vim-signs`
* **MWUtils**: `git clone https://github.com/MarcWeber/vim-addon-mw-utils.git vim-mwutils`
* **Completion**: `git clone https://github.com/MarcWeber/vim-addon-completion.git vim-completion`
+* **JavaScript**: `git clone https://github.com/pangloss/vim-javascript.git vim-javascript`
+* **Conque**: `git clone https://github.com/rson/vim-conque.git vim-conque`
View
20 vimrc
@@ -1,3 +1,9 @@
+"
+" Derek Wyatt's Vim Configuration
+"
+" It's got stuff in it.
+"
+
"-----------------------------------------------------------------------------
" Global Stuff
"-----------------------------------------------------------------------------
@@ -439,6 +445,20 @@ nmap <silent> ,fm :FufMruFile<cr>
nmap <silent> ,fp :FufFile ~/git/*<cr>
"-----------------------------------------------------------------------------
+" Gundo Settings
+"-----------------------------------------------------------------------------
+nmap <c-F5> :GundoToggle<cr>
+
+"-----------------------------------------------------------------------------
+" Conque Settings
+"-----------------------------------------------------------------------------
+let g:ConqueTerm_FastMode = 1
+let g:ConqueTerm_ReadUnfocused = 1
+let g:ConqueTerm_InsertOnEnter = 1
+let g:ConqueTerm_PromptRegex = '^-->'
+let g:ConqueTerm_TERM = 'xterm'
+
+"-----------------------------------------------------------------------------
" Functions
"-----------------------------------------------------------------------------
if !exists('g:bufferJumpList')
@@ -0,0 +1,24 @@
+XPTemplate priority=personal
+
+XPTinclude
+ \ _common/personal
+
+let s:f = g:XPTfuncs()
+
+XPT digraph hint=new\ directed\ graph
+digraph `GraphName^ {
+ rankdir=LR
+ node [shape=point, style=invis];
+ edge [style=invis];
+ L1 -> L2 -> L3 -> L4 -> L5 -> L6;
+
+ `cursor^
+
+ { rank=same; L1; }
+ { rank=same; L2; }
+ { rank=same; L3; }
+ { rank=same; L4; }
+ { rank=same; L5; }
+ { rank=same; L6; }
+}
+// vim:tw=0 sw=2:
@@ -6,14 +6,23 @@ XPTinclude
XPT tt wrap=text hint=\\texttt{...}
\texttt{`text^}`cursor^
+XPT s hint=\\section{...}
+% `title^ {{{1
+\section{`title^}
+\label{sec:`label^}
+`cursor^
+
XPT ss hint=\\subsection{...}
-\subsection{`^}`cursor^
+% - `title^ {{{1
+\subsection{`title^}
+\label{sec:`label^}
+`cursor^
XPT sss hint=\\subsubsection{...}
-\subsubsection{`^}`cursor^
-
-XPT s hint=\\section{...}
-\section{`^}`cursor^
+% -- `title^ {{{1
+\subsubsection{`title^}
+\label{sec:`label^}
+`cursor^
XPT code hint=\\begin{lstlisting}...\\end{lstlisting}
\begin{lstlisting}
@@ -46,3 +55,23 @@ XPT description hint=\\begin{description}...\\end{description}
XPT i hint=\\item
\item `cursor^
+
+XPT table hint=\\begin{tabular}...\\end{tabular}
+\begin{center}
+\begin{tabular}{`columnspec^}
+`^
+\end{tabular}
+\end{center}
+
+XPT figure hint=\\begin{figure*}...\\end{figure*}
+\begin{figure*}
+\centering
+\includegraphics[scale=0.5, viewport = 0 0 0 0]{target/`name^.pdf}
+\caption{`cursor^}
+\label{fig:`name^}
+\end{figure*}
+
+XPT eqnarray hint=\\begin{eqnarray*}...\\end{eqnarray*}
+\begin{eqnarray*}
+`cursor^
+\end{eqnarray*}

0 comments on commit 27043da

Please sign in to comment.