axring.vim
axring.vim copied to clipboard
:ring: Enhance `<c-a>`, `<c-x>` ability to switch keywords.
axring.vim
:ring: Enhance <c-a>
, <c-x>
ability to switch keywords.
Feature
-
<c-a>
to select next word on the ring. -
<c-x>
to select previous word on the ring. - Echo the ring when select a word.
- Support repeat.vim
Screenshot
Install
I suggest you to use a plugin manager, such vim-plug or others.
Plug 'tenfyzhong/axring.vim'
- Manual
git clone https://github.com/tenfyzhong/axring.vim.git ~/.vim/bundle/axring.vim
echo 'set rtp+=~/.vim/bundle/axring.vim' >> ~/.vimrc
vim -c 'helptag ~/.vim/bundle/axring.vim/doc' -c qa!
Example Configruation
let g:axring_rings = [
\ ['&&', '||'],
\ ['&', '|', '^'],
\ ['&=', '|=', '^='],
\ ['>>', '<<'],
\ ['>>=', '<<='],
\ ['==', '!='],
\ ['>', '<', '>=', '<='],
\ ['++', '--'],
\ ['true', 'false'],
\ ['verbose', 'debug', 'info', 'warn', 'error', 'fatal'],
\ ]
let g:axring_rings_go = [
\ [':=', '='],
\ ['byte', 'rune'],
\ ['complex64', 'complex128'],
\ ['int', 'int8', 'int16', 'int32', 'int64'],
\ ['uint', 'uint8', 'uint16', 'uint32', 'uint64'],
\ ['float32', 'float64'],
\ ['interface', 'struct'],
\ ]
Usage
- Configure option g:axring_ring
- Edit a file.
- Place you cursor on a word which is in the g:axring_ring
- type
<c-a>
or<c-x>