c50d62b096fe

Fireplace lets you disable maps now thank fuck
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Fri, 22 Jan 2016 11:09:10 +0000
parents edc1952ba1b7
children cfcf9932226d
branches/tags (none)
files vim/after/plugin/fireplace-cl-nrepl.vim vim/after/plugin/fireplace-map-unfucking.vim

Changes

--- a/vim/after/plugin/fireplace-cl-nrepl.vim	Fri Jan 22 11:08:10 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,133 +0,0 @@
-" janky workaround from https://github.com/hylang/vim-hy/blob/master/after/plugin/fireplace.vim
-
-augroup fireplace_connect
-	autocmd FileType lisp command! -buffer -bar -nargs=*
-		\ Connect FireplaceConnect <args>
-augroup END
-
-function! s:set_up_eval() abort
-	command! -buffer -bang -range=0 -nargs=? Eval :exe s:Eval(<bang>0, <line1>, <line2>, <count>, <q-args>)
-	command! -buffer -bar -nargs=1 -complete=customlist,fireplace#eval_complete Doc     :exe s:Doc(<q-args>)
-
-	" nmap <buffer> cp <Plug>FireplacePrint
-	" nmap <buffer> cpp <Plug>FireplaceCountPrint
-
-	" nmap <buffer> cm <Plug>FireplaceMacroExpand
-	" nmap <buffer> cmm <Plug>FireplaceCountMacroExpand
-
-	" nmap <buffer> cqp <Plug>FireplacePrompt
-
-	" map! <buffer> <C-R>( <Plug>FireplaceRecall
-
-	" nmap <buffer> M <Plug>FireplaceK
-endfunction
-
-if !exists('s:qffiles')
-  let s:qffiles = {}
-endif
-
-function! s:buf() abort
-  if exists('s:input')
-    return s:input
-  elseif has_key(s:qffiles, expand('%:p'))
-    return s:qffiles[expand('%:p')].buffer
-  else
-    return '%'
-  endif
-endfunction
-
-function! s:buffer_path(...) abort
-  let buffer = a:0 ? a:1 : s:buf()
-  if getbufvar(buffer, '&buftype') =~# '^no'
-    return ''
-  endif
-  let path = substitute(fnamemodify(bufname(buffer), ':p'), '\C^zipfile:\(.*\)::', '\1/', '')
-  for dir in fireplace#path(buffer)
-    if dir !=# '' && path[0 : strlen(dir)-1] ==# dir && path[strlen(dir)] =~# '[\/]'
-      return path[strlen(dir)+1:-1]
-    endif
-  endfor
-  return ''
-endfunction
-
-function! s:Eval(bang, line1, line2, count, args) abort
-  let options = {}
-  if a:args !=# ''
-    let expr = a:args
-  else
-    if a:count ==# 0
-      let open = '[[{(]'
-      let close = '[]})]'
-      let [line1, col1] = searchpairpos(open, '', close, 'bcrn', g:fireplace#skip)
-      let [line2, col2] = searchpairpos(open, '', close, 'rn', g:fireplace#skip)
-      if !line1 && !line2
-        let [line1, col1] = searchpairpos(open, '', close, 'brn', g:fireplace#skip)
-        let [line2, col2] = searchpairpos(open, '', close, 'crn', g:fireplace#skip)
-      endif
-      while col1 > 1 && getline(line1)[col1-2] =~# '[#''`~@]'
-        let col1 -= 1
-      endwhile
-    else
-      let line1 = a:line1
-      let line2 = a:line2
-      let col1 = 1
-      let col2 = strlen(getline(line2))
-    endif
-    if !line1 || !line2
-      return ''
-    endif
-    let options.file_path = s:buffer_path()
-    let expr = repeat("\n", line1-1).repeat(" ", col1-1)
-    if line1 == line2
-      let expr .= getline(line1)[col1-1 : col2-1]
-    else
-      let expr .= getline(line1)[col1-1 : -1] . "\n"
-            \ . join(map(getline(line1+1, line2-1), 'v:val . "\n"'))
-            \ . getline(line2)[0 : col2-1]
-    endif
-    if a:bang
-      exe line1.','.line2.'delete _'
-    endif
-  endif
-  if a:bang
-    try
-      let result = fireplace#session_eval(expr, options)
-      if a:args !=# ''
-        call append(a:line1, result)
-        exe a:line1
-      else
-        call append(a:line1-1, result)
-        exe a:line1-1
-      endif
-    catch /^Clojure:/
-    endtry
-  else
-    call fireplace#echo_session_eval(expr, options)
-  endif
-  return ''
-endfunction
-
-augroup fireplace_bindings
-	autocmd FileType lisp call s:set_up_eval()
-augroup END
-
-function! s:Doc(symbol) abort
-	let info = fireplace#info(a:symbol)
-	if has_key(info, 'ns') && has_key(info, 'name')
-		echo info.ns . ' ' . info.name
-	elseif has_key(info, "name")
-		echo info.name
-	endif
-	if get(info, 'arglists-str', 'nil') !=# 'nil'
-		echo info['arglists-str']
-	endif
-	if !empty(get(info, 'doc', ''))
-		echo "\n" . info.doc
-	endif
-	return ''
-endfunction
-
-function! s:K() abort
-	let word = expand('<cword>')
-	return 'Doc '.word
-endfunction
--- a/vim/after/plugin/fireplace-map-unfucking.vim	Fri Jan 22 11:08:10 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-" These are all out here in the middle of goddamned nowhere because Fireplace is
-" an asshole and won't let you disable mappings like any other plugin.
-
-augroup unmap_fireplace_bullshit
-    au!
-
-    au Filetype clojure nunmap <buffer> cp
-    au Filetype clojure nunmap <buffer> cpp
-
-    au Filetype clojure nunmap <buffer> c!
-    au Filetype clojure nunmap <buffer> c!!
-
-    au Filetype clojure nunmap <buffer> cq
-    au Filetype clojure nunmap <buffer> cqq
-
-    au Filetype clojure nunmap <buffer> cqp
-    au Filetype clojure nunmap <buffer> cqc
-
-    au Filetype clojure nunmap <buffer> cpr
-
-    au Filetype clojure nunmap <buffer> K
-    au Filetype clojure nunmap <buffer> [d
-    au Filetype clojure nunmap <buffer> ]d
-
-    au Filetype clojure nunmap <buffer> [<c-d>
-    au Filetype clojure nunmap <buffer> ]<c-d>
-
-    au Filetype clojure nunmap <buffer> <c-w><c-d>
-    au Filetype clojure nunmap <buffer> <c-w>d
-    au Filetype clojure nunmap <buffer> <c-w>gd
-augroup END
-
-augroup map_good_fireplace_keys
-    au!
-
-    " [M]an (get documentation)
-    au Filetype clojure nmap <buffer> M <Plug>FireplaceK
-
-    " Go to Definition
-    au Filetype clojure nmap <buffer> <c-]> <Plug>FireplaceDjumpmzzvzz15<c-e>'z:Pulse<cr>
-    au Filetype clojure nmap <buffer> <c-\> <c-w>v<Plug>FireplaceDjumpmzzMzvzz15<c-e>'z:Pulse<cr>
-
-    " Require
-    au Filetype clojure nnoremap <buffer> <localleader>r :Require<cr>
-
-    " Require Harder
-    au Filetype clojure nnoremap <buffer> <localleader>R :Require!<cr>
-
-    " Get [S]ource
-    " au Filetype clojure nmap <buffer> <localleader>s <Plug>FireplaceSource
-
-    " Eval Buffer
-    au Filetype clojure nnoremap <buffer> <localleader>b :%Eval<cr>
-
-    " Eval Form
-    au Filetype clojure nmap <buffer> <localleader>f <Plug>FireplacePrintab
-
-    " Eval Top-Level Form
-    au Filetype clojure nmap <buffer> <localleader>e mz$:call PareditFindDefunBck()<cr><Plug>FireplacePrintab'z
-
-    " Open clojure command line editor client window thing
-    au Filetype clojure exe 'nmap <buffer> <localleader>E <Plug>FireplacePrompt' . &cedit . 'i'
-
-    " [S]how Last Result
-    au Filetype clojure nnoremap <buffer> <localleader>s :Last<cr>
-augroup END