Advertisement
Guest User

Untitled

a guest
Apr 24th, 2017
415
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 4.69 KB | None | 0 0
  1.  
  2. let mapleader="'"
  3.  
  4. set surround
  5.  
  6. "timeouts for the noremappings
  7. set notimeout
  8. set ttimeout
  9.  
  10. " Add semi and esc
  11. noremap <leader>; <Esc>$r;
  12. " Refresh .ideavimrc
  13. noremap <leader>! :source ~/.ideavimrc<CR>
  14.  
  15. " Single keymap for recent files because it's used so much
  16. map <leader><Tab> :action RecentFiles<CR>
  17. nnoremap <S-A-j> :action VimMotionPreviousTab<CR>
  18. nnoremap <S-A-k> :action VimMotionNextTab<CR>
  19.  
  20.  
  21. " Using f for Method navigation
  22. map <C-S-m> :action MethodUp<CR>
  23. map <C-m> :action MethodDown<CR>
  24.  
  25. " Using <> for walking through code changes
  26. nnoremap < :action JumpToLastChange<CR>
  27. nnoremap > :action JumpToNextChange<CR>
  28.  
  29. " break line                                        
  30. nnoremap <leader>b i<CR><Esc>k$
  31.  
  32. " better comment func
  33. map <C-/> mr0wi//<Esc>`rj
  34. " make e put into dev/null
  35. vmap e "_dd<Esc>
  36. " next word occurence under cursor
  37. nnoremap <leader>n evb"nyw/<C-r>n<CR>
  38. " break from expression with parens
  39. imap <leader>j <Esc>f)a
  40.  
  41. " Popup Error message
  42. nnoremap <leader><Esc> :action ShowErrorDescription<CR>
  43.  
  44. " Move (refactor)
  45. noremap <leader>mm :action Move<CR>
  46. " Quick JavaDoc
  47. map q :action QuickJavaDoc<CR>
  48.  
  49. " Error navigation
  50. noremap <leader>z :action GotoNextError<CR>
  51. noremap <leader>Z :action GotoPreviousError<CR>
  52.  
  53. "helpful java navigation
  54. "jump to block paramaters above
  55. noremap <C-p> ?)\s\{-}\n\{-}{<CR>0f(
  56. noremap <C-S-p> /)\s\{-}\n\{-}{<CR>0f(
  57.  
  58. " Misc editor Tab actions
  59. map <C-S-q> :action ReopenClosedTab<CR>
  60. map <C-q> :action CloseContent<CR>
  61. map <C-A-q> :action CloseAllEditorsButActive<CR>
  62.  
  63. " Code folding
  64. " f = folding
  65. noremap <leader>fa :action CollapseAllRegions<CR>
  66. noremap <leader>fd :action CollapseDocComments<CR>
  67. noremap <leader>fF :action CollapseRegionRecursively<CR>
  68. noremap <leader>fA :action ExpandAllRegions<CR>
  69. noremap <leader>fD :action ExpandDocComments<CR>
  70. noremap <leader>fF :action ExpandRegionRecursively<CR>
  71.  
  72. " Code generation
  73. " g = generate
  74. noremap <leader>gg :action Generate<CR>
  75. noremap <leader>gc :action GenerateConstructor<CR>
  76. noremap <leader>ga :action GenerateGetterAndSetter<CR>
  77. noremap <leader>gt :action GenerateGetter<CR>
  78. noremap <leader>gs :action GenerateSetter<CR>
  79. noremap <leader>ge :action GenerateEquals<CR>
  80. noremap <leader>gt :action GenerateTestMethod<CR>
  81. noremap <leader>gi :action ImplementMethods<CR>
  82. noremap <leader>go :action OverrideMethods<CR>
  83.  
  84. "Javadoc stuff
  85. noremap <leader>jj :action FixDocComment<CR>
  86. noremap <leader>ju :action GenerateJavadoc<CR>
  87. noremap <leader>jf :%s#\(\n\s\+\\\|\t\+\)\(/\)\(\*\+\)\n#\r\t\2\*****************************************\r#g<CR>:%s#\n\(\t\+\\\|\s\+\)\(\*\+\/\)#\r\1\****************************************/#g<CR>
  88. noremap <leader>rs :action ConvertIndentsToSpaces<CR>
  89. " Source Navigation and Source-specific shortcuts
  90. " s = source
  91. noremap <leader>ss :action FileStructurePopup<CR>
  92. noremap <leader>su :action FindUsagesInFile<CR>
  93. noremap <leader>sa :action FindUsages<CR>
  94. noremap <leader>so :action SelectAllOccurrences<CR>
  95. noremap <leader>sr :action RenameElement<CR>i
  96.  
  97. " Code Extraction
  98. " e = extract
  99. noremap <leader>ec :action ExtractClass<CR>
  100. noremap <leader>ef :action ExtractFunction<CR>
  101. noremap <leader>ei :action ExtractInterface<CR>
  102. noremap <leader>em :action ExtractMethod<CR>
  103. noremap <leader>eM :action ExtractModule<CR>
  104. noremap <leader>es :action ExtractSuperclass<CR>
  105.  
  106. " Introduce variables
  107. " i = introduce
  108. noremap <leader>ic :action IntroduceConstant<CR>
  109. noremap <leader>if :action IntroduceField<CR>
  110. noremap <leader>iF :action IntroduceFunctionalParameter<CR>
  111. noremap <leader>ip :action IntroduceParameter<CR>
  112. noremap <leader>iP :action IntroduceParameterObject<CR>
  113. noremap <leader>it :action IntroduceProperty<CR>
  114. noremap <leader>ii :action IntroduceVariable<CR>
  115. noremap <leader>II :action Inline<CR>
  116.  
  117. "Formatting shortcut
  118. noremap <leader>rf :action ReformatCode<CR>
  119. noremap <leader>rr :%s#\(case\s\+\\\|\S\+:\)\n\s\+\(return\s\\\|\S\\\|\n\{-};\)#\1 \2#g<CR>
  120. noremap <leader>rt :action ConvertIndentsToTabs<CR>
  121.  
  122. " Code hierarchy navigation
  123. " h = hierarchy
  124. noremap <leader>hi :action GotoImplementation<CR>
  125. noremap <leader>hd :action GotoDeclaration<CR>
  126. noremap <leader>ht :action GotoTypeDeclaration<CR>
  127. noremap <leader>hs :action GotoSuperMethod<CR>
  128.  
  129. " Create commands
  130. " c = create
  131. noremap <leader>cc :action NewClass<CR>
  132. noremap <leader>ce :action NewElement<CR>
  133. noremap <leader>cf :action NewFile<CR>
  134. noremap <leader>cm :action NewModule<CR>
  135. noremap <leader>cs :action NewScratchFile<CR>
  136.  
  137. " Debug commands
  138. " d = debug
  139. noremap <leader>dd :action ToggleLineBreakpoint<CR>
  140. noremap <leader>de :action EditBreakpoint<CR>
  141. noremap <leader>df :action ToggleFieldBreakpoint<CR>
  142. noremap <leader>dm :action ToggleMethodBreakpoint<CR>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement