- .gitignore updated to add more JS specific things and log files

- 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
This commit is contained in:
Pratik Tripathy
2023-11-17 16:01:23 +05:30
parent 2fff17cb88
commit 76bd4806ed
39 changed files with 117 additions and 1317 deletions

View File

@@ -1,54 +1,86 @@
" .ideavimrc is a configuration file for IdeaVim plugin. It uses
" 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
" Examples to map IDE actions to IdeaVim -- https://jb.gg/abva4t
" Enable IdeaVim plugins https://jb.gg/ideavim-plugins
" Source your .vimrc
source ~/.vimrc
" Source .vimrc
"source ~/.vimrc
"" -- 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
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" 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
" Quick scope for motions with f, t, F & T
" https://plugins.jetbrains.com/plugin/19417-ideavim-quickscope
" set quickscope
" 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
" Do incremental searching.
set incsearch
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"keymaps
let mapleader = " "
" Don't use Ex mode, use Q for formatting.
" Don't use Ex mode, use Q for formatting
map Q gq
" Copy to and from system clipboard
set clipboard^=unnamed,unnamedplus
" --- Enable IdeaVim plugins https://jb.gg/ideavim-plugins
" Highlight copied text
Plug 'machakann/vim-highlightedyank'
" Commentary plugin
Plug 'tpope/vim-commentary'
" Surround Plugin
Plug 'tpope/vim-surround'
" Repeat for Surround
Plug 'tpope/vim-repeat'
" Paragraph Motion
Plug 'dbakker/vim-paragraph-motion'
" Git gutter icons
Plug 'airblade/vim-gitgutter',
"" -- 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 to start debug
"map <leader>d <Action>(Debug)
"" Map \b to toggle the breakpoint on the current line
" 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
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