Skip to content

Instantly share code, notes, and snippets.

@rajabilal555
Created September 10, 2023 12:12
Show Gist options
  • Save rajabilal555/daec6f3939f5e994ca8f9c3089210ac4 to your computer and use it in GitHub Desktop.
Save rajabilal555/daec6f3939f5e994ca8f9c3089210ac4 to your computer and use it in GitHub Desktop.
My vimrc/ideavimrc
" .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
""" Map leader to space ---------------------
let mapleader=" "
" 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 showmode
set so=5
set incsearch
set nu
set surround
set multiple-cursors
" set commentary
set argtextobj
set easymotion
set ideaJoin
set relativenumber
set ideastatusicon=gray
" --- Enable IdeaVim plugins https://jb.gg/ideavim-plugins
" Highlight copied text
Plug 'machakann/vim-highlightedyank'
" Commentary plugin
Plug 'tpope/vim-commentary'
nnoremap L $
nnoremap H ^
vnoremap L $
vnoremap H ^
nnoremap <leader>ff :action GotoFile <CR>
nnoremap <leader>fp :action ManageRecentProject <CR>
" Going back to normal mode
inoremap jk <Esc>
inoremap kj <Esc>
vnoremap jk <Esc>
vnoremap kj <Esc>
vmap <leader>y "+y
nmap <leader>y "+yy
" Visual Mode
vmap <S-J> <Action>(MoveLineDown)
vmap <S-K> <Action>(MoveLineUp)
" Window Splitting
nnoremap <leader>sv :action SplitVertically <CR>
nnoremap <leader>sh :action SplitHorizontally <CR>
nnoremap <leader>v :action NextSplitter <CR>
nnoremap <leader>sc :action UnsplitAll <CR>
nmap <leader>h :action PreviousTab<CR>
nmap <leader>l :action NextTab<CR>
nmap <leader>c :action CloseEditor<CR>
" Select all
nnoremap <C-A> gg<S-v>G
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment