mirror of
https://github.com/chylex/dotfiles.git
synced 2026-10-17 08:33:57 +02:00
Compare commits
11
Commits
0c2918c61e
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3533cf32ce
|
||
|
|
2fb4f5e973
|
||
|
|
ee9d1396ea
|
||
|
|
2c395cfcf7
|
||
|
|
09cfd18b80
|
||
|
|
015bea9d97
|
||
|
|
9ddf8bad60
|
||
|
|
b97e6c82e6
|
||
|
|
342417d33b
|
||
|
|
591b05b582
|
||
|
|
3fe53230ec
|
+68
-26
@@ -1,3 +1,6 @@
|
|||||||
|
" Some of these mapping require a custom build of IdeaVIM: https://github.com/chylex/IntelliJ-IdeaVim
|
||||||
|
" One of the changes is that 'map' ignores Select mode to keep mappings simpler.
|
||||||
|
|
||||||
set clipboard-=ideaput
|
set clipboard-=ideaput
|
||||||
set hlsearch
|
set hlsearch
|
||||||
set ignorecase
|
set ignorecase
|
||||||
@@ -85,6 +88,10 @@ sethandler <C-Left> a:vim
|
|||||||
sethandler <S-Left> a:vim
|
sethandler <S-Left> a:vim
|
||||||
sethandler <C-Right> a:vim
|
sethandler <C-Right> a:vim
|
||||||
sethandler <S-Right> a:vim
|
sethandler <S-Right> a:vim
|
||||||
|
sethandler <C-Up> a:vim
|
||||||
|
sethandler <S-Up> a:vim
|
||||||
|
sethandler <C-Down> a:vim
|
||||||
|
sethandler <S-Down> a:vim
|
||||||
|
|
||||||
if &ide =~? 'rider'
|
if &ide =~? 'rider'
|
||||||
" These shortcuts are broken in Rider for some reason...
|
" These shortcuts are broken in Rider for some reason...
|
||||||
@@ -94,6 +101,7 @@ endif
|
|||||||
|
|
||||||
" Enable plugins (https://github.com/JetBrains/ideavim/wiki/IdeaVim-Plugins)
|
" Enable plugins (https://github.com/JetBrains/ideavim/wiki/IdeaVim-Plugins)
|
||||||
Plug 'argtextobj.vim'
|
Plug 'argtextobj.vim'
|
||||||
|
Plug 'vim-abolish'
|
||||||
Plug 'vim-exchange'
|
Plug 'vim-exchange'
|
||||||
Plug 'vim-highlightedyank'
|
Plug 'vim-highlightedyank'
|
||||||
Plug 'vim-indent-object'
|
Plug 'vim-indent-object'
|
||||||
@@ -102,6 +110,7 @@ Plug 'vim-multiple-cursors'
|
|||||||
Plug 'vim-paragraph-motion'
|
Plug 'vim-paragraph-motion'
|
||||||
Plug 'vim-surround'
|
Plug 'vim-surround'
|
||||||
Plug 'vim-textobj-entire'
|
Plug 'vim-textobj-entire'
|
||||||
|
Plug 'vim-textobj-function'
|
||||||
|
|
||||||
" https://vimhelp.org/index.txt.html
|
" https://vimhelp.org/index.txt.html
|
||||||
|
|
||||||
@@ -126,17 +135,22 @@ noremap § `
|
|||||||
noremap §§ ``
|
noremap §§ ``
|
||||||
nnoremap m§ m
|
nnoremap m§ m
|
||||||
|
|
||||||
sunmap ů
|
|
||||||
sunmap §
|
|
||||||
|
|
||||||
" Enter visual block mode
|
" Enter visual block mode
|
||||||
map <A-v> <C-v>
|
map <A-v> <C-v>
|
||||||
|
|
||||||
|
" Invert soft wrap navigation bindings
|
||||||
|
noremap 0 g0
|
||||||
|
noremap g0 0
|
||||||
|
|
||||||
|
noremap ^ g^
|
||||||
|
noremap g^ ^
|
||||||
|
|
||||||
|
noremap $ g$
|
||||||
|
noremap g$ $
|
||||||
|
|
||||||
" Navigate camel humps
|
" Navigate camel humps
|
||||||
noremap L [w
|
noremap L [w
|
||||||
noremap H [b
|
noremap H [b
|
||||||
nnoremap L [w
|
|
||||||
nnoremap H [b
|
|
||||||
|
|
||||||
" Navigate to end of previous word
|
" Navigate to end of previous word
|
||||||
noremap <A-e> ge
|
noremap <A-e> ge
|
||||||
@@ -149,10 +163,10 @@ noremap g{ [{
|
|||||||
noremap g} ]}
|
noremap g} ]}
|
||||||
|
|
||||||
" Edit from cursor to start/end of parenthesized block
|
" Edit from cursor to start/end of parenthesized block
|
||||||
nnoremap c) c])
|
onoremap ) ])
|
||||||
nnoremap d) d])
|
onoremap ( [(
|
||||||
nnoremap c( c[((
|
onoremap } ]}
|
||||||
nnoremap d( c[((<Esc>l
|
onoremap { [{
|
||||||
|
|
||||||
" Create lines
|
" Create lines
|
||||||
nnoremap go o<Esc>$
|
nnoremap go o<Esc>$
|
||||||
@@ -160,12 +174,24 @@ nnoremap gO O<Esc>$
|
|||||||
nnoremap g<CR> i<CR><Left><Esc>
|
nnoremap g<CR> i<CR><Left><Esc>
|
||||||
|
|
||||||
" Edit current line
|
" Edit current line
|
||||||
nnoremap C cc
|
noremap C cc
|
||||||
xnoremap C cc
|
noremap D dd
|
||||||
nnoremap D dd
|
noremap < <<
|
||||||
xnoremap D dd
|
|
||||||
nnoremap < <<
|
" Navigate with selection
|
||||||
nnoremap > >>
|
nmap <S-Up> v<Up>
|
||||||
|
nmap <S-Down> v<Down>
|
||||||
|
nmap <S-Left> v<Left>
|
||||||
|
nmap <S-Right> v<Right>
|
||||||
|
nmap <S-Home> v<Home>
|
||||||
|
nmap <S-End> v<End>
|
||||||
|
|
||||||
|
vmap <S-Up> <Up>
|
||||||
|
vmap <S-Down> <Down>
|
||||||
|
vmap <S-Left> <Left>
|
||||||
|
vmap <S-Right> <Right>
|
||||||
|
vmap <S-Home> <Home>
|
||||||
|
vmap <S-End> <End>
|
||||||
|
|
||||||
" Indent keeping selection
|
" Indent keeping selection
|
||||||
xnoremap < <gv
|
xnoremap < <gv
|
||||||
@@ -176,9 +202,6 @@ xnoremap = =gv
|
|||||||
map <A-m> <Action>(EditorSelectWord)
|
map <A-m> <Action>(EditorSelectWord)
|
||||||
map <A-S-m> <Action>(EditorUnSelectWord)
|
map <A-S-m> <Action>(EditorUnSelectWord)
|
||||||
|
|
||||||
" Turn capital letters into opposite actions
|
|
||||||
" nnoremap U :redo<CR> " Handled by custom version of IdeaVIM
|
|
||||||
|
|
||||||
" Reselect pasted text
|
" Reselect pasted text
|
||||||
nnoremap gp `[v`]
|
nnoremap gp `[v`]
|
||||||
|
|
||||||
@@ -186,6 +209,13 @@ nnoremap gp `[v`]
|
|||||||
xnoremap p P
|
xnoremap p P
|
||||||
xnoremap P p
|
xnoremap P p
|
||||||
|
|
||||||
|
" Fix undo/redo
|
||||||
|
nmap u <Action>($Undo)
|
||||||
|
xmap u <Action>($Undo)
|
||||||
|
|
||||||
|
nmap U <Action>($Redo)
|
||||||
|
xmap U <Action>($Redo)
|
||||||
|
|
||||||
" Clear search highlights
|
" Clear search highlights
|
||||||
nnoremap <Esc> :nohlsearch<Return><Esc>
|
nnoremap <Esc> :nohlsearch<Return><Esc>
|
||||||
|
|
||||||
@@ -203,8 +233,10 @@ map <BS> <Action>(Back)
|
|||||||
map <S-BS> <Action>(Forward)
|
map <S-BS> <Action>(Forward)
|
||||||
|
|
||||||
" Navigate inspection highlights
|
" Navigate inspection highlights
|
||||||
map ( <Action>(GotoPreviousError)
|
nmap ( <Action>(GotoPreviousError)
|
||||||
map ) <Action>(GotoNextError)
|
xmap ( <Action>(GotoPreviousError)
|
||||||
|
nmap ) <Action>(GotoNextError)
|
||||||
|
xmap ) <Action>(GotoNextError)
|
||||||
|
|
||||||
map <C-A-S-s> <Action>(KM.GotoPreviousErrorInOtherMode)
|
map <C-A-S-s> <Action>(KM.GotoPreviousErrorInOtherMode)
|
||||||
map <D-S-s> <Action>(KM.GotoPreviousErrorInOtherMode)
|
map <D-S-s> <Action>(KM.GotoPreviousErrorInOtherMode)
|
||||||
@@ -216,8 +248,10 @@ map [ <Action>(MethodUp)
|
|||||||
map ] <Action>(MethodDown)
|
map ] <Action>(MethodDown)
|
||||||
|
|
||||||
" Navigate paragraphs at indentation
|
" Navigate paragraphs at indentation
|
||||||
map { <Plug>(ParagraphPrevMotion)$
|
nmap { <Plug>(ParagraphPrevMotion)$
|
||||||
map } <Plug>(ParagraphNextMotion)$
|
xmap { <Plug>(ParagraphPrevMotion)$
|
||||||
|
nmap } <Plug>(ParagraphNextMotion)$
|
||||||
|
xmap } <Plug>(ParagraphNextMotion)$
|
||||||
|
|
||||||
" Move statement/element
|
" Move statement/element
|
||||||
map <A-S-h> <Action>(MoveElementLeft)
|
map <A-S-h> <Action>(MoveElementLeft)
|
||||||
@@ -235,6 +269,13 @@ imap <expr> <A-k> pumvisible() ? '<Action>(EditorUp)' : '<Action>(EditorCloneCar
|
|||||||
|
|
||||||
xmap gl <Action>(EditorAddCaretPerSelectedLine)
|
xmap gl <Action>(EditorAddCaretPerSelectedLine)
|
||||||
|
|
||||||
|
let g:multi_cursor_use_default_mapping = 0
|
||||||
|
|
||||||
|
nmap <A-n> <Plug>NextWholeOccurrence
|
||||||
|
xmap <A-n> <Plug>NextWholeOccurrence
|
||||||
|
xmap <A-x> <Plug>SkipOccurrence
|
||||||
|
xmap <A-p> <Plug>RemoveOccurrence
|
||||||
|
|
||||||
" Manage editor tabs
|
" Manage editor tabs
|
||||||
map <C-w>m <Action>(MoveEditorToOppositeTabGroup)
|
map <C-w>m <Action>(MoveEditorToOppositeTabGroup)
|
||||||
map <C-w>s <Action>(MoveTabDown)
|
map <C-w>s <Action>(MoveTabDown)
|
||||||
@@ -263,8 +304,8 @@ noremap g[ [
|
|||||||
nnoremap M m
|
nnoremap M m
|
||||||
nnoremap Z z
|
nnoremap Z z
|
||||||
|
|
||||||
" Repurpose 'Enter' for statement completion ('isactionenabled' requires a custom version of IdeaVIM)
|
" Repurpose 'Enter' for statement completion ('isactionenabled' and 'isinplacerenaming' require a custom version of IdeaVIM)
|
||||||
nmap <Enter> <Action>(EditorCompleteStatement)
|
nmap <expr> <Enter> isinplacerenaming() ? '<Action>(NextTemplateVariable)' : '<Action>(EditorCompleteStatement)'
|
||||||
|
|
||||||
imap <expr> <C-Enter> isactionenabled('Console.Jdbc.Execute') ? '<Action>(Console.Jdbc.Execute)' : '<Action>(EditorCompleteStatement)'
|
imap <expr> <C-Enter> isactionenabled('Console.Jdbc.Execute') ? '<Action>(Console.Jdbc.Execute)' : '<Action>(EditorCompleteStatement)'
|
||||||
imap <expr> <D-Enter> isactionenabled('Console.Jdbc.Execute') ? '<Action>(Console.Jdbc.Execute)' : '<Action>(EditorCompleteStatement)'
|
imap <expr> <D-Enter> isactionenabled('Console.Jdbc.Execute') ? '<Action>(Console.Jdbc.Execute)' : '<Action>(EditorCompleteStatement)'
|
||||||
@@ -282,14 +323,14 @@ map ge <Action>(VcsShowNextChangeMarker)
|
|||||||
map gE <Action>(VcsShowPrevChangeMarker)
|
map gE <Action>(VcsShowPrevChangeMarker)
|
||||||
map gf <Action>(VimJumpToSource)<Action>(HideActiveWindow)
|
map gf <Action>(VimJumpToSource)<Action>(HideActiveWindow)
|
||||||
map gi <Action>(GotoImplementation)
|
map gi <Action>(GotoImplementation)
|
||||||
map gr <Action>(RecentLocations)
|
map gr <Action>(GotoRelated)
|
||||||
map gR <Action>(RecentChangedFiles)
|
|
||||||
map gs <Action>(GotoSuperMethod)
|
map gs <Action>(GotoSuperMethod)
|
||||||
map gS <Action>(ShowSiblings)
|
map gS <Action>(ShowSiblings)
|
||||||
map gt gg<Action>(KM.GotoNextTypeInFile)
|
map gt gg<Action>(KM.GotoNextTypeInFile)
|
||||||
map gT <Action>(KM.GotoNextTypeInFile)
|
map gT <Action>(KM.GotoNextTypeInFile)
|
||||||
map gu <Action>(ShowUsages)
|
map gu <Action>(ShowUsages)
|
||||||
map gU <Action>(FindUsages)
|
map gU <Action>(FindUsages)
|
||||||
|
map g<BS> <Action>(RecentLocations)
|
||||||
|
|
||||||
" Repurpose 'z' for view actions and debugger
|
" Repurpose 'z' for view actions and debugger
|
||||||
map za <Action>(Annotate)
|
map za <Action>(Annotate)
|
||||||
@@ -306,6 +347,7 @@ map zr <Action>(RunToCursor)
|
|||||||
map zR <Action>(ForceRunToCursor)
|
map zR <Action>(ForceRunToCursor)
|
||||||
map zs <Action>(osmedile.intellij.stringmanip.PopupChoiceAction)
|
map zs <Action>(osmedile.intellij.stringmanip.PopupChoiceAction)
|
||||||
map zt <Action>(ExpressionTypeInfo)
|
map zt <Action>(ExpressionTypeInfo)
|
||||||
|
map zw <Action>(EditorToggleUseSoftWraps)
|
||||||
map zx <Action>(EvaluateExpression)
|
map zx <Action>(EvaluateExpression)
|
||||||
|
|
||||||
map zht <Action>(TypeHierarchy)
|
map zht <Action>(TypeHierarchy)
|
||||||
|
|||||||
@@ -35,10 +35,10 @@
|
|||||||
- name: Update .vim folder
|
- name: Update .vim folder
|
||||||
copy:
|
copy:
|
||||||
remote_src: true
|
remote_src: true
|
||||||
directory_mode: true
|
|
||||||
src: ~/.dotfiles/.vim
|
src: ~/.dotfiles/.vim
|
||||||
dest: ~/
|
dest: ~/
|
||||||
mode: "700"
|
mode: "600"
|
||||||
|
directory_mode: "700"
|
||||||
|
|
||||||
- name: Update .tmux.conf file
|
- name: Update .tmux.conf file
|
||||||
copy:
|
copy:
|
||||||
|
|||||||
Reference in New Issue
Block a user