Skip to content

Instantly share code, notes, and snippets.

@karimkod
Last active March 28, 2024 14:29
Show Gist options
  • Save karimkod/ac39d065688f03b37e56030ef6551b70 to your computer and use it in GitHub Desktop.
Save karimkod/ac39d065688f03b37e56030ef6551b70 to your computer and use it in GitHub Desktop.
ideavimrc
let mapleader = " "
set visualbell
set noerrorbells
set surround
set multiple-cursors
set scrolloff=5
set idearefactormode=keep
set relativenumber number
set ideajoin
set incsearch
set ignorecase
set relativenumber number
map Q gq
set NERDTree
" centering screen
nnoremap j jzz
nnoremap k kzz
vnoremap j jzz
vnoremap k kzz
" General actions
nnoremap <leader>rf :action Refactorings.QuickListPopupAction<CR>
"nnoremap <leader>rn :action RenameElement<CR>
nnoremap gh :action ShowErrorDescription<CR>
" nnoremap gd :action GotoDeclaration<CR>
nnoremap gi :action GotoImplementation<CR>
nnoremap ge :action GotoNextError<CR>
nnoremap gE :action GotoPreviousError<CR>
nnoremap <C-n>n :NERDTreeFocus<CR>
nnoremap <C-n>f :NERDTreeFind<CR>
nnoremap [[ :action MethodUp<CR>
nnoremap ]] :action MethodDown<CR>
nnoremap <c-t> :action ActivateTerminalToolWindow<CR>
nnoremap <leader>t :action Terminal.OpenInTerminal<CR>
nnoremap <c-z> :action ToggleDistractionFreeMode<CR>
nnoremap gcc :action CommentByLineComment<CR>
vnoremap gc :action CommentByLineComment<CR>
nnoremap <C-d> <C-d>zz
nnoremap <C-u> <C-u>zz
xnoremap <leader>p \"_dP
nnoremap <leader>d \"_d
vnoremap <leader>d \"_d
" Testing
nnoremap <leader>ut :action ActivateUnitTestsToolWindow<CR>
if &ide =~? 'rider'
nnoremap <leader>tl :action Rider.UnitTesting.QuickList<CR>
nnoremap <leader>tt :action RiderUnitTestRunContextSplitAction<CR>
nnoremap <leader>td :action RiderUnitTestDebugContextAction<CR>
nnoremap <leader>tr :action RiderUnitTestRepeatPreviousRunAction<CR>
nnoremap <leader>ta :action RiderUnitTestRunSolutionAction<CR>
endif
if &ide =~? 'intellij'
nnoremap <leader>tt :action RunClass<CR>
nnoremap <leader>td :action DebugClass<CR>
nnoremap <leader>tr :action Rerun<CR>
endif
"Debugging
nnoremap <leader>bp :action ToggleLineBreakpoint<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment