Skip to content

Instantly share code, notes, and snippets.

@jphalip
Created October 21, 2024 17:47
Show Gist options
  • Select an option

  • Save jphalip/f75ef966f38607a33709750d4eb3d087 to your computer and use it in GitHub Desktop.

Select an option

Save jphalip/f75ef966f38607a33709750d4eb3d087 to your computer and use it in GitHub Desktop.

Revisions

  1. jphalip created this gist Oct 21, 2024.
    32 changes: 32 additions & 0 deletions .vimrc
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,32 @@
    " Set the leader key to comma for custom mappings
    let mapleader = ","

    " Set timeout for key sequences (in milliseconds)
    set timeout timeoutlen=500

    " Use system clipboard for all yank, delete, and put operations
    set clipboard=unnamedplus

    " Insert new lines without leaving normal mode
    " oo: Insert line below
    " OO: Insert line above
    nnoremap oo m`o<Esc>``
    nnoremap OO m`O<Esc>``
    " Prevent delete operations from saving text to register/clipboard
    " This allows for 'delete without cut' functionality
    nnoremap x "_x
    nnoremap X "_X
    nnoremap d "_d
    nnoremap D "_D
    vnoremap d "_d
    " Use leader key for cut operations (moving text to system clipboard)
    " <leader>d: Cut current line or selection
    " <leader>D: Cut from cursor to end of line
    nnoremap <leader>d "+d
    nnoremap <leader>D "+D
    vnoremap <leader>d "+d
    "Select All
    nnoremap <leader>a ggVG