Gain productivity in IntelliJ IDEA with Vim
" .ideavimrc is a configuration file for IdeaVim plugin. It uses
" the same commands as the original .vimrc configuration.
" You can find a list of commands here: https://jb.gg/h38q75
" Find more examples here: https://jb.gg/share-ideavimrc
"" -- Suggested options --
" Show a few lines of context around the cursor. Note that this makes the
" text scroll if you mouse-click near the start or end of the window.
set scrolloff=5
Plug 'tpope/vim-surround'
Plug 'machakann/vim-highlightedyank'
set peekaboo
set number
set hlsearch
set ideajoin
" set surround
set NERDTree
let mapleader = " "
" Do incremental searching.
set incsearch
" Don't use Ex mode, use Q for formatting.
map Q gq
" :let @a='ds"f:r=f x^$hf,xj^w'
" system cliipboard
" :let @q='f.<leader><CR>f.'
vmap <leader>y "*y
vmap <leader>y "*d
nmap <leader>y "*yy
nmap gi :action GotoImplementation<CR>
nmap <leader>p "*p
nmap <leader>P "*P
vmap <leader>p "*p
vmap <leader>P "*P
nnoremap <leader>t :action ActivateTerminalToolWindow<CR>
" :let @c='f,<leader><CR>'
" :let @n='j^f(a'
:set ignorecase smartcase
nnoremap <leader>i i<space>
nnoremap <leader><CR> li<CR><Esc>
nnoremap <C-c> :action RenameElement<CR>
nnoremap <leader>fs :action FileStructurePopup<CR>
" edit ideavimconfig
nnoremap <leader>vv :e ~/.ideavimrc<CR>
nnoremap <leader>vr :source ~/.ideavimrc<CR>
nnoremap <leader>sa :action Synchronize<CR>
" running tests
" navigation
" nnoremap <leader>ra :action RunConfigurationAsAction_Run_All in atlas-dna-ledger.test_default_target<CR>
nnoremap <leader>ra :action RunConfigurationAsAction_Run_LedgerApplication_default_target<CR>
nnoremap <leader>da :action RunConfigurationAsAction_Debug_LedgerApplication_default_target<CR>
nnoremap <leader>rr :action Run<CR>
nnoremap <leader>r :action RunClass<CR>
nnoremap <leader>d :action DebugClass<CR>
" repeat in debug what was in previous run
nnoremap <leader>dr :action Debug<CR>
nnoremap <leader>b :action ToggleLineBreakpoint<CR>
nnoremap <leader>mb :action XDebugger.MuteBreakpoints<CR>
nnoremap <leader>vb :action ViewBreakpoints<CR>
nnoremap <leader>wt :action ActivateTerminalToolWindow<CR>
nnoremap <leader>wd :action ActivateDatabaseToolWindow<CR>
nnoremap <leader>wb :action ActivateBuildToolWindow<CR>
nnoremap <leader>w :action HideAllWindows<CR>
nnoremap <leader>wu :action UnsplitAll<CR>
nnoremap <leader>W :action CloseAllEditorsButActive<CR>
nnoremap <c-\> :action SplitVertically<CR>
nnoremap <c-]> :action SplitHorizontally<CR>
nnoremap <c-m> :action MoveEditorToOppositeTabGroup<CR>
nnoremap <c-[> :action ChangeSplitOrientation<CR>
nnoremap <c-h> <c-w>h
nnoremap <c-l> <c-w>l
nnoremap <c-j> <c-w>j
nnoremap <c-k> <c-w>k
nnoremap <TAB> :action NextTab<CR>
nnoremap <s-TAB> :action PreviousTab<CR>
" nnoremap ;q :action CloseEditor<CR>
" nnoremap ;a :action CloseContent<CR>
" nnoremap ;z :action CloseAllEditors<CR>
" --- Enable IdeaVim plugins https://jb.gg/ideavim-plugins
nnoremap <leader>tvm :action VimFindActionIdAction<CR>
nnoremap <leader>aa :action Annotate<CR>
nnoremap <leader>a :action ShowAnnotateOperationsPopupGroup<CR>
" Highlight copied text
" Plug 'machakann/vim-highlightedyank'
" Commentary plugin
" Plug 'tpope/vim-commentary'
nnoremap <leader>sr :action ShowLiveRunConfigurations<CR>
nnoremap <leader>zm :action ToggleZenMode<CR>
vmap <leader>ccs :action StringManipulation.ToSnakeCase<CR>
vmap <leader>ccc :action StringManipulation.ToCamelCase<CR>
vmap <leader>sw :action SurroundWith<CR>
nnoremap <leader>sm :action FileStructurePopup<CR><CR>
nnoremap <leader>cfn :action CopyFileName<CR>
nnoremap <leader>cap :action CopyAbsolutePath<CR>
nnoremap <leader>csp :action CopySourceRootPath<CR>
nnoremap <leader>crr :action CopyPathFromRepositoryRootProvider<CR>
nnoremap <leader>cr :action CopyReference<CR>
nnoremap <leader>wcg :action CloseAllEditors<CR>
nnoremap <leader>ccc :action HTTPClientConvertToCurlAndCopy<CR>
nnoremap <leader>wog :action OpenEditorInOppositeTabGroup<CR>
nnoremap <leader>bb :action ToggleBookmarkWithMnemonic<CR>
"" -- Map IDE actions to IdeaVim -- https://jb.gg/abva4t
"" Map \r to the Reformat Code action
"map \r <Action>(ReformatCode)
"" Map <leader>d to start debug
"map <leader>d <Action>(Debug)
"" Map \b to toggle the breakpoint on the current line
"map \b <Action>(ToggleLineBreakpoint)