An open API service indexing awesome lists of open source software.

https://github.com/aben20807/vim-surrounder

A simple Vim plugin which to add surround symbols.
https://github.com/aben20807/vim-surrounder

surround vim vim-plugin

Last synced: 7 months ago
JSON representation

A simple Vim plugin which to add surround symbols.

Awesome Lists containing this project

README

          

# Surrounder

## 1. Installation
### 1.a. Installation with [Vim-Plug](https://github.com/junegunn/vim-plug)
1. Add `Plug 'aben20807/vim-surrounder'` to your vimrc file.
2. Reload your vimrc or restart.
3. Run `:PlugInstall`

### 1.b. Installation with [Vundle](https://github.com/VundleVim/Vundle.vim)
1. Add `Plugin 'aben20807/vim-surrounder'` to your vimrc file.
2. Reload your vimrc or restart
3. Run `:PluginInstall`

## 2. Usage
### 2.a. Supported symbols
+ '', "", (), [], {}, <>

### 2.b. Demonstration
+ Note: ` ` marked text is cursor position.

|Before|key pressed|After|
|:-:|:-:|:-:|
|h`e`llo world | `s "` | "h`e`llo" world|
|h`e`llo world | `2s "` | "h`e`llo world"|

+ Use auto detect

|Before|key pressed|After|
|:-:|:-:|:-:|
|"h`e`llo world" | `d` | h`e`llo world|
|"h`e`llo world" | `f (` | (h`e`llo world)|

+ Not use auto detect

|Before|key pressed|After|
|:-:|:-:|:-:|
|"h`e`llo world" | `d "` | h`e`llo world|
|"h`e`llo world" | `f "(` | (h`e`llo world)|

### 2.c. Settings
```vim
" Feel free to change mapping you like.
" Use key mappings setting from this plugin by default.
let g:surrounder_use_default_mapping = 1

" Add surround in n mode
let g:surrounder_n_add_key = "s"

" Add surround in v mode
let g:surrounder_v_add_key = "s"

" Delete surround in n mode
let g:surrounder_n_del_key = "d"

" Replace surround in n mode
let g:surrounder_n_rep_key = "f"

" Show the surround information by default.
let g:surrounder_show_info = 1

" Auto detect if in surround symbols by default.
let g:surrounder_auto_detect = 1
```

![img](https://imgur.com/DR5QWxl.png)