Vim

practical vim 1.1

  • buffers
    bn next buffer
    bp previous buffer
    b# jump to buffer #
    bd[#] delete buffer current / by id
    buffers list them

  • registers
    "[a-z] named register for yanking, deleting and pasting
    "_ : null register

     my setup, use null register by default:
        let mapleader = ","
        let g:mapleader = ","
        nnoremap x "_x
        nnoremap d "_d
        nnoremap D "_D
        vnoremap d "_d
        vnoremap <leader>d ""d
        nnoremap <leader>d ""d
        nnoremap <leader>D ""D

  • marks
    mark id [[a-zA-Z]
    m# sets a mark at the current position
    ’# jump to the line of the mark
    `# jump to the position of the mark
    y/d’# yank/delete current line to mark line
    y/d`# yank/delete current position to mark position
    marks list them

  • folding
    zc zC open 1 fold / all levels
    zo zO close 1 fold / all levels
    za zA toggle 1 fold / all levels
    zr zR reduce folding by 1 / all levels
    zm zM more folding by closing 1 / all levels

  • macros recording
    q[a-z] start recording
    q stop recording
    n@[a-z] replay recording n times

  • keymaps
    ,, pop tag
    A-CR paste mouse hovered
    <leader>y yank selected into clipboard
    <leader>Y yank line into clipboard
    <leader>x chmod +x current buffer file
    <leader>/ global replace

  • windows
    ,t window down
    ,s window up
    ,c window left
    ,r window right
    , split vertical
    , split horizontal

    C-Up window resize
    C-Down window resize
    C-Left window resize
    C-Right window resize

My Specific Setup

  • bebo changes
    j move before next
    J move before prev
    f move to next
    F move to prev
    Change
    l + motion delete & enter INSERT mode
    L delete till EOL & enter INSERT mode
    Replace
    hreplace 1 char
    Hreplace 1 char & enter REPLACE mode
    Substitute
    kdelete 1 char & enter INSERT mode
    Kdelete line & enter INSERT mode

  • netrw
    A-f open current buffer directory

  • telescope
    Alt-t next item
    Alt-s prev item
    <leader>tf find files
    <leader>tb find buffers
    <leader>tg find git files
    <leader>th help tags
    <leader>ts grep find

  • harpoon
    <leader>p append
    <leaderc>c toggle menu
    Alt = jump to 1
    Alt + jump to 2
    Alt - jump to 3
    Alt / jump to 4

  • cmp
    Alt-t next item
    Alt-s prev item
    Tab next item && complete …

  • lsp
    <leader>s next diagnostic
    <leader>t previous diagnostic
    <leader>= format buffer
    <leader>l, jump to definition
    <leader>le info hover
    <leader>li references
    <leader>lu code action
    <leader>la workspace symbols
    <leader>lk rename

I’m using a typematrix 2030 keyboard with bépo layout and this xkb mappings.

vim_bepo layout