1
0
Fork 0

Compare commits

...

8 Commits

2 changed files with 97 additions and 39 deletions

View File

@ -1,6 +1,7 @@
set ignorecase
set incsearch
set number
set nrformats-=octal
set relativenumber
set scrolloff=999
set showcmd
@ -10,10 +11,51 @@ set smartcase
set virtualedit=onemore
set visualbell
" Use WSL bash as shell
if has('win32')
set shell=bash.exe
set shellcmdflag=-lic
set shellxquote=
endif
" Configure IDEA settings (https://github.com/JetBrains/ideavim/wiki/set-commands)
set ideaglobalmode
set ideajoin
set idearefactormode=visual
" Configure IDE keybindings (https://github.com/JetBrains/ideavim/wiki/sethandler)
sethandler <C-A> a:ide
sethandler <C-B> a:ide
sethandler <C-C> a:ide
sethandler <C-E> a:ide
sethandler <C-F> a:ide
sethandler <C-G> a:ide
sethandler <C-I> a:ide
sethandler <C-J> a:ide
sethandler <C-K> a:ide
sethandler <C-L> a:ide
sethandler <C-M> a:ide
sethandler <C-R> a:ide
sethandler <C-S> a:ide
sethandler <C-T> a:ide
sethandler <C-V> a:ide
sethandler <C-X> a:ide
sethandler <C-Y> a:ide
sethandler <C-\> a:ide
sethandler <A-H> a:vim
sethandler <A-L> a:vim
sethandler <A-P> a:vim
sethandler <A-X> a:vim
sethandler <C-D> a:vim
sethandler <C-I> a:vim
sethandler <C-N> a:vim
sethandler <C-O> a:vim
sethandler <C-P> a:vim
sethandler <C-U> a:vim
sethandler <C-W> a:vim
" Enable plugins (https://github.com/JetBrains/ideavim/wiki/IdeaVim-Plugins)
Plug 'argtextobj.vim'
Plug 'nerdtree'
Plug 'vim-ReplaceWithRegister'
@ -25,7 +67,7 @@ Plug 'vim-multiple-cursors'
Plug 'vim-surround'
Plug 'vim-textobj-entire'
" http://vimdoc.sourceforge.net/htmldoc/vimindex.html
" https://vimhelp.org/index.txt.html
" Map top row on Czech keyboard layout to digits
map + 1
@ -44,29 +86,22 @@ nnoremap ú @@
noremap ů ;
map § %
" Camel humps
noremap L [w
noremap H [b
" Navigate to end of previous word
nnoremap <A-b> ge
nnoremap <A-S-b> gE
" Navigate to indents
nnoremap J +
vnoremap J +
nnoremap K -
vnoremap K -
" Navigate and close tabs
noremap <A-h> gT
noremap <A-l> gt
noremap <C-w> :action CloseContent<CR>
" Navigate camel humps
nnoremap L [w
vnoremap L [w
nnoremap H [b
vnoremap H [b
" Edit camel humps
nnoremap dL :raction EditorDeleteToWordEndInDifferentHumpsMode<CR>
nnoremap dH :raction EditorDeleteToWordStartInDifferentHumpsMode<CR>
nmap dih dHdL " Only works in the middle of a hump
nmap cL dLi
nmap cH dHi
nmap cih dihi
" Increment/decrement numbers
nnoremap <Space>+ <C-a>
nnoremap <Space>- <C-x>
" Edit from cursor to start/end of parenthesized block
nnoremap c) c])
@ -80,8 +115,9 @@ nnoremap D dd
vnoremap C cc
vnoremap D dd
" Alternative way to enter visual block mode
" Enter visual block mode
nnoremap <Space>v <C-V>
onoremap <Space>v <C-V>
" Indent keeping selection
vnoremap < <gv
@ -97,13 +133,17 @@ nnoremap gp `[v`]
" Put without yank
xmap p gr
" Show parameter info
nmap <A-p> <Action>(ParameterInfo)
imap <A-p> <Action>(ParameterInfo)
" Rebind commands that will be repurposed
nnoremap GG G
nnoremap dG dG
nnoremap cG cG
nnoremap M m
nnoremap Z z
map <A-S-n> <A-p>
noremap \\ <C-w>
" Repurpose 'Enter' for statement completion (renaming function requires a custom version of IdeaVIM)
function! CompleteStatement()
@ -127,6 +167,9 @@ nmap ] :raction MethodDown<CR>
nmap { :raction JumpToLastChange<CR>
nmap } :raction JumpToNextChange<CR>
nmap <Space>( :raction KM.GotoPreviousErrorInOtherMode<CR>
nmap <Space>) :raction KM.GotoNextErrorInOtherMode<CR>
" Repurpose 'g' for navigation (:raction requires a custom version of IdeaVIM)
nmap gb :raction GotoNextBookmark<CR>
nmap gB :raction GotoPreviousBookmark<CR>
@ -134,17 +177,15 @@ nmap gd :action GotoDeclaration<CR>
nmap gD :action GotoTypeDeclaration<CR>
nmap ge :raction VcsShowNextChangeMarker<CR>
nmap gE :raction VcsShowPrevChangeMarker<CR>
map gi :action GotoImplementation<CR>
nmap gi :action GotoImplementation<CR>
map gj :raction EditorCloneCaretBelow<CR>
map gk :raction EditorCloneCaretAbove<CR>
nmap go :raction GotoNextElementUnderCaretUsage<CR>
nmap gO :raction GotoPrevElementUnderCaretUsage<CR>
nmap gr :action RecentLocations<CR>
nmap gR :action RecentChangedFiles<CR>
map gs :action GotoSuperMethod<CR>
map gS :action ShowSiblings<CR>
nmap gT /\\<class\>\\\|\\<interface\>\\\|\\<enum\>\\\|\\<object\>\\\|\\<record\>\\\|\\<struct\>\\\|\\<trait\><CR>w:nohlsearch<CR>
nmap gt gggT
nmap gs :action GotoSuperMethod<CR>
nmap gS :action ShowSiblings<CR>
map gt :raction KM.GotoNextTypeInFile<CR>
map gT :raction KM.GotoPreviousTypeInFile<CR>
nmap gu :action ShowUsages<CR>
nmap gU :action FindUsages<CR>
map gz :action NextSplitter<CR>
@ -157,8 +198,6 @@ nmap Ge ge
nmap GE gE
map Gj gj
map Gk gk
nmap Go go
nmap GO gO
nmap Gt gt
nmap GT gT
map Gz gz
@ -171,22 +210,35 @@ map zc :action EditorContextInfo<CR>
map zd :action QuickJavaDoc<CR>
map ze :action ShowErrorDescription<CR>
map zf :action SelectInProjectView<CR>
map zht :action TypeHierarchy<CR>
map zhm :action MethodHierarchy<CR>
map zhc :action CallHierarchy<CR>
map zm :action ShowBookmarks<CR>
map zp :action QuickImplementations<CR>
map zP :action QuickTypeDefinition<CR>
map zqa :action CloseAllEditors<CR>
map zqh :action CloseAllToTheLeft<CR>
map zql :action CloseAllToTheRight<CR>
map zqo :action CloseAllEditorsButActive<CR>
map zqq :action CloseContent<CR>
map zqu :action ReopenClosedTab<CR>
map zr :action RunToCursor<CR>
map zR :action ForceRunToCursor<CR>
map zsd :action MoveTabDown<CR>
map zsr :action MoveTabRight<CR>
map zsu :action Unsplit<CR>
map zsU :action UnsplitAll<CR>
map zt :action ExpressionTypeInfo<CR>
map zx :action EvaluateExpression<CR>
" Repurpose 'm' for refactoring (normal mode)
nmap md :action SafeDelete<CR>
nmap mg :action Generate<CR>
nmap mi :action Inline<CR>
nmap mn :action RenameElement<CR>
@ -211,6 +263,8 @@ nmap mr :action Refactorings.QuickListPopupAction<CR>
vmap mr :action Refactorings.QuickListPopupAction<CR>
nmap mv :action IntroduceVariable<CR>
vmap mv :action IntroduceVariable<CR>
nmap mw :action SurroundWith<CR>
vmap mw :action SurroundWith<CR>
" Actions for custom version of AceJump
set acejump

22
.vimrc
View File

@ -4,25 +4,34 @@ set history=1024
set hlsearch
set ignorecase
set incsearch
set infercase
set laststatus=2
set linebreak
set listchars=space,tab:>·,trail:~,extends:>,precedes:<
set mouse=a
set noerrorbells
set nomodeline
set noshowcmd
set noshowmode
set number
set nrformats-=octal
set relativenumber
set scrolloff=999
set shiftwidth=0
set showbreak=
set showmatch
set sidescrolloff=999
set smartcase
set tabstop=4
set ttymouse=xterm2
set wildmenu
set wrap
" Color support
set t_Co=256
" Show full description for lines and bytes
set shortmess-=l
" Show search count
set shortmess-=S
" Color scheme
syntax enable
@ -59,12 +68,6 @@ vnoremap <expr> j v:count ? 'j' : 'gj'
nnoremap <expr> k v:count ? 'k' : 'gk'
vnoremap <expr> k v:count ? 'k' : 'gk'
" Navigate to indents
nnoremap J +
vnoremap J +
nnoremap K -
vnoremap K -
" Navigate camel humps (https://github.com/vim-scripts/camelcasemotion)
map L <Plug>CamelCaseMotion_w
map H <Plug>CamelCaseMotion_b
@ -87,8 +90,9 @@ nnoremap D dd
vnoremap C cc
vnoremap D dd
" Alternative way to enter visual block mode
" Enter visual block mode
nnoremap <Space>v <C-V>
onoremap <Space>v <C-V>
" Indent keeping selection
vnoremap < <gv