Skip to content

Instantly share code, notes, and snippets.

@ericvanjohnson
Last active May 7, 2024 16:39
Show Gist options
  • Star 28 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save ericvanjohnson/079ae871e156054d3779e8f1efd8375d to your computer and use it in GitHub Desktop.
Save ericvanjohnson/079ae871e156054d3779e8f1efd8375d to your computer and use it in GitHub Desktop.
" To get a list of Actions run `:actionlist `
" let mapleader = ','
" let mapleader = " "
let mapleader = "\<SPACE>"
set ignorecase smartcase
set NERDTree
set hlsearch
set showmode
set scrolloff=5
set history=1000
set surround
set incsearch
set relativenumber
set number
set smartcase
set hlsearch
set visualbell
set noerrorbells
set easymotion
set commentary
set ideajoin
set exchange
set multiple-cursors
set sneak
" clear the search buffer when hitting return
nnoremap <Leader>/ :nohlsearch<cr>
" To copy text to the end-of-line, press Y.
" This mapping sets up Y to be consistent with
" the C and D operators, which act from the cursor
" to the end of the line. The default behavior of Y
" is to yank the whole line.
nnoremap Y y$
" Shortcut for escape
imap jj <Esc>
imap jk <Esc>
" When in normal mode and I hit Enter,
" then save file please
nmap <CR> :action ReformatCode<CR> :write<CR>
nnoremap <Leader>F :action ReformatCode<CR> :write<CR>
" Quick window navigation
map <C-J> <C-W>j
map <C-K> <C-W>k
map <C-L> <C-W>l
map <C-H> <C-W>h
" Shortcut for copying to/from System Clipboard
vmap <Leader>y "+y
vmap <Leader>d "+d
nmap <Leader>P "+P
" Greatest remap EVER!!
" Let me explain, this remap while in visiual mode
" will delete what is currently highlighted and replace it
" with what is in the register BUT it will YANK (delete) it
" to a VOID register. Meaning I still have what I originally had
" when I pasted. I don't loose the previous thing I YANKED!
vnoremap <leader>p "_dP
" Splitting Windows
nmap <Leader>\ :vsplit<CR>
nmap <Leader>v :vsplit<CR>
nmap <Leader>- :split<CR>
nmap <Leader>h :split<CR>
" nmap <leader>fs :action FileStructurePopup<CR>
" Some search and replace shortcuts
" nnoremap <Leader><Leader>r :%s///g<Left><Left>
" nnoremap <Leader><Leader>rc :%s///g<Left><Left><Left>
nnoremap <Leader><Leader>r :%s//g<Left><Left>
"" Visual Mode
" xnoremap <Leader><Leader>r :s///g<Left><Left>
" xnoremap <Leader><Leader>rc :s///g<Left><Left><Left>
xnoremap <Leader><Leader>r :s//g<Left><Left>
" Project Shortcuts
" =================
" Close Project
" Some Action commands to memic my native vim
" For a list of :action try :actionlist
" ===========================================
" Hide open panels
nmap <Leader>w :action HideAllWindows<CR>
" Open Global Find Dialog box
nmap <Leader>fp :action FindInPath<CR>
" Open Terminal
nmap <Leader>t :action ActivateTerminalToolWindow<CR>
" Open recent project dialog box
nmap <Leader><Leader>m :action ManageRecentProjects<CR>
" Mapping to mimic BufferExplorer
" nmap <Leader>be :action Switcher<CR>
nmap <Leader>fb :action RecentFiles<CR>
nmap <Leader>ff :action GotoFile<CR>
nmap <Leader>fg :action SearchEverywhere<CR>
nmap <Leader><Leader>b :action RecentFiles<CR>
" Toggle code minimap
nmap <Leader>m :action CodeGlance.toggle<CR>
" Nerdtree want to be
" nmap <Leader>nt :action ActivateProjectToolWindow<CR>
nmap <Leader>nt :NERDTreeToggle<CR>
" Toggle ToggleDistractionFreeMode
nmap <Leader>df :action ToggleDistractionFreeMode<CR>
" Quick Quite
nnoremap <leader>q :q <CR>
"Coding Formating
" ===============
nnoremap <leader>cf :action ReformatCode<CR>
nnoremap <leader>pcf :action Tool_External Tools_PHP CS Fixer<CR>
" XDebug Shortcuts
nmap <Leader>xl :action PhpListenDebugAction<CR>
nmap <Leader>bp :action ToggleLineBreakpoint<CR>
" Jump to Source
nmap <C>] :action XDebugger.JumpToSource
" Some Git Shortcuts for view status, pull, and branches
" Mapping mimic Fugitive in my native vim
nmap <Leader>gs :action CheckinProject<CR>
nmap <Leader>gc :action CheckinProject<CR>
nmap <Leader>ga :action Git.Add<CR>
nmap <Leader>gp :action Git.Pull<CR>
nmap <Leader>gn :action Annotate<CR>
nmap <Leader>gl :action Git.Log<CR>
nmap <Leader>go :action Github.Open.In.Browser<CR>
nmap <Leader>br :action Git.Branches<CR>
nmap <Leader>gb :action Git.Branches<CR>
" View my customize Quicklist
nmap <Leader><leader>l :action QuickList.MyList<CR>
" AceJump Plugin - Jump to Character
nmap <Leader><Leader>w :action AceAction<CR>
" Commenting
nmap <Leader>cc :action CommentByLineComment<CR>
nmap <Leader>cb :action CommentByBlockComment<CR>
nmap <Leader>c<Space> :action CommentByLineComment<CR>
nmap <Leader>cb<Space> :action CommentByBlockComment<CR>
" Refactoring
nmap <Leader>rt :action Refactorings.QuickListPopupAction<CR>
"nmap csw' :action Macro.surround_with_single_quote<CR>
" Move visual block
vnoremap J :m '>+1<CR>
" xnoremap K :m '<-2<CR>
vnoremap K :m '<-2<CR>
" Put search results in the middle of the screen
nnoremap n nzz
nnoremap N Nzz
" Laravel Mappings
" ================
" Open and edit routes file
nmap <Leader>lc :e composer.json<cr>
nmap <Leader>le :e .env<cr>
" Shortcut for copying to/from System Clipboard
"" Copy (Yank)
vmap <Leader>y "+y
"" Cute
vmap <Leader>d "+d
"" Paste
nmap <Leader>P "+p
@iceadobe
Copy link

iceadobe commented Dec 9, 2023

Thanks for this!

@ericvanjohnson
Copy link
Author

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment