Skip to content

Instantly share code, notes, and snippets.

@LGUG2Z
Created November 30, 2023 18:04
Show Gist options
  • Save LGUG2Z/53cc7fbac96417ebf341b97c999ba436 to your computer and use it in GitHub Desktop.
Save LGUG2Z/53cc7fbac96417ebf341b97c999ba436 to your computer and use it in GitHub Desktop.
My ideavimrc
" Map the leader key to space
let mapleader = " "
set clipboard=unnamed " Use system clipboard
set display+=lastline " Always try to show a paragraphΓÇÖs last line
set formatoptions+=j " Delete comment character when joining commented lines
set gdefault " Replace all instances on a line when using :s/regex/replacement
set history=1000 " Remember more commands and search history
set ignorecase " Case-insensitive search
set incsearch "Show matches as search proceeds
set nohlsearch " Won't highlight all search matches
set nostartofline " Cursor doesn't change column on up/down moves
set number " Always show current line number as not relative
set relativenumber " Use relative line numbering
set showcmd " Show info about the current command in bottom-right
set showmatch " Show matching brackets
set showmode " Show current editing mode
set smartcase " Search becomes case-sensitive when capitals are used
set undolevels=1000 " Use many muchos levels of undo
set surround " Use vim-surround shortcuts
set commentary " Use vim-surround shortcuts
" ESC shortcut visual mode
vnoremap <Tab> <Esc>gV
" Respect line wraps when moving by default
nnoremap j gj
nnoremap k gk
nnoremap gk k
nnoremap gj j
" Automatically jump to the end of pasted text
vnoremap <Silent> y y`]
vnoremap <Silent> p p`]
nnoremap <Silent> p p`]
" o to open a blank line below
map o o<ESC>
" O to open a blank line above
map O O<ESC>
" IntelliJ Action Mappings with Leader
nnoremap ,zh :action HideAllWindows<CR>
nnoremap ,H :action HideAllWindows<CR>
nnoremap ,c :action GotoClass<CR>
nnoremap ,h :action HideActiveWindow<CR>
nnoremap ,p :action IntroduceParameter<CR>i
nnoremap ,m :action FileStructurePopup<CR>
nnoremap ,u :action FindUsages<CR>
nnoremap ,x :action GotoNextError<CR>
nnoremap ,a :action GotoAction<CR>
nnoremap ,. :action GotoFile<CR>
nnoremap ,= :action ReformatCode<CR>
nnoremap ,, :action RenameElement<CR>i
nnoremap ,b :action QuickImplementations<CR>
nnoremap ,zb :action GotoDeclaration<CR>
nnoremap ,B :action GotoDeclaration<CR>
nnoremap ,f :action FindInPath<CR>
nnoremap ,r :action ReplaceInPath<CR>
nnoremap ,v :action IntroduceVariable<CR>i
nnoremap ,x :action GotoNextError<CR>
nnoremap ,zx :action GotoPreviousError<CR>
nnoremap ,X :action GotoPreviousError<CR>
nnoremap ,n :action NewElement<CR>
nnoremap ,t :action ActivateTerminalToolWindow<CR>
set ideajoinset clipboard+=ideaput
set easymotion
" Replace currently selected text with default register without yanking it
vnoremap p "_dP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment