utubo / vim-skipslash

🔍You can <TAB> to move to the next block when the command line is :s/{pattern}/{string}/ or :g/{pattern}/, and automatically skips '/'.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

âš This is the beta version.
âš (2023/12/14) Rename plugin name from vim-tabtoslash to vim-skipslash

vim-skipslash

You can <TAB> to move to the next block when the command line is :s/{pattern}/{string}/ or :g/{pattern}/, and automatically skips '/'.

Install

call dein#add('utubo/vim-skipslash')

(Optional)

nnoremap gs :<C-u>s///cg<Left><Left><Left><Left>
nnoremap gS :<C-u>%s/<C-r>=escape(expand('<cword>'), '^$.*?/\[]')<CR>//cg<Left><Left><Left>
vnoremap gs :s///cg<Left><Left><Left><Left>
let g:skipslash_autocomplete = 1

Usage

| is the cursor.

Move to the next block. (Key: <TAB>)

:s/p|at/str/ -> :s/pat/|str/

Move to the previouse block. (Key: <S-TAB>)

:s/pat/s|tr/ -> :s/pat|/str/

(Option)

let g:skipslash_back_to_head = 1

:s/pat/s|tr/ -> :s/|pat/str/

Skip /. (Key: /)

:s/pat|/str/ -> :s/pat/|str/

( When "/" is escaped with "\" ...)

:s/pat\|/str/ -> :s/pat\/|/str/

Auto complete the slashes

let g:skipslash_autocomplete = 1
  • :s/ -> :s///g
  • :g/ -> :g//
  • :v/ -> :v//
  • :g!/ -> :g!//

Supported delimiters

  • /, #, -, :, -, @, ^, _, ~

This plugin works on e.g.

:s#foo#bar#

Build

autoload/skipslash.vim is minified from autoload/skipslash.src.vim with vim-minviml.

About

🔍You can <TAB> to move to the next block when the command line is :s/{pattern}/{string}/ or :g/{pattern}/, and automatically skips '/'.

License:MIT License


Languages

Language:Vim Script 100.0%