Skip to content

Instantly share code, notes, and snippets.

@exaV
Last active August 15, 2022 14:25
Show Gist options
  • Save exaV/97972de1472a88611168666a8d9252c5 to your computer and use it in GitHub Desktop.
Save exaV/97972de1472a88611168666a8d9252c5 to your computer and use it in GitHub Desktop.
vim and ideavim (https://github.com/JetBrains/ideavim) configuration
source ~/.vimrc
set ideamarks
set ideaput
set showmode
" ideavim plugins
" https://github.com/JetBrains/ideavim/wiki/Emulated-plugins
set NERDTree
set commentary
set argtextobj
set vim-paragraph-motion
set highlightedyank
set surround
:map gi <Action>(GotoImplementation)
:map gt <Action>(GotoTypeDeclaration)
:map q <Action>(QuickJavaDoc)
:map Q <Action>(ShowErrorDescription)
:map rr <Action>(RenameElement)
:map gs <Action>(SplitVertically)
:map gS <Action>(Unsplit)
:map ss <Action>(PrevSplitter)
:xunmap q
:xmap q <Action>(EditorSelectWord)
:map <leader><C-u> <Action>(Vcs.UpdateProject)
:map <leader><C-k> <Action>(CheckinProject)
:map <leader><C-p> <Action>(Vcs.Push)
:map <leader>u <Action>(Vcs.RollbackChangedLines)
:map <leader>U <Action>(ChangesView.Revert)
:map <leader>i <Action>(ImplementMethods)
:map <leader>I <Action>(OverrideMethods)
:map <leader>p <Action>(ParameterInfo)
:map <leader>e <Action>(RecentFiles)
:map <leader>E <Action>(RecentLocations)
:map <leader>a <Action>(Annotate)
:map <leader>h <Action>(Vcs.ShowTabbedFileHistory)
:map <S-Space> <Action>(GotoNextError)
:map <Leader>w <Action>(EditorSelectWord)
:map <Leader>j <Action>(Forward)
:map <Leader>k <Action>(Back)
syntax on
" Disable the default Vim startup message.
set shortmess+=I
" Show line numbers.
set number
" This enables relative line numbering mode. With both number and
" relativenumber enabled, the current line shows the true line number, while
" all other lines (above and below) are numbered relative to the current line.
" This is useful because you can tell, at a glance, what count is needed to
" jump up or down to a particular line, by {count}k to go up or {count}j to go
" down.
set relativenumber
" Always show the status line at the bottom, even if you only have one window open.
set laststatus=2
" The backspace key has slightly unintuitive behavior by default. For example,
" by default, you can't backspace before the insertion point set with 'i'.
" This configuration makes backspace behave more reasonably, in that you can
" backspace over anything.
set backspace=indent,eol,start
" This setting makes search case-insensitive when all characters in the string
" being searched are lowercase. However, the search becomes case-sensitive if
" it contains any capital letters. This makes searching more convenient.
set ignorecase
set smartcase
" Enable searching as you type, rather than waiting till you press enter.
set incsearch
" set hlsearch
" Unbind some useless/annoying default key bindings.
nmap Q <Nop> " 'Q' in normal mode enters Ex mode. You almost never want this.
" Disable audible bell because it's annoying.
set noerrorbells visualbell t_vb=
" Enable mouse support. You should avoid relying on this too much, but it can
" sometimes be convenient.
set mouse+=a
set scrolloff=20
set clipboard+=unnamed
" stop space from advancing the cursor in normal mode and user it as <leader> instead
nnoremap <SPACE> <Nop>
let mapleader=" "
" use <space>d to start as delete word without copying. Example: <space>dd -> delete the line without copying
nnoremap <leader>d "_d
xnoremap <leader>d "_d
xnoremap <leader>p "_dP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment