Skip to content

Instantly share code, notes, and snippets.

@ArmaanCPro
Last active March 27, 2025 00:30
Show Gist options
  • Select an option

  • Save ArmaanCPro/59d559ba1587a510ae59603e212ff16c to your computer and use it in GitHub Desktop.

Select an option

Save ArmaanCPro/59d559ba1587a510ae59603e212ff16c to your computer and use it in GitHub Desktop.
simple .ideavimrc
"" .ideavimrc - Armaan Chahal (inspired by Matt Chapman)
"" Base Settings
"" =================================================================
set scrolloff=8
set relativenumber
set showmode
set showcmd
set visualbell
" Use system clipboard
set clipboard+=unnamed
set ignorecase
set smartcase
set incsearch
set hlsearch
set nu
let mapleader = " "
"" Plugin settings
"" =================================================================
set surround
set highlightedyank
set sneak
set nerdtree
"" Key mappings
"" =================================================================
" Tab navigation
nnoremap <A-n> :tabnext<CR>
nnoremap <A-p> :tabprev<CR>\
" Pane navigation
nnoremap <A-h> <C-w>h
nnoremap <A-l> <C-w>l
nnoremap <A-k> <C-w>k
nnoremap <A-j> <C-w>j
" Jump between methods
nnoremap [[ <Action>(MethodUp)
nnoremap ]] <Action>(MethodDown)
" Easy visual indentation
vnoremap < <gv
vnoremap > >gv
" Popup navigation
inoremap <C-j> <Action>(PopupMenu-selectNext)
inoremap <C-k> <Action>(PopupMenu-selectPrev)
"" Leader commands
"" =================================================================
" Comment lines
map <leader>c <action>(CommentByLineComment)
" Open NERDTree (use q to exit)
map <leader>x :NERDTreeToggle<CR>
" Folding
map <leader>zc :action CollapseAllRegions<CR>
map <leader>zo :action ExpandAllRegions<CR>
" Window splits
map <leader>wv <Action>(SplitVertically)
map <leader>ws <Action>(SplitHorizontally)
map <leader>wu <Action>(Unsplit)
map <leader>wm <Action>(MoveEditorToOppositeTabGroup)
" Display options
map <leader>dd <action>(ToggleDistractionFreeMode)
map <leader>dz <action>(ToggleZenMode)
map <leader>df <action>(ToggleFullScreen)
" Actions
map <leader>am <action>(ShowIntentionActions)
map <leader>as <action>(SearchEverywhere)
" File navigation
map <leader>pf <action>(GotoFile)
map <leader>pr <action>(RecentFiles)
map <leader>pc <action>(FindInPath)
map <leader><leader> <Action>(RecentFiles)
map <leader>pl <action>(RecentLocations)
map <leader>ps <action>(NewScratchFile)
" Close active tab
map <leader>q <action>(CloseContent)
" Refactoring
map <leader>rn <Action>(RenameElement)
map <leader>rm <Action>(ExtractMethod)
map <leader>rv <Action>(IntroduceVariable)
map <leader>rf <Action>(IntroduceField)
map <leader>rs <Action>(ChangeSignature)
map <leader>rr <Action>(Refactorings.QuickListPopupAction)
" Go to code
nmap <leader>gd <Action>(GotoDeclaration)
nmap <leader>gy <Action>(GotoTypeDeclaration)
nmap <leader>gi <Action>(GotoImplementation)
nmap <leader>gu <Action>(ShowUsages)
nmap <leader>gt <Action>(GotoTest)
nmap <leader>gf <Action>(Back)
nmap <leader>gb <Action>(Forward)
" Git windows
map <leader>gc <Action>(CheckinProject)
map <leader>gs <Action>(ActivateVersionControlToolWindow)
map <leader>gb <Action>(Git.Branches)
" Errors
map <leader>en <Action>(ReSharperGotoNextErrorInSolution)
map <leader>ep <Action>(ReSharperGotoPrevErrorInSolution)
" Debugging
map <leader>b <Action>(ToggleLineBreakpoint)
map <F8> <Action>(Debug)
map <F9> <Action>(Stop)
map <F10> <Action>(StepOver)
map <F11> <Action>(StepInto)
map <F12> <Action>(StepOut)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment