#vimtricks — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #vimtricks, aggregated by home.social.
-
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: https://ostechnix.com/vim-tricks/
-
Copy to system clipboard from #vim guide:
1. In your ~/.vimrc set
set clipboard=unnamed2. 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 expandtab3. Profit
Paste anywhere you want
filetype off
filetype plugin indent on -
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 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