Skip to content
Browse files

Adds erlang tslime functions and a new function section to my vimrc

  • Loading branch information...
1 parent 6414418 commit 9ebc7378439e829e9f17d6ba15cde7d2aff51bd3 @benmills committed
Showing with 42 additions and 50 deletions.
  1. +9 −5 README.mkd
  2. +33 −13 vimrc
  3. +0 −32 zshenv
View
14 README.mkd
@@ -75,15 +75,19 @@
## Shortcuts
```
+
+navigation
+ak - Runs the `Ack` command
bb - Go to the last buffer
-nh - Clear search highlight
-w - Open new vertical split, focus on it and start Commant-T
-C-f - Starts Command-T
+be - Starts BufferExplorer
+fw - Open new vertical split, focus on it and start Commant-T
fb - Start Command-T buffer mode
+C-f - Starts Command-T
nt - Starts NERDTree
+nf - Finds current file in NERDTree
+
+nh - Clear search highlight
cc - Comment or uncomment current line(s)
-be - Starts BufferExplorer
-ak - Runs the `Ack` command
vis - Sources your vimrc file
rt - Rebuilds tags
rf - Run ruby focused unit test
View
46 vimrc
@@ -132,12 +132,10 @@ map <leader>bb :e#<CR>
" Clear Search
map <leader>nh :noh<Enter>
-" Working with windows
-nnoremap <leader>w <C-w>v<C-w>l:CommandT<Enter>
-
" CommandT
map <C-f> :CommandT<Enter>
map <leader>fb :CommandTBuffer<Enter>
+nnoremap <leader>fw <C-w>v<C-w>l:CommandT<Enter>
" NERDTree
map <leader>nt :NERDTreeToggle<Enter>
@@ -146,7 +144,7 @@ map <leader>nt :NERDTreeToggle<Enter>
map <leader>cc :TComment<CR>
" BufferExplorer
-map <leader>e :BufExplorer<Enter>
+map <leader>be :BufExplorer<Enter>
" Ack
map <leader>ak :Ack
@@ -172,23 +170,45 @@ map <Leader>tb :TagbarToggle<CR>
" Compile erlang
map <Leader>ce :call CompileErlang()<CR>
-"map <Leader>re b"fyw/module<CR>f("myi(:call RunErlangFunction("<C-r>m:<C-r>f")<CR>
-map <Leader>re :call RunErlangFunction()<CR>
+map <Leader>tc :call TmuxCompileErlang()<CR>
+map <Leader>tf :call TmuxRunErlangFunction()<CR>
+map <Leader>tl :call TmuxRunLastErlangFunction()<CR>
+
+
+
+" Functions
+" ============
-function! RunErlangFunction()
+function! TmuxRunErlangFunction()
let modname = split(bufname("%"), '\.')[0]
let funname = expand("<cword>")
let fun = modname . ":" . funname
let curline = getline('.')
+
+ if exists("g:terl_defaultargs")
+ let defaultargs = g:terl_defaultargs
+ else
+ let defaultargs = "[]"
+ endif
+
call inputsave()
- let args = input('Args for ' . fun . ': ', "[]")
+ let args = input('Args for ' . fun . ': ', defaultargs)
+ let g:terl_defaultargs = args
+ let g:tmfun = fun . "(" . args . ").\n"
+ call Send_to_Tmux(g:tmfun)
endfunction
-function! OldRunErlangFunction(fun)
- let curline = getline('.')
- call inputsave()
- let args = input('Args for ' . a:fun . ': ', "[]")
- call Send_to_Tmux(a:fun . "(" . args . ").\n")
+function! TmuxRunLastErlangFunction()
+ if exists("g:tmfun")
+ call Send_to_Tmux(g:tmfun)
+ else
+ echo "No last Erlang function"
+ endif
+endfunction
+
+function! TmuxCompileErlang()
+ let modname = split(bufname("%"), '\.')[0]
+ call Send_to_Tmux("c(" . modname . ").\n")
endfunction
function! CompileErlang()
View
32 zshenv
@@ -2,35 +2,3 @@
. ~/.zsh/completion
. ~/.zsh/config
. ~/.zsh/prompt
-
-export SYSTEM_SCRIPTS=~/bt/system-scripts
-. ~/bt/system-scripts/pairing_stations/ec2env
-
-export PATH="/usr/local/bin:$PATH"
-export PATH="/usr/local/ruby186_p383/bin:/opt/local/bin:/opt/local/sbin:$PATH"
-export PATH="/opt/local/lib/mysql5/bin:$PATH"
-export PATH="/usr/local/ruby/bin:$PATH"
-export PATH="/opt/local/lib/postgresql84/bin:$PATH"
-export PATH="$PATH:/opt/local/pear/bin"
-export PATH="$PATH:$SYSTEM_SCRIPTS/bin"
-export PATH="$PATH:$EC2_HOME/bin:$EC2_AMI_HOME/bin"
-export MANPATH=/opt/local/share/man:$MANPATH
-
-_rake () {
- if [ -f Rakefile ]; then
- compadd `rake --silent --tasks | cut -d " " -f 2`
- fi
-}
-
-compdef _rake rake
-
-_cap () {
- if [ -f Capfile ]; then
- compadd `cap -vT | grep '^cap' | cut -d ' ' -f 2`
- fi
-}
-
-compdef _cap cap
-
-source ~/bt/system-scripts/pairing_stations/aliases
-eval `ssh-agent`

0 comments on commit 9ebc737

Please sign in to comment.
Something went wrong with that request. Please try again.