mirror of
https://github.com/pratiktri/dotfiles.git
synced 2026-02-04 16:41:43 +05:30
- Ideavim config: organized, added more VIM options, more keymaps - .profile updated to map the caps-lock key to escape on system login - .zshrc updated to enable VIM mode on zsh shell - Removed LazyVim config - would reconfigure it from scratch
87 lines
2.9 KiB
Plaintext
87 lines
2.9 KiB
Plaintext
" You can find a list of commands here: https://jb.gg/h38q75
|
|
" Find more examples here: https://jb.gg/share-ideavimrc
|
|
" Examples to map IDE actions to IdeaVim -- https://jb.gg/abva4t
|
|
" Enable IdeaVim plugins https://jb.gg/ideavim-plugins
|
|
|
|
" Source .vimrc
|
|
"source ~/.vimrc
|
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
" Searches
|
|
set hlsearch " highlight search occurrences
|
|
set ignorecase " ignore case in search patterns
|
|
set smartcase " no ignore case when pattern is uppercase
|
|
set incsearch " show search results while typing
|
|
set wrapscan " searches wrap around the end of the file
|
|
|
|
" common settings
|
|
set gdefault " substitute all occurrences in line
|
|
set history=10000 " command line history
|
|
set scrolloff=5 sidescrolloff=10 " Keep some line before and after the cursor visible
|
|
set clipboard^=unnamed,unnamedplus,ideaput " Copy to and from system clipboard
|
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
"keymaps
|
|
let mapleader = " "
|
|
|
|
" Don't use Ex mode, use Q for formatting
|
|
map Q gq
|
|
|
|
" Map <leader>d to start debug
|
|
"map <leader>d <Action>(Debug)
|
|
" Map \b to toggle breakpoint
|
|
"map \b <Action>(ToggleLineBreakpoint)
|
|
|
|
" Center the cursor when doing 1/2 page down and page up
|
|
nnoremap <C-d> <C-d>zz
|
|
nnoremap <C-u> <C-u>zz
|
|
|
|
" clear search highlighting
|
|
nnoremap <leader>/ :nohls<return><esc>
|
|
|
|
" code navigations
|
|
nmap <leader>e :action GotoFile<CR>
|
|
nmap <leader>a :action FindInPath<CR>
|
|
nmap gr :action ShowUsages<CR>
|
|
nmap gi :action GotoImplementation<CR>
|
|
nmap gs :action GotoSuperMethod<CR>
|
|
nmap <leader>tn :action NextTab<CR>
|
|
nmap <leader>tp :action PreviousTab<CR>
|
|
|
|
nmap <C-p> :action ParameterInfo<CR>
|
|
imap <C-p> <C-o>:action ParameterInfo<CR>
|
|
nmap <leader>n :action GotoNextError<CR>
|
|
map gh <Action>(ShowErrorDescription)
|
|
|
|
" code refactoring
|
|
nmap <leader>ri :action Inline<CR>
|
|
nmap <leader>rr :action RenameElement<CR>
|
|
nmap <leader>rev :action IntroduceVariable<CR>
|
|
vmap <leader>rev :action IntroduceVariable<CR>
|
|
nmap <leader>rem :action ExtractMethod<CR>
|
|
vmap <leader>rem :action ExtractMethod<CR>
|
|
nmap <leader>rm :action Move<CR>
|
|
nmap <leader>ro :action OptimizeImports<CR>
|
|
nmap <leader>rG :action Generate<CR>
|
|
nmap <leader>rf :action ReformatCode<CR>
|
|
|
|
" Easy motion
|
|
map <leader>J <Plug>(easymotion-s)
|
|
map <leader>j <Plug>(easymotion-f)
|
|
|
|
nmap <leader>gr :action Vcs.RollbackChangedLines<CR>
|
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
" Enabled plugins
|
|
set ideajoin
|
|
Plug 'easymotion/vim-easymotion'
|
|
Plug 'preservim/NERDTree'
|
|
Plug 'tpope/surround'
|
|
Plug 'tpope/commentary'
|
|
Plug 'machakann/highlightedyank'
|
|
Plug 'dbakker/vim-paragraph-motion'
|
|
Plug 'chrisbra/matchit'
|
|
Plug 'tpope/vim-repeat' " Repeat for Surround
|
|
Plug 'airblade/vim-gitgutter' " Git gutter icons
|
|
Plug 'mg979/vim-visual-multi' " Multi Line Editing
|