✨ Vim-surroundd is awesome
This commit is contained in:
parent
ab341480a0
commit
fc60e0661b
2 changed files with 27 additions and 0 deletions
|
|
@ -40,6 +40,7 @@ return require("packer").startup(function(use)
|
||||||
requires = { { "nvim-lua/plenary.nvim" } },
|
requires = { { "nvim-lua/plenary.nvim" } },
|
||||||
})
|
})
|
||||||
use({ "tpope/vim-fugitive" })
|
use({ "tpope/vim-fugitive" })
|
||||||
|
use({ "tpope/vim-surround" })
|
||||||
use({
|
use({
|
||||||
"iamcco/markdown-preview.nvim",
|
"iamcco/markdown-preview.nvim",
|
||||||
run = function()
|
run = function()
|
||||||
|
|
|
||||||
|
|
@ -291,6 +291,32 @@ Custom shortcut: nv (opens up new vertical pane)
|
||||||
# deprecated when OKLB acquired...
|
# deprecated when OKLB acquired...
|
||||||
ii - equivaent to <ESC> key (return to normal mode from insert mode)
|
ii - equivaent to <ESC> key (return to normal mode from insert mode)
|
||||||
|
|
||||||
|
-- Vim-Surround
|
||||||
|
Tpope has some amazing plugins, one of which is vim-surround(https://github.com/tpope/vim-surround).
|
||||||
|
This allows you to quickly surround a block of text with delimiting characters like ''""{}(), etc.
|
||||||
|
You can even use it to quickly edit XML/HTML markup. The following are some basic commands you can utilize within normal mode:
|
||||||
|
Let's simply encapsulate Hello with some quotes:
|
||||||
|
```
|
||||||
|
Hello
|
||||||
|
```
|
||||||
|
Now Enter: ysiw' while the cursor is over Hello (only works on single word):
|
||||||
|
```
|
||||||
|
'Hello'
|
||||||
|
```
|
||||||
|
We Can quickly change existing delimiters using the cs'] command like so:
|
||||||
|
```
|
||||||
|
[Hello]
|
||||||
|
```
|
||||||
|
If you have more than one word encapsulated with delimiters and wish to change them, you can do so with the cs command again like so:
|
||||||
|
```
|
||||||
|
"Hello World!"
|
||||||
|
```
|
||||||
|
Now with the cs"' command, we'll change it to single quote:
|
||||||
|
```
|
||||||
|
'Hello World!'
|
||||||
|
```
|
||||||
|
NOTE: This is powerful when chained with mult-cursor!
|
||||||
|
|
||||||
-- THE PRIMEAGEN AND HARPOON PLUGIN
|
-- THE PRIMEAGEN AND HARPOON PLUGIN
|
||||||
note: my configuration is based off of the primeagens, with a lot more added
|
note: my configuration is based off of the primeagens, with a lot more added
|
||||||
on, and a tiny bit taken out. The following is how I've set up his harpoon
|
on, and a tiny bit taken out. The following is how I've set up his harpoon
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue