Skip to content

Instantly share code, notes, and snippets.

@MarcoBardalesRodriguez
Created August 8, 2022 04:05
Show Gist options
  • Save MarcoBardalesRodriguez/8eafa33fb53f2ae14871e9a06c5968f9 to your computer and use it in GitHub Desktop.
Save MarcoBardalesRodriguez/8eafa33fb53f2ae14871e9a06c5968f9 to your computer and use it in GitHub Desktop.
"" Source your .vimrc
"source ~/.vimrc
let mapleader = " "
"" -- 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
" set relative numbers
set nu
set rnu
" Do incremental searching.
set incsearch
" Don't use Ex mode, use Q for formatting.
map Q gq
"Get out of insert mode
imap jk <Esc>
"Moves Blocks of code in visual mode or V-Line xnoremap K :move '<-2<CR>gv-gv xnoremap J :move '>+1<CR>gv-gv
xnoremap K :move '<-2<CR>gv-gv
xnoremap J :move '>+1<CR>gv-gv
" Better indenting
vnoremap < <gv
vnoremap > >gv
"save file
nmap <leader>w :w <CR>
"close current window
nmap <leader>q :q <CR>
" Reformat the current line only
map <leader>l V<Action>(ReformatCode)
"" -- 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 <Action>(Debug)
"" Map \b to toggle the breakpoint on the current line
"map \b <Action>(ToggleLineBreakpoint)
" Find more examples here: https://jb.gg/share-ideavimrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment