Adds new ideavimrc
This commit is contained in:
parent
736d3ab335
commit
1d1ec0138f
1 changed files with 202 additions and 37 deletions
239
.ideavimrc
239
.ideavimrc
|
|
@ -1,43 +1,208 @@
|
||||||
" .ideavimrc is a configuration file for IdeaVim plugin. It uses
|
"" .ideavimrc - Matt Chapman
|
||||||
" the same commands as the original .vimrc configuration.
|
|
||||||
" You can find a list of commands here: https://jb.gg/h38q75
|
|
||||||
" Find more examples here: https://jb.gg/share-ideavimrc
|
"" Base Settings
|
||||||
|
"" ========================================================
|
||||||
|
|
||||||
|
set scrolloff=10
|
||||||
|
set linenumber
|
||||||
|
set showmode
|
||||||
|
set showcmd
|
||||||
|
|
||||||
|
set smartcase
|
||||||
|
set incsearch
|
||||||
|
set hlsearch
|
||||||
|
|
||||||
|
set visualbell
|
||||||
|
|
||||||
|
" Use system clipboard
|
||||||
|
set clipboard+=unnamed
|
||||||
|
|
||||||
let mapleader = " "
|
let mapleader = " "
|
||||||
|
|
||||||
"" -- Suggested options --
|
|
||||||
" Show a few lines of context around the cursor. Note that this makes the
|
|
||||||
" text scroll if you mouse-click near the start or end of the window.
|
|
||||||
set scrolloff=5
|
|
||||||
set clipboard+=unnamed
|
|
||||||
|
|
||||||
" Do incremental searching.
|
"" Plugin Settings
|
||||||
set incsearch
|
"" ========================================================
|
||||||
|
|
||||||
" Don't use Ex mode, use Q for formatting.
|
set surround
|
||||||
map Q gq
|
set highlightedyank
|
||||||
|
set sneak
|
||||||
" --- Enable IdeaVim plugins https://jb.gg/ideavim-plugins
|
set nerdtree
|
||||||
|
|
||||||
" Highlight copied text
|
|
||||||
Plug 'machakann/vim-highlightedyank'
|
|
||||||
" Commentary plugin
|
|
||||||
Plug 'tpope/vim-commentary'
|
|
||||||
|
|
||||||
Plug 'preservim/nerdtree'
|
|
||||||
|
|
||||||
|
|
||||||
"" -- Map IDE actions to IdeaVim -- https://jb.gg/abva4t
|
|
||||||
"" Map \r to the Reformat Code action
|
|
||||||
"map \r <Action>(ReformatCode)
|
|
||||||
|
|
||||||
"" Map <leader>d to start debug
|
|
||||||
map <leader>d <Action>(Debug)
|
|
||||||
|
|
||||||
"" Map \b to toggle the breakpoint on the current line
|
|
||||||
"map \b <Action>(ToggleLineBreakpoint)
|
|
||||||
|
|
||||||
map <leader>e :NERDTreeToggle<CR>
|
|
||||||
map <leader>f :NERDTreeFind
|
|
||||||
let g:NERDTreeMapActivateNode = "l"
|
let g:NERDTreeMapActivateNode = "l"
|
||||||
let g:NERDTreeMapCloseDir = "h"
|
let g:NERDTreeMapCloseDir = "h"
|
||||||
|
|
||||||
|
" Easymotion settings
|
||||||
|
set easymotion
|
||||||
|
set notimeout
|
||||||
|
|
||||||
|
" Which-key settings
|
||||||
|
set which-key
|
||||||
|
let g:WhichKey_FontSize = 16
|
||||||
|
let g:WhichKey_CommandColor = "#41ead4"
|
||||||
|
let g:WhichKey_PrefixColor = "#f335b2"
|
||||||
|
let g:WhichKey_SortOrder = "by_key_prefix_first"
|
||||||
|
|
||||||
|
let g:WhichKeyDesc_leader = "<leader> Leader key"
|
||||||
|
|
||||||
|
let g:WhichKeyDesc_leader = "<leader>x Open file explorer"
|
||||||
|
|
||||||
|
let g:WhichKeyDesc_easymotion = "<leader>j Jump with Easymotion"
|
||||||
|
let g:WhichKeyDesc_easymotion_prefix = "<leader><leader>"
|
||||||
|
|
||||||
|
let g:WhichKeyDesc_comment = "<leader>c Comment line"
|
||||||
|
|
||||||
|
let g:WhichKeyDesc_fold = "<leader>z Folding"
|
||||||
|
let g:WhichKeyDesc_fold_all = "<leader>zc Fold all regions"
|
||||||
|
let g:WhichKeyDesc_unfold_all = "<leader>zo Unfold all regions"
|
||||||
|
|
||||||
|
let g:WhichKeyDesc_window = "<leader>w Window splits"
|
||||||
|
let g:WhichKeyDesc_window_split_vertically = "<leader>wv Split vertically"
|
||||||
|
let g:WhichKeyDesc_window_split_horizontally = "<leader>wh Split horizontally"
|
||||||
|
let g:WhichKeyDesc_window_split_unsplit = "<leader>wu Unsplit"
|
||||||
|
let g:WhichKeyDesc_window_split_move_editor = "<leader>wm Move editor to opposite tab group"
|
||||||
|
|
||||||
|
|
||||||
|
let g:WhichKeyDesc_display = "<leader>d Display options"
|
||||||
|
let g:WhichKeyDesc_zen_mode = "<leader>dz Toggle Zen mode"
|
||||||
|
let g:WhichKeyDesc_df_mode = "<leader>dd Toggle Distraction-Free mode"
|
||||||
|
let g:WhichKeyDesc_fullscreen = "<leader>df Toggle full screen"
|
||||||
|
|
||||||
|
let g:WhichKeyDesc_action= "<leader>a Actions"
|
||||||
|
let g:WhichKeyDesc_action_context_menu = "<leader>am Open context menu"
|
||||||
|
let g:WhichKeyDesc_action_search = "<leader>as Open command modal"
|
||||||
|
|
||||||
|
let g:WhichKeyDesc_file_quickLook = "<leader><leader> Recent files"
|
||||||
|
|
||||||
|
let g:WhichKeyDesc_file_nav = "<leader>f File navigation"
|
||||||
|
let g:WhichKeyDesc_file_nav_goto_file = "<leader>ff Go to file"
|
||||||
|
let g:WhichKeyDesc_file_nav_goto_content = "<leader>fc Search for file content"
|
||||||
|
let g:WhichKeyDesc_file_nav_show_recent_files = "<leader>fr Show recent files"
|
||||||
|
let g:WhichKeyDesc_file_nav_show_recent_locations = "<leader>fl Show recent locations"
|
||||||
|
|
||||||
|
let g:WhichKeyDesc_close_tab = "<leader>q Close active tab"
|
||||||
|
|
||||||
|
let g:WhichKeyDesc_refactoring = "<leader>r Refactoring menu"
|
||||||
|
let g:WhichKeyDesc_refactoring_rename = "<leader>rn Rename element"
|
||||||
|
let g:WhichKeyDesc_refactoring_method = "<leader>rm Extract method"
|
||||||
|
let g:WhichKeyDesc_refactoring_variable = "<leader>rv Introduce variable"
|
||||||
|
let g:WhichKeyDesc_refactoring_field = "<leader>rf Introduce field"
|
||||||
|
let g:WhichKeyDesc_refactoring_signature = "<leader>rs Change signature"
|
||||||
|
let g:WhichKeyDesc_refactoring_all = "<leader>rr Open refactorings list"
|
||||||
|
|
||||||
|
let g:WhichKeyDesc_goto = "<leader>g Go to X"
|
||||||
|
let g:WhichKeyDesc_goto_declaration = "<leader>gd Go to Definition"
|
||||||
|
let g:WhichKeyDesc_goto_type_declaration = "<leader>gy Go to Type Definition"
|
||||||
|
let g:WhichKeyDesc_goto_implementation = "<leader>gi Go to Implementation"
|
||||||
|
let g:WhichKeyDesc_goto_usages = "<leader>gu Go to Usages"
|
||||||
|
let g:WhichKeyDesc_goto_test = "<leader>gt Go to Test"
|
||||||
|
let g:WhichKeyDesc_goto_back = "<leader>gb Go Back"
|
||||||
|
let g:WhichKeyDesc_goto_forward = "<leader>gf Go Forward"
|
||||||
|
|
||||||
|
let g:WhichKeyDesc_git = "<leader>g Git operations"
|
||||||
|
let g:WhichKeyDesc_git_commit = "<leader>gc Open Git commit dialog"
|
||||||
|
let g:WhichKeyDesc_git_status = "<leader>gs Open Git status dialog"
|
||||||
|
let g:WhichKeyDesc_git_branches = "<leader>gb Open Git branches list"
|
||||||
|
|
||||||
|
let g:WhichKeyDesc_errors = "<leader>e Error navigation"
|
||||||
|
let g:WhichKeyDesc_errors_next = "<leader>en Go to next error in solution"
|
||||||
|
let g:WhichKeyDesc_errors_prev = "<leader>ep Go to previous error in solution"
|
||||||
|
|
||||||
|
|
||||||
|
"" Key mappings
|
||||||
|
"" ========================================================
|
||||||
|
|
||||||
|
inoremap jj <Esc>
|
||||||
|
|
||||||
|
" Tab navigation
|
||||||
|
nnoremap <A-n> :tabnext<CR>
|
||||||
|
nnoremap <A-p> :tabprev<CR>
|
||||||
|
|
||||||
|
" Pane navigation
|
||||||
|
nnoremap <A-h> <C-w>h
|
||||||
|
nnoremap <A-l> <C-w>l
|
||||||
|
nnoremap <A-k> <C-w>k
|
||||||
|
nnoremap <A-j> <C-w>j
|
||||||
|
|
||||||
|
" Jump between methods
|
||||||
|
nnoremap [[ <Action>(MethodUp)
|
||||||
|
nnoremap ]] <Action>(MethodDown)
|
||||||
|
|
||||||
|
" Easy visual indentation
|
||||||
|
vnoremap < <gv
|
||||||
|
vnoremap > >gv
|
||||||
|
|
||||||
|
" Execute macro saved in 'q' register
|
||||||
|
nnoremap qj @q
|
||||||
|
|
||||||
|
" Popup navigation
|
||||||
|
inoremap <C-j> <Action>(PopupMenu-selectNext)
|
||||||
|
inoremap <C-k> <Action>(PopupMenu-selectPrev)
|
||||||
|
|
||||||
|
|
||||||
|
"" Leader commands
|
||||||
|
"" ========================================================
|
||||||
|
|
||||||
|
" Comment lines
|
||||||
|
map <leader>c <action>(CommentByLineComment)
|
||||||
|
|
||||||
|
" Jump around with easymotion
|
||||||
|
map <leader>j <Plug>(easymotion-s)
|
||||||
|
|
||||||
|
" Open NERDTree (use q to exit)
|
||||||
|
map <leader>x :NERDTreeToggle<CR>
|
||||||
|
|
||||||
|
" Folding
|
||||||
|
map <leader>zc :action CollapseAllRegions<CR>
|
||||||
|
map <leader>zo :action ExpandAllRegions<CR>
|
||||||
|
|
||||||
|
" Window splits
|
||||||
|
map <leader>wv <Action>(SplitVertically)
|
||||||
|
map <leader>ws <Action>(SplitHorizontally)
|
||||||
|
map <leader>wu <Action>(Unsplit)
|
||||||
|
map <leader>wm <Action>(MoveEditorToOppositeTabGroup)
|
||||||
|
|
||||||
|
" Display options
|
||||||
|
map <leader>dd <action>(ToggleDistractionFreeMode)
|
||||||
|
map <leader>dz <action>(ToggleZenMode)
|
||||||
|
map <leader>df <action>(ToggleFullScreen)
|
||||||
|
|
||||||
|
" Actions
|
||||||
|
map <leader>am <action>(ShowIntentionActions)
|
||||||
|
map <leader>as <action>(SearchEverywhere)
|
||||||
|
|
||||||
|
" File navigation
|
||||||
|
map <leader>ff <action>(GotoFile)
|
||||||
|
map <leader>fr <action>(RecentFiles)
|
||||||
|
map <leader>fc <action>(FindInPath)
|
||||||
|
map <leader><leader> <Action>(RecentFiles)
|
||||||
|
map <leader>fl <action>(RecentLocations)
|
||||||
|
map <leader>fs <action>(NewScratchFile)
|
||||||
|
|
||||||
|
" Close active tab
|
||||||
|
map <leader>q <action>(CloseContent)
|
||||||
|
|
||||||
|
" Refactoring
|
||||||
|
map <leader>rn <Action>(RenameElement)
|
||||||
|
map <leader>rm <Action>(ExtractMethod)
|
||||||
|
map <leader>rv <Action>(IntroduceVariable)
|
||||||
|
map <leader>rf <Action>(IntroduceField)
|
||||||
|
map <leader>rs <Action>(ChangeSignature)
|
||||||
|
map <leader>rr <Action>(Refactorings.QuickListPopupAction)
|
||||||
|
|
||||||
|
" Go to code
|
||||||
|
nmap <leader>gd <Action>(GotoDeclaration)
|
||||||
|
nmap <leader>gy <Action>(GotoTypeDeclaration)
|
||||||
|
nmap <leader>gi <Action>(GotoImplementation)
|
||||||
|
nmap <leader>gu <Action>(ShowUsages)
|
||||||
|
nmap <leader>gt <Action>(GotoTest)
|
||||||
|
nmap <leader>gf <Action>(Back)
|
||||||
|
nmap <leader>gb <Action>(Forward)
|
||||||
|
|
||||||
|
" Git windows
|
||||||
|
map <leader>gc <Action>(CheckinProject)
|
||||||
|
map <leader>gs <Action>(ActivateVersionControlToolWindow)
|
||||||
|
map <leader>gb <Action>(Git.Branches)
|
||||||
|
|
||||||
|
" Errors
|
||||||
|
map <leader>en <Action>(ReSharperGotoNextErrorInSolution)
|
||||||
|
map <leader>ep <Action>(ReSharperGotoPrevErrorInSolution)
|
||||||
Loading…
Add table
Add a link
Reference in a new issue