Skip to content

Instantly share code, notes, and snippets.

@panboo0106
Created February 11, 2025 16:13
Show Gist options
  • Save panboo0106/f30b12396760de1cf49e47f50fe5e599 to your computer and use it in GitHub Desktop.
Save panboo0106/f30b12396760de1cf49e47f50fe5e599 to your computer and use it in GitHub Desktop.
set which-key
set timeoutlen=5000
let g:WhichKey_ShowVimActions = "true"
set relativenumber
set number
set clipboard+=unnamed "for osx
set nocompatible
set fileencoding=utf-8
set cursorline
"set cursorcolumn
" base configuration
set showmode
set incsearch
set nu
set relativenumber
set ignorecase
set smartcase
set clipboard+=unnamed
" keymaps
" the leader key
map <space> <nop>
let mapleader="\<space>"
nnoremap <C-c> <Esc>
" file
nmap <leader>of <Action>(OpenFile)
nmap <leader>yp <Action>(CopyAbsolutePath)
nmap <leader>rf <Action>(RecentFiles)
nmap <leader>rl <Action>(RecentLocations)
nmap <leader>rp <Action>(ManageRecentProjects)
nmap <leader>sh <Action>(LocalHistory.ShowHistory)
nmap <leader>sf <Action>(ShowFilePath)
nmap <leader>si <Action>(SelectIn)
nmap <leader>fp <Action>(FindInPath)
nmap <leader>rp <Action>(ReplaceInPath)
nmap <leader>sw <Action>($SearchWeb)
" redo
nnoremap U <C-r>
" comfort shortcuts
nnoremap <C-d> yyp
" terminal
nmap <leader>tt <Action>(ActivateTerminalToolWindow)
nmap <leader>tc <Action>(Terminal.OpenInTerminal)
" zen-mode
nmap <leader>z <Action>(ToggleZenMode)
" find
nnoremap <C-f> :action GotoFile<CR>
nnoremap <C-r> :action RecentFiles<CR>
" bookmark
nmap mm <Action>(ToggleBookmark)
nmap ms <Action>(ShowBookmarks)
" navigation
nnoremap J }
nnoremap K {
nnoremap sv :action SplitVertically<CR>
nnoremap ss :action SplitHorizontally<CR>
nnoremap sm :action MoveEditorToOppositeTabGroup<CR>
nnoremap sh <c-w>h
nnoremap sj <c-w>j
nnoremap sk <c-w>k
nnoremap <S-h> :action PreviousTab<CR>
nnoremap <S-l> :action NextTab<CR>
nnoremap ;a :action CloseAllEditors<CR>
nnoremap ;q :action CloseContent<CR>
" code interactions
nnoremap <leader>c :action CommentByLineComment<CR>
nnoremap <leader>C :action CommentByBlockComment<CR>
nnoremap <leader>r :action RenameElement<CR>
nnoremap <leader>f :action ReformatCode<CR>
nnoremap <leader>re :action Refactorings.QuickListPopupAction<CR>
nnoremap <leader>su :action ShowUsages<CR>
nnoremap <leader>sU :action FindUsages<CR>
nnoremap <leader>m :action CollapseRegion<CR>
nnoremap <leader>M :action ExpandRegion<CR>
nnoremap sl <c-w>l
nnoremap <leader>am :action CollapseAllRegions<CR>
nnoremap <leader>aM :action ExpandAllRegions<CR>
" code information
nnoremap <leader>d :action ShowHoverInfo<CR>
nnoremap <leader>e :action ShowErrorDescription<CR>
" code navigation
nnoremap gi :action GotoImplementation<CR>
nnoremap gt :action GotoTypeDeclaration<CR>
nnoremap ge :action GotoNextError<CR>
nnoremap gE :action GotoPreviousError<CR>
" code selection
nnoremap <S-j> :action MoveLineDown<CR>
nnoremap <S-k> :action MoveLineUp<CR>
" debugging
nnoremap <leader>dc :action Debug<CR>
nnoremap <leader>ds :action Stop<CR>
nnoremap <leader>db :action ToggleLineBreakpoint<CR>
" run
nnoremap <leader>rc :action ContextRun<CR>
nnoremap <leader>rx :action ChooseRunConfiguration<CR>
nnoremap <leader>rr :action Rerun<CR>
nnoremap <leader>rt :action RunTests<CR>
nnoremap <leader>rs :action Stop<CR>
" surround (bundle plugin)
" usage: https://github.com/tpope/vim-surround
set surround
" exchange (bundle plugin)
" usage: https://github.com/tommcdo/vim-exchange
set exchange
" nerdtree (bundle plugin)
set NERDTree
" replace with register (bundle plugin)
" usage: https://github.com/vim-scripts/ReplaceWithRegister
set ReplaceWithRegister
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment