Skip to content

Instantly share code, notes, and snippets.

@tamirazrab
Created July 31, 2021 17:27
Show Gist options
  • Select an option

  • Save tamirazrab/fb1df9a451d9702bf838867c69b93f69 to your computer and use it in GitHub Desktop.

Select an option

Save tamirazrab/fb1df9a451d9702bf838867c69b93f69 to your computer and use it in GitHub Desktop.
Untested configurations for webstorm.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => General
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" vim options {{{
set number
set relativenumber
set ignorecase
set smartcase
set iskeyword
set incsearch
set nohlsearch
set scrolloff=8
set showmode
set showcmd
set visualbell
set noerrorbells
set colorcolumn=
set laststatus=2
set clipboard+=unnamed
" Sets how many lines of history VIM has to remember
set history=500
" Show matching brackets when text indicator is over them
set showmatch
" How many tenths of a second to blink when matching brackets
set mat=2
" }}}
""""""""""""""""""""""""""""""
" => Vim mappings
""""""""""""""""""""""""""""""
" With a map leader it's possible to do extra key combinations
" like <leader>w saves the current file
let mapleader = ";"
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => VIM user interface
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
nmap <leader>q :action CloseContent<cr>
nmap <leader>Q :action ReopenClosedTab<cr>
nmap <leader>o o<Esc>k
nmap <leader>O O<Esc>j
nmap <leader>i :action SplitHorizontally<cr>
nmap <leader>s :action SplitVertically<cr>
nmap <leader>j :action PrevSplitter<cr>
nmap <leader>k :action NextSplitter<cr>
nmap <leader>h :action Back<cr>
nmap <leader>l :action Forward<cr>
nmap <leader>L :action RecentLocations<cr>
nmap <leader>g :action GotoDeclaration<cr>
nmap <leader>u :action FindUsages<cr>
map <leader>b <Action>(ToggleLineBreakpoint)
map <leader>c <Action>(Stop)
map <leader>ca <Action>(ShowIntentionActions)
map <leader>d <Action>(Debug)
map <leader>o <Action>(FileStructurePopup)
map <leader>rn <Action>(RenameElement)
map <leader>z <Action>(ToggleDistractionFreeMode)
map <leader>ff <Action>(GotoFile)
nnoremap <leader>% :source ~/.config/ideavim/ideavimrc<cr>
nnoremap <leader>, :edit ~/.config/ideavim/ideavimrc<cr>
" To move through code in insert mode
imap <c-k> <Up>
imap <c-j> <Down>
imap <c-h> <Left>
imap <c-l> <Right>
" To cycle through suggestion - set custom shortcut
" Keymap → Editor Actions → Down I set a custom shortcut: Ctrl + J
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => VIM plugins emulation
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" ideavim options {{{
set idearefactormode=select
set commentary
set highlightedyank
set easymotion
set surround
set ideajoin
set ideastatusicon=disabled
set which-key
set notimeout
" }}}
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Plugins Configurations
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
nmap <leader>f <Plug>(easymotion-s)
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Pending test - To test then figure out whether to keep it
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
nnoremap [<space> O<esc>j
nnoremap ]<space> o<esc>k
nnoremap [q :action PreviousOccurence<cr>
nnoremap ]q :action NextOccurence<cr>
nnoremap [m :action MethodUp<cr>
nnoremap ]m :action MethodDown<cr>
nnoremap [c :action VcsShowPrevChangeMarker<cr>
nnoremap ]c :action VcsShowNextChangeMarker<cr>
" Tabs
nnoremap [b :action PreviousTab<cr>
nnoremap ]b :action NextTab<cr>
" Search
nmap <leader>/ :action Find<cr>
nmap <leader>\ :action FindInPath<cr>
" Moving lines
nmap <a-up> :action MoveLineUp<cr>
nmap <a-down> :action MoveLineDown<cr>
" Moving statements
nmap [s :action MoveStatementUp<cr>
nmap ]s :action MoveStatementDown<cr>
" Terminal
nmap <leader>T :action ActivateTerminalToolWindow<cr>
" Navigation
nmap <leader>L :action RecentLocations<cr>
nmap <leader>g :action GotoDeclaration<cr>
nmap <leader>u :action FindUsages<cr>
nmap <leader>f :action GotoFile<cr>
nmap <leader>c :action GotoClass<cr>
nmap <leader>s :action GotoSymbol<cr>
nmap <leader>; :action FileStructurePopup<cr>
nmap <leader>M :action ActivateStructureToolWindow<cr>
nmap <leader>d :action ShowErrorDescription<cr>
nmap <leader>i :action GotoImplementation<cr>
nmap <leader>I :action SelectIn<cr>
nmap <leader>e :action RecentFiles<cr>
nmap <leader>t :action GotoTest<cr>
nmap <leader>p :action JumpToLastWindow<cr>
nmap <leader>b :action ShowBookmarks<cr>
nmap <leader>a :action Switcher<cr>
" Errors
nmap <leader>x :action GotoNextError<cr>
nmap <leader>X :action GotoPreviousError<cr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment