93 lines
3.1 KiB
Plaintext
93 lines
3.1 KiB
Plaintext
" _____ _ _ _ _
|
|
" |_ _| | | | | | (_)
|
|
" | | __| | ___ __ _| | | |_ _ __ ___
|
|
" | | / _` |/ _ \/ _` | | | | | '_ ` _ \
|
|
" _| || (_| | __/ (_| \ \_/ / | | | | | |
|
|
" \___/\__,_|\___|\__,_|\___/|_|_| |_| |_|
|
|
" -----------------------------------------------------------------------------
|
|
" :: IdeaVim Configuration
|
|
" :: https://lp.jetbrains.com/ideavim/
|
|
" :: Marvin Elsen <contact@marvinelsen.com>
|
|
" -----------------------------------------------------------------------------
|
|
|
|
set scrolloff=0 " minimum number of lines above and below the cursor
|
|
|
|
set clipboard+=unnamed " Add system clipboard
|
|
|
|
set number " print the line number in front of each line
|
|
set relativenumber " show the line number relative to the line with the cursor
|
|
set idearefactormode=keep " keep the mode that was enabled before starting a refactoring
|
|
set ideajoin " join command will be performed via IDE
|
|
|
|
set hlsearch " highlight matches with the last search pattern
|
|
set ignorecase " ignore case in search patterns
|
|
set smartcase " no ignore case when pattern is uppercase
|
|
set incsearch " show where search pattern typed so far matches
|
|
set wrapscan " searches wrap around the end of file
|
|
set gdefault " the :substitute flag 'g' is by default
|
|
|
|
Plug 'machakann/vim-highlightedyank'
|
|
Plug 'tpope/vim-commentary'
|
|
Plug 'easymotion/vim-easymotion'
|
|
|
|
" Set <Leader> to the space bar
|
|
let mapleader = " "
|
|
|
|
" make Y behave like D and C, yanking till end of line
|
|
nnoremap Y y$
|
|
|
|
nnoremap x "_x
|
|
nnoremap X "_X
|
|
|
|
nmap <leader><leader> :noh<cr>
|
|
|
|
" Run & Debug
|
|
nmap <leader>gr <Action>(Run)
|
|
nmap <leader>gR <Action>(RunClass)
|
|
|
|
" Goto
|
|
nmap <leader>ge <Action>(GotoNextError)
|
|
nmap <leader>gd :vs<cr><Action>(GotoDeclaration)
|
|
nmap <leader>fu <Action>(FindUsages)
|
|
|
|
" Window Control
|
|
nmap <leader>gc <Action>(CheckinProject)
|
|
nmap <leader>gp <Action>(SelectInProjectView)
|
|
nmap <Backspace> <Action>(Back)
|
|
nmap <S-Backspace> <Action>(Forward)
|
|
|
|
" Debugging
|
|
nmap <leader>gD <Action>(Debug)
|
|
nmap <leader>bs <Action>(ToggleLineBreakpoint)
|
|
nmap <leader>ee <Action>(EvaluateExpression)
|
|
|
|
nmap <leader>w <Action>(SaveAll)
|
|
|
|
" Refactoring
|
|
nmap <leader>rr <Action>(RenameElement)
|
|
nmap <leader>rip <Action>(IntroduceParameter)
|
|
nmap <leader>riP <Action>(IntroduceProperty)
|
|
nmap <leader>ref <Action>(ExtractFunction)
|
|
nmap <leader>ril <Action>(Inline)
|
|
|
|
" Chop argument list
|
|
nmap <leader>rca <Action>(IntentionActionAsAction_org.jetbrains.kotlin.idea.codeInsight.intentions.shared.ChopArgumentListIntention)
|
|
" Chop chained function calls
|
|
nmap <leader>rcc <Action>(IntentionActionAsAction_org.jetbrains.kotlin.idea.codeInsight.intentions.shared.PutCallsOnSeparateLinesIntention)
|
|
" Add names to call arguments
|
|
nmap <leader>ran <Action>(IntentionActionAsAction_org.jetbrains.kotlin.idea.intentions.AddNamesToCallArgumentsIntention)
|
|
|
|
" Code
|
|
nmap <leader>f <Action>(ReformatCode)
|
|
nmap <leader>o <Action>(OptimizeImports)
|
|
nmap <leader>c <Action>(CommentByLineComment)
|
|
vmap <leader>c <Action>(CommentByBlockComment)<ESC>
|
|
|
|
" Don't lose selection when indenting
|
|
vnoremap < <gv
|
|
vnoremap > >gv
|
|
vnoremap = =gv
|
|
|
|
vnoremap J :m '>+1<CR>gv=gv
|
|
vnoremap K :m '<-2<CR>gv=gv
|