home.social

#vimtricks — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #vimtricks, aggregated by home.social.

fetched live
  1. Stop editing at 10% of Vim's power. Master registers, :norm, fuzzy completion, linematch diff, and 16 more Vim tips and tricks. Tested on latest Vim 9.2.

    Full guide here: ostechnix.com/vim-tricks/

    #Vim #Vimtips #Vimtricks #Editor #Opensource #Linux

  2. Stop editing at 10% of Vim's power. Master registers, :norm, fuzzy completion, linematch diff, and 16 more Vim tips and tricks. Tested on latest Vim 9.2.

    Full guide here: ostechnix.com/vim-tricks/

    #Vim #Vimtips #Vimtricks #Editor #Opensource #Linux

  3. One of my favorite vim tricks for substitution for deleting the text within two brackets of any type and start typing:

    Lets say you have this line:
    `console.log("my text", [1, 2, 3])`
    When your cursor is within that line,
    ci" -> replace the text within double quotes
    ci( -> replace the whole text between parenthesis
    ci[ -> replace content of the array

    #vimtober #vim #vimtricks

  4. One of my favorite vim tricks for substitution for deleting the text within two brackets of any type and start typing:

    Lets say you have this line:
    `console.log("my text", [1, 2, 3])`
    When your cursor is within that line,
    ci" -> replace the text within double quotes
    ci( -> replace the whole text between parenthesis
    ci[ -> replace content of the array

  5. Copy to system clipboard from #vim guide:

    1. In your ~/.vimrc set
    set clipboard=unnamed

    2. Open a file and yank whatever you want, in this example we yank lines 4 and 5 to system clipboard; in command mode, type 4,5y *
    set ts=2
    set sts=2
    set sw=2
    filetype off
    filetype plugin indent on
    syntax on
    set expandtab

    3. Profit
    Paste anywhere you want
    filetype off
    filetype plugin indent on

    #vimTricks #vimTips

  6. I am training up my left hand escape key pinky finger. #vimtricks

  7. And when you need the full completion madness in the command line, for example when you're editing complex Regular Expression statements, simply type `q:` from normal mode and you get the full Vim editing power in an editable command history window.
    Simply type your command line statement (or select an older one) and press <CR> to execute the command line under the cursor. See :help q:

    #Vim #Vi #Editor #Programming #VimTips #VimTricks

  8. #Vim hint of the week (because I'm searching this regulary again):
    You can insert the word under the cursor while in command mode with:
    <CTRL-R><CTRL-W>
    This comes in handy when you want to [s]ubstitute a word, without having it to retype again.

    :%s/<CTRL-R><CTRL-W>/newWord/g

    #Vim #Vi #Editor #Programming #VimTips #VimTricks

  9. #Vim hint of the week (because I'm searching this regulary again):
    You can insert the word under the cursor while in command mode with:
    <CTRL-R><CTRL-W>
    This comes in handy when you want to [s]ubstitute a word, without having it to retype again.

    :%s/<CTRL-R><CTRL-W>/newWord/g

    #Vim #Vi #Editor #Programming #VimTips #VimTricks

  10. @amolith i'll try to contribute to the #vimtrick hashtag as soon as i learn new things.
    of course, it would be great if everybody tagged their most useful #vimtricks here!