Permalink
Browse files

.vimrc 移動系キーバインドを色々と追加o

vim上でのquickfixでのscalaコンパイルを設定
  • Loading branch information...
1 parent cc969a7 commit aaf5934b6a7aa89dc202649b6f02973dece5ebe3 @yuroyoro committed May 27, 2010
Showing with 177 additions and 44 deletions.
  1. +1 −0 .screenrc
  2. +2 −1 .vim/.netrwhist
  3. +2 −0 .vim/ftplugin/scala.vim
  4. +4 −0 .vim/plugins_list
  5. +44 −0 .vim/runtime/compiler/scalac.vim
  6. +63 −3 .vimrc
  7. +3 −0 .zshrc
  8. +58 −40 import.scala
View
@@ -4,6 +4,7 @@ defscrollback 50000
defmonitor on
caption always "%{= wb} %-w%{=bu dr}%n %t%{-}%+w %= %{=b wk} [%l] %{=b wb}%y/%m/%d(%D) %{=b wm}%c"
escape ^Tt
+termcapinfo xterm* ti@:te@
View
@@ -1,2 +1,3 @@
let g:netrw_dirhistmax =10
-let g:netrw_dirhist_cnt =0
+let g:netrw_dirhist_cnt =1
+let g:netrw_dirhist_1='/Users/ozaki/dev/Project/sandbox/scala/yuroyoro/WebSocketChirpUserStreams/chat'
@@ -0,0 +1,2 @@
+compiler scalac
+
View
@@ -80,6 +80,10 @@ fuzzyfinder.vim : 超あいまいバッファ検索
http://www.vim.org/scripts/script.php?script_id=1984
http://d.hatena.ne.jp/ns9tks/20080104/1199432216
+DumbBuf.vim : quickbufっぽくbufferを管理。とりあえず<F4>でバッファ一覧
+ http://vim.g.hatena.ne.jp/tyru/20091030
+ http://github.com/tyru/DumbBuf.vim/downloads
+
---------------------------------------------
ファイル系
---------------------------------------------
@@ -0,0 +1,44 @@
+if exists("current_compiler")
+ finish
+endif
+
+if exists(":CompilerSet") != 2 " older Vim always used :setlocal
+ command -nargs=* CompilerSet setlocal <args>
+endif
+
+if filereadable( "pom.xml") == 0
+ let current_compiler = "scalac"
+ CompilerSet makeprg=scalac
+ CompilerSet errorformat=%f:%l:\ error:\ %m,%-Z%p^,%-C%.%#,%-G%.%#
+
+ "コンパイル
+ map <F5> <ESC>;w<CR>;cd %:h<CR>;make -sourcepath . %:p<CR>;cd -<CR>
+ map! <F5> <ESC>;w<CR>;cd %:h<CR>;make -sourcepath . %:p<CR>;cd -<CR>
+
+ "実行
+ map <F6> <ESC>;w<CR>;cd %:h<CR>;!scala %:r<CR>;cd -<CR>
+ map! <F6> <ESC>;w<CR>;cd %:h<CR>;!scala %:r<CR>;cd -<CR>
+
+ "コンパイル+実行
+ map <F7> <ESC>;w<CR>;cd %:h<CR>;make -sourcepath . %:p<CR>;!scala %:r<CR>;cd -<CR>
+ map! <F7> <ESC>;w<CR>;cd %:h<CR>;make -sourcepath . %:p<CR>;!scala %:r<CR>;cd -<CR>
+else
+ let current_compiler = "ant"
+ " CompilerSet makeprg=mvn\ -q\ -f\ pom.xml\ compile
+ CompilerSet makeprg=mvn\ -f\ pom.xml\ compile
+ " CompilerSet errorformat=[ERROR]\ %f:%l:\ error:\ %m,%-Z%p^,%-C%.%#,%-G%.%#
+ CompilerSet errorformat=%E%>[ERROR]\ %f:%l:\ error:\ %m,%%W%>[WARNING]\ %f:%l:\ warning:\ %m,-Z[INFO]\ %p^,%C[INFO]%m,%-Z,%-C%.%#,%-G%.%#
+
+ "コンパイル
+ map <F5> <ESC>;wa<CR>;make <CR><CR>
+ map! <F5> <ESC>;wa<CR>;make <CR><CR>
+
+ "実行
+ map <F6> <ESC>;wa<CR>;!mvn scala:console <CR><CR>
+ map! <F6> <ESC>;wa<CR>;!mvn scala:console <CR><CR>
+
+ "コンパイル+実行
+ map <F7> <ESC>;wa<CR>;make <CR>;!mvn scala:console<CR><CR>
+ map! <F7> <ESC>;wa<CR>;make <CR>;!mvn scala:console<CR><CR>
+endif
+
View
@@ -270,6 +270,19 @@ nnoremap l <Right>
nnoremap <Down> gj
nnoremap <Up> gk
+" gh, geで行頭、行末へ
+nmap gh ^
+nmap ge $
+
+" insert mode での移動
+imap <C-e> <END>
+imap <C-a> <HOME>
+" インサートモードでもhjklで移動(Ctrl押すけどね)
+imap <C-j> <Down>
+imap <C-k> <Up>
+imap <C-h> <Left>
+imap <C-l> <Right>
+
"<space>j, <space>kで画面送り
noremap <Space>j <C-f>
noremap <Space>k <C-b>
@@ -304,6 +317,14 @@ nnoremap vv vawy
" 矩形選択で自由に移動する
set virtualedit+=block
+"ビジュアルモード時vで行末まで選択
+vnoremap v $h
+
+" CTRL-hjklでウィンドウ移動
+nnoremap <C-j> ;<C-w>j
+nnoremap <C-k> ;<C-k>j
+nnoremap <C-l> ;<C-l>j
+nnoremap <C-h> ;<C-h>j
"-------------------------------------------------------------------------------
" エンコーディング関連 Encoding
@@ -451,8 +472,15 @@ inoremap <C-w> <C-g>u<C-w>
" :Ptでインデントモード切替
command! Pt :set paste!
-" Yで行末までヤンク
-nnoremap Y y$
+" ygeで行末までヤンク
+nmap ygh ly^
+" yghで行頭までヤンク
+nmap yge y$
+
+" ghpで行頭へペースト
+nmap ghp ^p
+" gepで行末からペースト
+nmap gep $p
"
" 括弧を自動補完
@@ -552,6 +580,9 @@ let g:miniBufExplModSelTarget=1
let g:miniBufExplSplitToEdge=1
let g:miniBufExplMaxSize = 10
+":TmでMiniBufExplorerの表示トグル
+command! Mt :TMiniBufExplorer
+
"------------------------------------
" Align
"------------------------------------
@@ -570,7 +601,7 @@ let g:treeExplVertical=1
" コメントの間にスペースを空ける
let NERDSpaceDelims = 1
"<Leader>xでコメントをトグル(NERD_commenter.vim)
-map <Leader>x , c<space>
+map <Leader>x, c<space>
""未対応ファイルタイプのエラーメッセージを表示しない
let NERDShutUp=1
@@ -647,3 +678,32 @@ nnoremap <Space>gp :<C-u>Git push
" pydiction.vim
"------------------------------------
autocmd FileType python let g:pydiction_location = '~/.vim/pydiction/complete-dict'
+
+"------------------------------------
+" BufExplorer
+"------------------------------------
+"<C-l>でBufferList
+nnoremap <C-l> :BufExplorer<CR>
+
+"------------------------------------
+" VTreeExplorer
+"------------------------------------
+"<Leader>t<Space>でディレクトリツリー表示
+noremap <Leader>t<Space> :VTreeExplore<CR>
+
+"------------------------------------
+" DumbBuf.vim
+"------------------------------------
+"<Leader>b<Space>でBufferList
+let dumbbuf_hotkey = '<Leader>b<Space>'
+let dumbbuf_mappings = {
+ \ 'n': {
+ \'<Esc>': { 'opt': '<silent>', 'mapto': ':<C-u>close<CR>' }
+ \}
+\}
+let dumbbuf_single_key = 1
+let dumbbuf_updatetime = 1 " &updatetimeの最小値
+let dumbbuf_wrap_cursor = 0
+let dumbbuf_remove_marked_when_close = 1
+
+
View
@@ -318,6 +318,9 @@ autoload zed
autoload predict-on
#predict-off
+## Command Line Stack [Esc]-[q]
+bindkey -a 'q' push-line
+
## Alias configuration
#
View
@@ -1,43 +1,61 @@
-import scala.xml._
-// import scala.xml.parsing.XhtmlParser
+import com.yuroyoro.util._
+import com.yuroyoro.util.io._
+import com.yuroyoro.util.net._
import scala.io.Source
-import scala.util.matching.Regex
-import scala.collection.jcl.Conversions._
-import java.util.{List => JList, Map => JMap }
-import java.util.{Calendar,Date }
-
-// import _root_.com.yuroyoro.interactivehelp.Help._
-//
-type -->[A, B] = PartialFunction[A, B]
-
-object FileOut{
- import java.io.{Writer, OutputStreamWriter, FileOutputStream }
-
- def os(fileName:String):Writer =
- new OutputStreamWriter( new FileOutputStream( fileName ), "UTF-8")
-
- def apply( fileName:String, content:String ) = {
- val o = os( fileName )
- o.write( content )
- o.flush
- o.close
- }
- def apply( fileName:String, content:Seq[String] ) = {
- val o = os( fileName )
- content.foreach { c => o.write( c + "\n" ) }
- o.flush
- o.close
- }
-}
-
-class MapOrElseOption[A]( o:Option[A] ){
-
- def mapOrElse[B]( default : => B)( f:(A) => B ) = o match {
- case None => default
- case Some(x) => f(x)
- }
-}
-
-implicit def option2MapOrElseOption[A]( o:Option[A] ) = new MapOrElseOption( o )
+import scala.collection.JavaConversions._
+import scala.xml._
+import scala.xml.parsing.XhtmlParser
+
+// import scala.util.matching.Regex
+// import scala.collection.jcl.Conversions._
+// import java.util.{List => JList, Map => JMap }
+// import java.util.{Calendar,Date }
+
+// // import _root_.com.yuroyoro.interactivehelp.Help._
+// //
+// type -->[A, B] = PartialFunction[A, B]
+
+// object FileOut{
+ // import java.io.{Writer, OutputStreamWriter, FileOutputStream }
+
+ // def os(fileName:String):Writer =
+ // new OutputStreamWriter( new FileOutputStream( fileName ), "UTF-8")
+
+ // def apply( fileName:String, content:String ) = {
+ // val o = os( fileName )
+ // o.write( content )
+ // o.flush
+ // o.close
+ // }
+ // def apply( fileName:String, content:Seq[String] ) = {
+ // val o = os( fileName )
+ // content.foreach { c => o.write( c + "\n" ) }
+ // o.flush
+ // o.close
+ // }
+// }
+
+// class MapOrElseOption[A]( o:Option[A] ){
+
+ // def mapOrElse[B]( default : => B)( f:(A) => B ) = o match {
+ // case None => default
+ // case Some(x) => f(x)
+ // }
+// }
+
+// implicit def option2MapOrElseOption[A]( o:Option[A] ) = new MapOrElseOption( o )
+
+// class HtmlNodeSeq( xml:NodeSeq ) {
+ // def class_?(className:String ) = xml filter{ e =>
+ // styleClass(e).split("\\s").contains(className)
+ // }
+
+ // def id_?( id:String ) = xml filter{ e =>
+ // (e \ "@id" text) == id
+ // }
+ // def styleClass( xml:NodeSeq ) = xml \ "@class" text
+ // def link( xml:NodeSeq ) = xml \ "@href" text
+// }
+// implicit def nodeSeq2HtmlNodeSeq( xml:NodeSeq ) = new HtmlNodeSeq( xml )

0 comments on commit aaf5934

Please sign in to comment.