Skip to content

Instantly share code, notes, and snippets.

@legendmohe
Last active October 12, 2021 04:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save legendmohe/f72336d9c9dab1ce6befe8b63e8126dc to your computer and use it in GitHub Desktop.
Save legendmohe/f72336d9c9dab1ce6befe8b63e8126dc to your computer and use it in GitHub Desktop.
" let mapleader=","
let mapleader=" "
nnoremap <Space> <Nop>
" easymotion "
set easymotion
nmap f <Plug>(easymotion-f)
nmap F <Plug>(easymotion-F)
" surround "
set surround
" NERDTree "
set NERDTree
" multiple-cursors "
set multiple-cursors
" vim-paragraph-motion "
set vim-paragraph-motion
" After block yank and paste, move cursor to the end of operated text and don't override register
vnoremap y y`]
vnoremap p "_dP`]
nnoremap p p`]
" Yank and paste from clipboard
nnoremap ,y "+y
vnoremap ,y "+y
nnoremap ,yy "+yy
nnoremap ,p "+p
" Center screen when moving up and down
nnoremap <C-u> <C-u>zz
nnoremap <C-o> <C-d>zz
vnoremap <C-u> <C-u>zz
vnoremap <C-o> <C-d>zz
nnoremap <Leader>p :action SearchEverywhere<CR>
if has("win64") || has("win32") || has("win16")
echo "using windows"
nmap <A-n> <Plug>NextWholeOccurrence
xmap <A-n> <Plug>NextWholeOccurrence
nmap g<A-n> <Plug>NextOccurrence
xmap g<A-n> <Plug>NextOccurrence
nmap <A-x> <Plug>SkipOccurrence
xmap <A-x> <Plug>SkipOccurrence
nmap <A-p> <Plug>RemoveOccurrence
xmap <A-p> <Plug>RemoveOccurrence
nmap <S-A-n> <Plug>AllWholeOccurrences
xmap <S-A-n> <Plug>AllWholeOccurrences
nmap g<S-A-n> <Plug>AllOccurrences
xmap g<S-A-n> <Plug>AllOccurrences
else
echo "using mac"
nmap <C-n> <Plug>NextWholeOccurrence
xmap <C-n> <Plug>NextWholeOccurrence
nmap g<C-n> <Plug>NextOccurrence
xmap g<C-n> <Plug>NextOccurrence
nmap <C-x> <Plug>SkipOccurrence
xmap <C-x> <Plug>SkipOccurrence
nmap <C-p> <Plug>RemoveOccurrence
xmap <C-p> <Plug>RemoveOccurrence
nmap <S-C-n> <Plug>AllWholeOccurrences
xmap <S-C-n> <Plug>AllWholeOccurrences
nmap g<S-C-n> <Plug>AllOccurrences
xmap g<S-C-n> <Plug>AllOccurrences
endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment