Permalink
Browse files

Lots of little updates. Most notably, as of late, added some maps to …

…put in some digraphs - I'm doing more functional stuff lately and it's nice to have some more characters at my disposal.
  • Loading branch information...
1 parent 27043da commit 083691b5505eaa1536842f704bd468f5befb4fdb Derek Wyatt committed Jan 17, 2012
View
@@ -24,5 +24,7 @@ vim-mwutils
vim-completion
vim-javascript
vim-conque
+vim-jade
*.swp
+.netrwhist
passwords.vim
View
@@ -448,8 +448,8 @@ nnoremap <buffer> <silent> ,fs :FufFile <c-r>=GetSrcDirForFuzzyFinder('%:p:h')<c
" ProtoDef Settings
" See http://www.vim.org/scripts/script.php?script_id=2624
"
-let g:protodefprotogetter = expand($VIM) . '/pullproto.pl'
-let g:protodefctagsexe = '/ctags57/ctags.exe'
+"let g:protodefprotogetter = expand($VIM) . '/pullproto.pl'
+let g:protodefctagsexe = '/usr/bin/ctags'
augroup local_ftplugin_cpp
au!
View
@@ -24,3 +24,4 @@
* **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`
+* **Jade**: `git clone https://github.com/vim-scripts/jade.vim.git vim-jade`
View
35 vimrc
@@ -24,9 +24,9 @@ filetype plugin on
filetype indent on
" Tabstops are 4 spaces
-set tabstop=4
-set shiftwidth=4
-set softtabstop=4
+set tabstop=2
+set shiftwidth=2
+set softtabstop=2
set expandtab
set autoindent
@@ -290,6 +290,35 @@ imap jj <esc>
nmap <silent> ,C :set opfunc=ClearText<CR>g@
vmap <silent> ,C :<C-U>call ClearText(visual(), 1)<CR>
+" Make the current file executable
+nmap ,x :w<cr>:!chmod 755 %<cr>:e<cr>
+
+" Digraphs
+" Alpha
+imap <c-l><c-a> <c-k>a*
+" Beta
+imap <c-l><c-b> <c-k>b*
+" Gamma
+imap <c-l><c-g> <c-k>g*
+" Delta
+imap <c-l><c-d> <c-k>d*
+" Epslion
+imap <c-l><c-e> <c-k>e*
+" Lambda
+imap <c-l><c-l> <c-k>l*
+" Eta
+imap <c-l><c-y> <c-k>y*
+" Theta
+imap <c-l><c-h> <c-k>h*
+" Mu
+imap <c-l><c-m> <c-k>m*
+" Rho
+imap <c-l><c-r> <c-k>r*
+" Pi
+imap <c-l><c-p> <c-k>p*
+" Phi
+imap <c-l><c-f> <c-k>f*
+
function! ClearText(type, ...)
let sel_save = &selection
let &selection = "inclusive"
@@ -22,14 +22,14 @@ function! InsertNameSpace(beginOrEnd)
let nsdecl = join(nsnames, ' { namespace ')
let nsdecl = 'namespace '.nsdecl.' {'
if a:beginOrEnd == 0
- let nsstring = nsdecl . "\n\n"
+ let nsstring = nsdecl
else
for i in nsnames
let nsstring = nsstring.'} '
endfor
- let nsstring = "\n".nsstring.'// end of namespace '.join(nsnames, '::')
+ let nsstring = nsstring . '// end of namespace '.join(nsnames, '::')
endif
- let nsstring = "\n" . nsstring
+ let nsstring = nsstring
endif
return nsstring
@@ -60,16 +60,17 @@ endfunction
function! GetNSFNameDefine()
let dir = expand('%:p:h')
+ let ext = toupper(expand('%:e'))
let idx = stridx(dir, 'include')
if idx != -1
let subdir = strpart(dir, idx + strlen('include') + 1)
let define = substitute(subdir, '/', '_', 'g')
- let define = define ."_".expand('%:t:r')."_h"
+ let define = define ."_".expand('%:t:r')."_" . ext
let define = toupper(define)
let define = substitute(define, '^_\+', '', '')
return define
else
- return toupper(expand('%:t:r'))."_H"
+ return toupper(expand('%:t:r'))."_" . ext
endif
endfunction
@@ -221,30 +222,29 @@ XPT imp hint=specific\ C++\ implementation\ file
//
// `getNamespaceFilename()^
//
-// Copyright (c) `year()^ Derek Wyatt
+// Copyright (c) `year()^ Research In Motion
//
-#include <`getHeaderForCurrentSourceFile()^>
-`insertNamespaceBegin()^`returnSkeletonsFromPrototypes()^`cursor^`insertNamespaceEnd()^
+#include "`getHeaderForCurrentSourceFile()^"
+
+`insertNamespaceBegin()^
+
+`returnSkeletonsFromPrototypes()^`cursor^
+`insertNamespaceEnd()^
XPT h hint=specific\ C++\ header\ file
//
// `getNamespaceFilename()^
//
-// Copyright (c) `year()^ Derek Wyatt
+// Copyright (c) `year()^ Research In Motion
//
-#ifndef __`getNamespaceFilenameDefine()^__
-#define __`getNamespaceFilenameDefine()^__
+#ifndef `getNamespaceFilenameDefine()^
+#define `getNamespaceFilenameDefine()^
-// The boost libraries don't compile well at warning level 4.
-// No big surprise here... boost pushes the limits of compilers
-// in the extreme. Warning level 3 is clean.
-#pragma warning(push, 3)
-#include <boost/tr1/memory.hpp>
-#pragma warning(pop)
`insertNamespaceBegin()^
+
/**
* @brief `classDescription^
*/
@@ -265,9 +265,9 @@ public:
private:
};
-typedef std::tr1::shared_ptr<`fileRoot()^> `fileRoot()^Ptr;
`insertNamespaceEnd()^
-#endif // __`getNamespaceFilenameDefine()^__
+
+#endif // `getNamespaceFilenameDefine()^
XPT functor hint=Functor\ definition
@@ -7,18 +7,22 @@ let s:f = g:XPTfuncs()
XPT digraph hint=new\ directed\ graph
digraph `GraphName^ {
- rankdir=LR
+ rankdir=LR;
node [shape=point, style=invis];
edge [style=invis];
L1 -> L2 -> L3 -> L4 -> L5 -> L6;
+ node [shape=Mrecord style=filled];
+ node [fillcolor="steelblue"];
`cursor^
+ edge [style=solid];
+
{ rank=same; L1; }
{ rank=same; L2; }
{ rank=same; L3; }
{ rank=same; L4; }
{ rank=same; L5; }
{ rank=same; L6; }
}
-// vim:tw=0 sw=2:
+// vim:tw=0 sw=2 tw=0:
@@ -92,6 +92,11 @@ case object `objectName^
XPT case hint=Creates\ a\ case\ statement
case `matchAgainst^ =>
+XPT wrapin wrap=code hint=Wraps\ in\ a\ block
+`prefix^ {
+ `code^
+}
+
XPT match hint=Creates\ a\ pattern\ matching\ sequence
`target^ match {
`...^case `matchTo^ => `statement^
@@ -0,0 +1,46 @@
+XPTemplate priority=personal
+
+XPTinclude
+ \ _common/personal
+
+let s:f = g:XPTfuncs()
+
+XPT optparse hint=BASH\ option\ parsing
+opts=$(getopt -o h`short^ --long host,`long^ -n "${0##*/}" -- "$@")
+if [ $? != 0 ]; then exit 1; fi
+
+mydir="$(cd -P "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+me=${BASH_SOURCE[0]}
+me=${me##*/}
+
+function usage
+{
+ cat <<EOH
+usage: $me `basic^
+
+ `detailed^
+EOH
+}
+
+eval set -- "$opts"
+while true
+do
+ case "$1" in
+ -h|--help)
+ usage
+ exit 0
+ ;;
+ -`short^|--`long^)
+ `cursor^
+ shift
+ ;;
+ --)
+ shift
+ break
+ ;;
+ *)
+ echo "Internal error."
+ exit 1
+ ;;
+ esac
+done
@@ -75,3 +75,44 @@ XPT eqnarray hint=\\begin{eqnarray*}...\\end{eqnarray*}
\begin{eqnarray*}
`cursor^
\end{eqnarray*}
+
+XPT doc hint=Two\ column\ article\ document
+% Configuration Preamble {{{1
+\documentclass[letterpaper]{article}
+\usepackage[utf8]{inputenc}
+\usepackage[T1]{fontenc}
+\usepackage{lmodern}
+\usepackage{listings}
+\usepackage[pdftex]{graphicx}
+\usepackage{multicol}
+\usepackage{fullpage}
+\usepackage{enumerate}
+\DeclareGraphicsExtensions{.eps,.pdf,.png}
+\usepackage{amsmath,amsthm,amssymb}
+\usepackage{float}
+
+% Title {{{1
+\title{`title^}
+\author{Derek Wyatt (dwyatt@rim.com)}
+\date{\today}
+\begin{document}
+\maketitle
+
+% Abstract {{{1
+\begin{abstract}
+\end{abstract}
+
+% Table of Contents {{{1
+\tableofcontents
+\setcounter{tocdepth}{3}
+\begin{center}
+\line(1,0){400}
+\end{center}
+
+% Document {{{1
+\begin{multicols}{2}
+`cursor^
+\end{multicols}
+\end{document}
+% vim:sw=2 ft=tex fdl=0 fdm=marker:
+

0 comments on commit 083691b

Please sign in to comment.