1
0
mirror of https://github.com/chylex/dotfiles.git synced 2024-10-18 20:42:49 +02:00

Compare commits

..

No commits in common. "3b7145539ee9f4a7d4a33a7d34a1b344d0e213a0" and "63cd476e43d837955780979d0ed66b280d0babb1" have entirely different histories.

2 changed files with 39 additions and 97 deletions

View File

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

22
.vimrc
View File

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