Giter Club home page Giter Club logo

vim-unimpaired's Introduction

unimpaired.vim

Much of unimpaired.vim was extracted from my vimrc when I noticed a pattern: complementary pairs of mappings. They mostly fall into four categories.

There are mappings which are simply short normal mode aliases for commonly used ex commands. ]q is :cnext. [q is :cprevious. ]a is :next. [b is :bprevious. See the documentation for the full set of 20 mappings and mnemonics. All of them take a count.

There are linewise mappings. [<Space> and ]<Space> add newlines before and after the cursor line. [e and ]e exchange the current line with the one above or below it.

There are mappings for toggling options. [os, ]os, and yos perform :set spell, :set nospell, and :set invspell, respectively. There's also l (list), n (number), w (wrap), x (cursorline cursorcolumn), and several others, plus mappings to help alleviate the set paste dance. Consult the documentation.

There are mappings for encoding and decoding. [x and ]x encode and decode XML (and HTML). [u and ]u encode and decode URLs. [y and ]y do C String style escaping.

And in the miscellaneous category, there's [f and ]f to go to the next/previous file in the directory, and [n and ]n to jump between SCM conflict markers.

The . command works with all operator mappings, and will work with the linewise mappings as well if you install repeat.vim.

Installation

Install using your favorite package manager, or use Vim's built-in package support:

mkdir -p ~/.vim/pack/tpope/start
cd ~/.vim/pack/tpope/start
git clone https://tpope.io/vim/unimpaired.git
vim -u NONE -c "helptags unimpaired/doc" -c q

FAQ

My non-US keyboard makes it hard to type [ and ]. Can I configure different prefix characters?

The easiest solution is to map to [ and ] directly:

nmap < [
nmap > ]
omap < [
omap > ]
xmap < [
xmap > ]

Note we're not using the noremap family because we do want to recursively invoke unimpaired.vim's maps.

Contributing

See the contribution guidelines for pathogen.vim.

Self-Promotion

Like unimpaired.vim? Follow the repository on GitHub and vote for it on vim.org. And if you're feeling especially charitable, follow tpope on Twitter and GitHub.

License

Copyright (c) Tim Pope. Distributed under the same terms as Vim itself. See :help license.

vim-unimpaired's People

Contributors

andrewradev avatar awood avatar bjnord avatar blueyed avatar bohrshaw avatar idbrii avatar jebaum avatar justinmk avatar kiryph avatar kuntau avatar mmontu avatar muchzill4 avatar ryym avatar solawing avatar teoljungberg avatar tinybeachthor avatar tommcdo avatar tpope avatar treyhunner avatar tylerbrazier avatar wbolster avatar wjlroe avatar y avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vim-unimpaired's Issues

add [m / ]m

could you add [m / ]m for method/ function jumping ?

i found [m / ]m provided by VIM don't work nicely for
many coding language like C/ C++ /java ..

Thanks

<count>]a creates a new file named for the count

3[a works fine - it takes me back 3 in the args list, but 3]a creates a new document called 3. This happens with all counts.

:verbose map ]a gives me:

n  ]a            <Plug>unimpairedANext
        Last set from ~/.vim/bundle/vim-unimpaired/plugin/unimpaired.vim

Two lines at the same time

How about a mapping for adding lines above ([, ]) and below at the same time? Maybe I'm a bad Vimmer, but I seem to need that often...

[<Space> and ]<Space> can't be redone

I may try to fix this on my own, but it will require some study on my part. In the meantime:

It's a bummer that I can't insert a blank space, then repeat it a few times with dot. Instead, dot still redoes the previous change, which is pretty jarring. I'm guessing this is some part of the implementation's details leaking through, but it would be nice if it just worked as (I) expected.

Enable using of `s:option_map` outside of the script

Hi, first of all, thank you for the fantastic plugin (this and all the others)!

Would it be a problem to enable using s:option_map (and s:toggle if necessary, I'm not sure on that) outside the unimpaired script? link here
I guess just renaming the functions would do it, but maybe there is more to it...

The reason is pretty simple - to enable users to define their own mappings for toggling options through an unimpaired interface.

My concrete example - I'd like to set a mapping for 'wrapscan' toggling, but I'm aware that might be useless for a majority of other users. By "opening" the above mentioned functions, I would be able to write this in my vimrc and it would be all perfectly set up:

if exists("*UnimpairedOption_map")
   call UnimpairedOption_map('W', 'wrapscan')
endif

For now, I've just copied functions to my vimrc, renamed them and consuming them that way.

Hopefully the idea makes sense.
Thanks!

Mappings for signs navigation

Hi,

Just wondering if you would consider adding some mapping to navigate signs.
They are more and more used by some modern plugins (syntastic, youcompleteme), and it would really useful to be able to "go to the next/previous highlighted thing".

Thanks.

Add `[ob`, `]ob`, and `cob` mapping for background switching

Please add [ob, ]ob, and cob mappings to toggle between dark and light backgrounds. These commands would switch betweenset background=dark and set background=light, and reload the color scheme afterwards, e.g. using something like this:

if exists("g:colors_name")
    exe "colorscheme " . g:colors_name
endif

(Example taken from the togglebg plugin in the vim-solarized color scheme.)

Feature request: Mapping to toggle colorcolumn

As long as you're adding toggles for various options, it would be nice to include mappings to switch between :set colorcolumn=0 (off) and :set colorcolumn=+1 (on). Something like:

On     Off    Toggle
*[oo*  *]oo*  *coo*

Cannot use some mappings if : is mapped to something else

I have the following mappings in my vimrc:

nnoremap ; :
nnoremap : ;
vnoremap ; :
vnoremap : ;

this causes some of the mappings in this plugin not to work correctly, namely my favorites [q and [b.
[ still works.

I had some other mappings which also stopped working after this remap.
They were
nmap ,f :call PreciseJumpF(-1, -1, 0)
vmap ,f :call PreciseJumpF(-1, -1, 1)
omap ,f :call PreciseJumpF(-1, -1, 0)

I got them to work by using instead
nnoremap ,f :call PreciseJumpF(-2, -1, 0)
vnoremap ,f :call PreciseJumpF(-1, -1, 1)
onoremap ,f :call PreciseJumpF(-1, -1, 0)

would it be possible to do something similar for this plugin if it does not break anything else?

Thank you for your work in your plugins and your consideration in this matter.

Use ]B more intelligently

Currently ]B brings one immediately to the last buffer, which is good.

But I think we can do a better job by simulating the behavior of G in vim - when ]B is triggered alone then go to the last buffer, if a number is given e.g. 10]B then go to the corresponding numbered buffer using :exe 'b'.v:count1

Feature Request: ] and [ commands for cnfile and cpfile

I'm not sure what letter would be best to use, but I often find myself using the following workflow that would benefit from this:

  1. Ggrep "something"
  2. :%s/something/else/g
  3. :cnf
  4. :%s/something/else/g
  5. :cnf
  6. :cnf
  7. :%s/something/different/g
  8. ...

[e and ]e ignore count

It seems that no matter what count is given to [e or ]e, the current line is always exchanged with the line directly above or below it, as the case may be. The documentation says it's supposed to take a count:

[e                      Exchange the current line with [count] lines above it.

I tried this as a test user who has no vim plugins or custom keymaps and got the same result.

Using [o on the alphabetically first file in a directory opens a swap file

Given a directory with file:
foobar

open file foobar
]o opens foobar
[o opens .foobar.swp
]o opens .foobar.swp.swp

I expected, while editing foobar, [o to issue an error or open file foobar but it started to edit a swap file. This happens both with vim and gvim.

contents of ~/.vimrc:

set virtualedit=all
set number
colo slate
set sw=2

set runtimepath+=/home/heikki/.vim/ultisnips_rep
set ts=2
set ai
call pathogen#runtime_append_all_bundles()

contents of ~/.vim/
.
./doc
./doc/tags
./doc/taglist.txt
./UltiSnips-1.1.tar.gz
./archives
./archives/taglist_45.zip
./.netrwhist
./autoload
./autoload/pathogen.vim
./plugin
./plugin/taglist.vim
./ultisnips_rep
./ultisnips_rep/.bzrignore
./ultisnips_rep/doc
./ultisnips_rep/doc/UltiSnips.txt
./ultisnips_rep/doc/tags
./ultisnips_rep/utils
./ultisnips_rep/utils/get_tm_snippets.py
./ultisnips_rep/UltiSnips
./ultisnips_rep/UltiSnips/sh.snippets
./ultisnips_rep/UltiSnips/tm_css.snippets
./ultisnips_rep/UltiSnips/php.snippets
./ultisnips_rep/UltiSnips/c.snippets
./ultisnips_rep/UltiSnips/python.snippets
./ultisnips_rep/UltiSnips/tm_ruby.snippets
./ultisnips_rep/UltiSnips/tm_objc.snippets
./ultisnips_rep/UltiSnips/README
./ultisnips_rep/UltiSnips/help.snippets
./ultisnips_rep/UltiSnips/cpp.snippets
./ultisnips_rep/UltiSnips/rst.snippets
./ultisnips_rep/UltiSnips/mkd.snippets
./ultisnips_rep/UltiSnips/java.snippets
./ultisnips_rep/UltiSnips/perl.snippets
./ultisnips_rep/UltiSnips/vim.snippets
./ultisnips_rep/UltiSnips/tcl.snippets
./ultisnips_rep/UltiSnips/tex.snippets
./ultisnips_rep/UltiSnips/snippet.snippets
./ultisnips_rep/UltiSnips/all.snippets
./ultisnips_rep/UltiSnips/tm_javascript.snippets
./ultisnips_rep/UltiSnips/html.snippets
./ultisnips_rep/.bzr
./ultisnips_rep/.bzr/branch-format
./ultisnips_rep/.bzr/checkout
./ultisnips_rep/.bzr/checkout/lock
./ultisnips_rep/.bzr/checkout/conflicts
./ultisnips_rep/.bzr/checkout/dirstate
./ultisnips_rep/.bzr/checkout/format
./ultisnips_rep/.bzr/README
./ultisnips_rep/.bzr/repository
./ultisnips_rep/.bzr/repository/upload
./ultisnips_rep/.bzr/repository/pack-names
./ultisnips_rep/.bzr/repository/lock
./ultisnips_rep/.bzr/repository/packs
./ultisnips_rep/.bzr/repository/packs/4b08371c910d6003cdd5ffd8d1e07313.pack
./ultisnips_rep/.bzr/repository/indices
./ultisnips_rep/.bzr/repository/indices/4b08371c910d6003cdd5ffd8d1e07313.iix
./ultisnips_rep/.bzr/repository/indices/4b08371c910d6003cdd5ffd8d1e07313.tix
./ultisnips_rep/.bzr/repository/indices/4b08371c910d6003cdd5ffd8d1e07313.rix
./ultisnips_rep/.bzr/repository/indices/4b08371c910d6003cdd5ffd8d1e07313.six
./ultisnips_rep/.bzr/repository/obsolete_packs
./ultisnips_rep/.bzr/repository/format
./ultisnips_rep/.bzr/branch
./ultisnips_rep/.bzr/branch/lock
./ultisnips_rep/.bzr/branch/branch.conf
./ultisnips_rep/.bzr/branch/tags
./ultisnips_rep/.bzr/branch/last-revision
./ultisnips_rep/.bzr/branch/format
./ultisnips_rep/.bzr/branch-lock
./ultisnips_rep/test.py
./ultisnips_rep/after
./ultisnips_rep/after/plugin
./ultisnips_rep/after/plugin/UltiSnips_after.vim
./ultisnips_rep/plugin
./ultisnips_rep/plugin/UltiSnips.vim
./ultisnips_rep/plugin/UltiSnips
./ultisnips_rep/plugin/UltiSnips/TextObjects.pyc
./ultisnips_rep/plugin/UltiSnips/Buffer.pyc
./ultisnips_rep/plugin/UltiSnips/Geometry.pyc
./ultisnips_rep/plugin/UltiSnips/Buffer.py
./ultisnips_rep/plugin/UltiSnips/init.py
./ultisnips_rep/plugin/UltiSnips/init.pyc
./ultisnips_rep/plugin/UltiSnips/Geometry.py
./ultisnips_rep/plugin/UltiSnips/debug.py
./ultisnips_rep/plugin/UltiSnips/TextObjects.py
./ultisnips_rep/ChangeLog
./bundle
./bundle/vim-textobj-user-0.3.8
./bundle/vim-textobj-user-0.3.8/doc
./bundle/vim-textobj-user-0.3.8/doc/textobj-user.txt
./bundle/vim-textobj-user-0.3.8/autoload
./bundle/vim-textobj-user-0.3.8/autoload/textobj
./bundle/vim-textobj-user-0.3.8/autoload/textobj/user.vim
./bundle/space
./bundle/space/doc
./bundle/space/doc/space.txt
./bundle/space/test
./bundle/space/test/tests.txt
./bundle/space/plugin
./bundle/space/plugin/space.vim
./bundle/ultisnips
./bundle/ultisnips/doc
./bundle/ultisnips/doc/UltiSnips.txt
./bundle/ultisnips/utils
./bundle/ultisnips/utils/get_tm_snippets.py
./bundle/ultisnips/UltiSnips
./bundle/ultisnips/UltiSnips/sh.snippets
./bundle/ultisnips/UltiSnips/tm_java.snippets
./bundle/ultisnips/UltiSnips/tm_css.snippets
./bundle/ultisnips/UltiSnips/c.snippets
./bundle/ultisnips/UltiSnips/python.snippets
./bundle/ultisnips/UltiSnips/tm_ruby.snippets
./bundle/ultisnips/UltiSnips/tm_objc.snippets
./bundle/ultisnips/UltiSnips/README
./bundle/ultisnips/UltiSnips/help.snippets
./bundle/ultisnips/UltiSnips/cpp.snippets
./bundle/ultisnips/UltiSnips/tm_html.snippets
./bundle/ultisnips/UltiSnips/perl.snippets
./bundle/ultisnips/UltiSnips/vim.snippets
./bundle/ultisnips/UltiSnips/tex.snippets
./bundle/ultisnips/UltiSnips/snippet.snippets
./bundle/ultisnips/UltiSnips/all.snippets
./bundle/ultisnips/UltiSnips/tm_javascript.snippets
./bundle/ultisnips/UltiSnips/tm_tcl.snippets
./bundle/ultisnips/test.py
./bundle/ultisnips/plugin
./bundle/ultisnips/plugin/UltiSnips.vim
./bundle/ultisnips/plugin/UltiSnips
./bundle/ultisnips/plugin/UltiSnips/TextObjects.pyc
./bundle/ultisnips/plugin/UltiSnips/debug.pyc
./bundle/ultisnips/plugin/UltiSnips/Buffer.pyc
./bundle/ultisnips/plugin/UltiSnips/Geometry.pyc
./bundle/ultisnips/plugin/UltiSnips/Buffer.py
./bundle/ultisnips/plugin/UltiSnips/init.py
./bundle/ultisnips/plugin/UltiSnips/init.pyc
./bundle/ultisnips/plugin/UltiSnips/Geometry.py
./bundle/ultisnips/plugin/UltiSnips/debug.py
./bundle/ultisnips/plugin/UltiSnips/TextObjects.py
./bundle/ultisnips/ChangeLog
./bundle/syntastic
./bundle/syntastic/doc
./bundle/syntastic/doc/syntastic.txt
./bundle/syntastic/Rakefile
./bundle/syntastic/syntax_checkers
./bundle/syntastic/syntax_checkers/javascript.vim
./bundle/syntastic/syntax_checkers/sh.vim
./bundle/syntastic/syntax_checkers/cpp.vim
./bundle/syntastic/syntax_checkers/haskell.vim
./bundle/syntastic/syntax_checkers/python.vim
./bundle/syntastic/syntax_checkers/xhtml.vim
./bundle/syntastic/syntax_checkers/html.vim
./bundle/syntastic/syntax_checkers/perl.vim
./bundle/syntastic/syntax_checkers/sass.vim
./bundle/syntastic/syntax_checkers/eruby.vim
./bundle/syntastic/syntax_checkers/php.vim
./bundle/syntastic/syntax_checkers/c.vim
./bundle/syntastic/syntax_checkers/cucumber.vim
./bundle/syntastic/syntax_checkers/ruby.vim
./bundle/syntastic/syntax_checkers/haml.vim
./bundle/syntastic/plugin
./bundle/syntastic/plugin/syntastic.vim
./bundle/speeddating
./bundle/speeddating/doc
./bundle/speeddating/doc/speeddating.txt
./bundle/speeddating/plugin
./bundle/speeddating/plugin/speeddating.vim
./bundle/speeddating/.gitattributes
./bundle/flatfoot
./bundle/flatfoot/plugin
./bundle/flatfoot/plugin/flatfoot.vim
./bundle/unimpaired
./bundle/unimpaired/doc
./bundle/unimpaired/doc/unimpaired.txt
./bundle/unimpaired/plugin
./bundle/unimpaired/plugin/unimpaired.vim
./bundle/vim-arpeggio-0.0.5
./bundle/vim-arpeggio-0.0.5/doc
./bundle/vim-arpeggio-0.0.5/doc/arpeggio.txt
./bundle/vim-arpeggio-0.0.5/after
./bundle/vim-arpeggio-0.0.5/after/syntax
./bundle/vim-arpeggio-0.0.5/after/syntax/vim
./bundle/vim-arpeggio-0.0.5/after/syntax/vim/arpeggio.vim
./bundle/vim-arpeggio-0.0.5/autoload
./bundle/vim-arpeggio-0.0.5/autoload/arpeggio.vim
./bundle/vim-arpeggio-0.0.5/plugin
./bundle/vim-arpeggio-0.0.5/plugin/arpeggio.vim
./bundle/syntaxmotion
./bundle/syntaxmotion/plugin
./bundle/syntaxmotion/plugin/SyntaxMotion.vim
./bundle/surround
./bundle/surround/doc
./bundle/surround/doc/surround.txt
./bundle/surround/plugin
./bundle/surround/plugin/surround.vim
./bundle/tabular
./bundle/tabular/doc
./bundle/tabular/doc/Tabular.txt
./bundle/tabular/after
./bundle/tabular/after/plugin
./bundle/tabular/after/plugin/TabularMaps.vim
./bundle/tabular/autoload
./bundle/tabular/autoload/tabular.vim
./bundle/tabular/plugin
./bundle/tabular/plugin/Tabular.vim
./bundle/nerdtree
./bundle/nerdtree/doc
./bundle/nerdtree/doc/NERD_tree.txt
./bundle/nerdtree/Rakefile
./bundle/nerdtree/plugin
./bundle/nerdtree/plugin/NERD_tree.vim
./bundle/nerdtree/.gitignore
./bundle/nerdtree/nerdtree_plugin
./bundle/nerdtree/nerdtree_plugin/exec_menuitem.vim
./bundle/nerdtree/nerdtree_plugin/fs_menu.vim
./bundle/camelcasemotion
./bundle/camelcasemotion/doc
./bundle/camelcasemotion/doc/camelcasemotion.txt
./bundle/camelcasemotion/autoload
./bundle/camelcasemotion/autoload/camelcasemotion.vim
./bundle/camelcasemotion/plugin
./bundle/camelcasemotion/plugin/camelcasemotion.vim
./bundle/taglist
./bundle/taglist/doc
./bundle/taglist/doc/taglist.txt
./bundle/taglist/plugin
./bundle/taglist/plugin/taglist.vim
./bundle/nerdcommenter
./bundle/nerdcommenter/doc
./bundle/nerdcommenter/doc/NERD_commenter.txt
./bundle/nerdcommenter/Rakefile
./bundle/nerdcommenter/plugin
./bundle/nerdcommenter/plugin/NERD_commenter.vim
./bundle/nerdcommenter/.gitignore
./bundle/vim-textobj-syntax-0.0.0
./bundle/vim-textobj-syntax-0.0.0/doc
./bundle/vim-textobj-syntax-0.0.0/doc/textobj-syntax.txt
./bundle/vim-textobj-syntax-0.0.0/autoload
./bundle/vim-textobj-syntax-0.0.0/autoload/textobj
./bundle/vim-textobj-syntax-0.0.0/autoload/textobj/syntax.vim
./bundle/vim-textobj-syntax-0.0.0/plugin
./bundle/vim-textobj-syntax-0.0.0/plugin/textobj
./bundle/vim-textobj-syntax-0.0.0/plugin/textobj/syntax.vim

VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Dec 3 2009 09:02:01)
Included patches: 1-315
Huge version without GUI. Features included (+) or not (-):
+arabic +autocmd -balloon_eval -browse ++builtin_terms +byte_offset +cindent
-clientserver -clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments
+cryptv +cscope +cursorshape +dialog_con +diff +digraphs -dnd -ebcdic
+emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path +find_in_path
+float +folding -footer +fork() +gettext -hangul_input +iconv +insert_expand
+jumplist +keymap +langmap +libcall +linebreak +lispindent +listcmds +localmap
+menu +mksession +modify_fname +mouse -mouseshape +mouse_dec +mouse_gpm
-mouse_jsbterm +mouse_netterm -mouse_sysmouse +mouse_xterm +multi_byte
+multi_lang -mzscheme -netbeans_intg -osfiletype +path_extra +perl +postscript
+printer +profile +python +quickfix +reltime +rightleft +ruby +scrollbind
+signs +smartindent -sniff +startuptime +statusline -sun_workshop +syntax
+tag_binary +tag_old_static -tag_any_white -tcl +terminfo +termresponse
+textobjects +title -toolbar +user_commands +vertsplit +virtualedit +visual
+visualextra +viminfo +vreplace +wildignore +wildmenu +windows +writebackup
-X11 -xfontset -xim -xsmp -xterm_clipboard -xterm_save

Fedora release 11 (Leonidas)

com to toggle menu on gvim

righ now I have

   nnoremap <leader>tm :if &go=~'m'<bar>set go-=m<bar>else<bar>set go+=m<bar>endif<cr>

this sounds like a good thing to add?

Add '[o|', ']o|', and 'co|' mappings for colorcolumn=81 toggling

Sometimes I like to toggle the 'colorcolumn=81'. Do you like adding this to 'unimpaired.vim'?

diff --git a/doc/unimpaired.txt b/doc/unimpaired.txt
index 4fa79f7..f1c206c 100644
--- a/doc/unimpaired.txt
+++ b/doc/unimpaired.txt
@@ -83,6 +83,7 @@ On    Off     Toggle  Option
 *[or*  *]or*   *cor*   'relativenumber'
 *[os*  *]os*   *cos*   'spell'
 *[ou*  *]ou*   *cou*   'cursorcolumn'
+*[oU*  *]oU*   *coU*   'colorcolumn=80'
 *[ov*  *]ov*   *cov*   'virtualedit'
 *[ow*  *]ow*   *cow*   'wrap'
 *[ox*  *]ox*   *cox*   'cursorline' 'cursorcolumn' (x as in crosshairs)
diff --git a/plugin/unimpaired.vim b/plugin/unimpaired.vim
index 1c9993b..b729410 100644
--- a/plugin/unimpaired.vim
+++ b/plugin/unimpaired.vim
@@ -214,6 +214,9 @@ nnoremap ]ob :set background=dark<CR>
 nnoremap cob :set background=<C-R>=&background == 'dark' ? 'light' : 'dark'<CR><CR>
 call s:option_map('c', 'cursorline')
 call s:option_map('u', 'cursorcolumn')
+nnoremap [oU :set colorcolumn=81<CR>
+nnoremap ]oU :set colorcolumn=0<CR>
+nnoremap coU :set colorcolumn=<C-R>=&colorcolumn != 0 ? 0 : 81<CR><CR>
 nnoremap [od :diffthis<CR>
 nnoremap ]od :diffoff<CR>
 nnoremap cod :<C-R>=&diff ? 'diffoff' : 'diffthis'<CR><CR>

Restore `yp` map?

The yp map was removed recently in 7c345a1. I used it quite a bit, any chance of having that added back in?

]f and [f are inconsistent when ignorecase is set

Sometimes I want to use ]f and [f to look through all the files in a given dir. The problem is, sometimes if I pop up out of the dir I was in, and then go back, I go back to a dir that was not the one I was in before!

Disabling ignorecase in my vim settings fixes this.

Here's an example.

$ ls -R  
/home/frew/tmp
.:
headers  sqlncli-11.0.1790.0

./sqlncli-11.0.1790.0:
bin  build_dm.sh  docs  include  install.sh  lib64  LICENSE  README  WARNING

./sqlncli-11.0.1790.0/bin:
BatchParserGrammar.dfa  BatchParserGrammar.llr  bcp-11.0.1790.0  bcp.rll  sqlcmd-11.0.1790.0  SQLCMD.rll

./sqlncli-11.0.1790.0/docs:
en_US.tar.gz

./sqlncli-11.0.1790.0/include:
sqlncli.h

./sqlncli-11.0.1790.0/lib64:
libsqlncli-11.0.so.1790.0  sqlnclir11.rll

if I do vi headers, ]f, I move from headers to sqlncli-11.0.1790.0/LICENSE. Then when I do [f I end up at sqlncli-11.0.1790.0/lib64/sqlnclir11.rll.

Integrate NerdCommenter

It would be good if we can just comment / comment out text using toggles such as [c and ]c

`[p` and `]p` not repeatable with `.`

Using the remapped [p and ]p does not seem update the last edit command, as typing . afterward seems to repeat the command issued prior to [p or ]p.

The original bindings are repeatable with ..

Add mapping for next and preview

I want to go to the next item in quickfix list and preview it. I want to map something like "]g" to "]c" + "go" and "[g" to "[c" + "go".
I think this can be a very useful feature. If you like it I can try to implement it and add a pull request. I never wrote any vimscript before.

After Vim 7.3.1115 'number' and 'relativenumber' should no longer be coupled

In Vim 7.3.1115¹ these have become independent of each other. I believe unimpaired mappings [on ]on con and [or ]or cor should reflect that and become independent of each other, too.

(Looking at the code, I wonder why you chose to reimplement inv{option} in s:toggle() ... and there's an explicit norelativenumber in the number toggles! Well I'm sure you have your reasons.)

¹ ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.1115

Sorting lines from insert-mode fails.

In normal mode i move lines up and down with [e and ]e.
I now try to use these commands from insert mode using the command.
Vim now prefixes the line with the string "``".

[e bombs when applied on the first line of a buffer

And conversely e] bombs on when applied on the last line of a buffer

Admittedly, these are foolish use cases but I guess the expected behaviour should be either a NOOP or swapping the first and last lines of the buffer?

The the error

Error detected while processing function 41_Move:
line 2:
E14: Invalid address

PS Thanks for your great work on vim plugins. I'd otherwise be using some crappy open source IDE

Request/Question - move to first, last, or nth fold in file

Currently in core vim there is zj and zk but sometimes I know I want to go to the first fold in the file (not necessarily at the top of the file) - similarly the last fold or nth fold would be useful.

I'm not sure if it's possible or worth the time it might take to implement though.

`[u` doesn’t properly handle multi-byte characters

[u doesn’t handle multi-byte characters in any semblance of a correct manner — e.g., it percent-escapes (U+2014 EM DASH) as %2014, rather than, e.g., percent-escaping it as %E2%80%94 (UTF-8, as JavaScript’s encodeURI function does) or simply raising an error.

[x doesn't encode all characters

Given the string "← <>", where the first character is U+2190 (&larr;), as verified by vim-characterize, [x only encodes the <> characters and leaves the first character unmodified. But given the string "← <>", ]x properly decodes all the characters.

Unknown function: repeat#set

Error detected while processing function <SNR>21_Move:
line    4:
E117: Unknown function: repeat#set
Press ENTER or type command to continue

base 64 codec?

Just ran into a snippet of base64 encoded work-stuff and thought...isn't there a tpope plugin that already does encode/decode things? Unimpaired! Oh, but it doesn't support base64. Any interest in adding it or accepting a patch?

Binding for Vim 7.4 relativenumber and number

Vim 7.4 allows the user to have a hybrid version of relativenumber and number.

I personally no longer use relativenumber by itself. I find it useful to see the actual line number on my current line.

My .vimrc has the following to override vim-unimpaired's default relativenumber toggling.

nnoremap cor :set <C-R>=&number && &relativenumber ? 'nonumber norelativenumber' : 'number relativenumber'<CR><CR>

Maybe this could be added to vim-unimpaired as an option? Detect the version number? Just a thought. I like it so I thought I'd share it.

[oy, ]oy, and coy for toggling syntax highlighting

Sometimes when editing large files vim does really poorly with syntax highlighting, to the point that I literally wait seconds for an insert to complete. I added these mappings myself and thought they might be useful as part of unimpaired; what do you think? If oS is too grody oy seems like an ok option.

html encode not working for acutes and tilde

I can't have [x to encode correctly at least the following set of characters with acutes and tildes:
á é í ó ú Á É Í Ó Ú ñ Ñ

Don't know exactly why, because they are all listed at the transformation table beginning at line 309, but the decode function works fine.

Steps to reproduce

1 - Create a new file and paste,

&amp; &lt; &gt; &aacute; &Aacute; &ntilde;

2 - Visual select line, and ]x to decode,

& < > á Á ñ

3 - Select line again and [x to encode,

 &amp; &lt; &gt; á Á ñ

I've also tested if the chararter code is correct with ga, for example á is #225 and is correctly listed as acute in the table.

Small typo in doc/unimpaired.txt

The output shown for [x is not the actual output. The second quot entity doesn't have the semicolon that appears after it. (Discovered this when I copy/pasted the output so I could try out ]x and saw the dangling quot)

index 71661a8..f48f8ac 100644
--- a/doc/unimpaired.txt
+++ b/doc/unimpaired.txt
@@ -103,7 +103,7 @@ Mnenomic: encoding always comes before decoding; "[" always 

                                                 *[x* *[xx* *v_[x*
 [x{motion}              XML encode.
-[xx                     <foo bar="baz"> => &lt;foo bar=&quot;baz&quot&gt;
+[xx                     <foo bar="baz"> => &lt;foo bar=&quot;baz&quot;&gt;
 {Visual}[x

                                                 *]x* *]xx* *v_]x*

co/ for shellslash

I frequently switch between Cygwin/MSys environments, where paths contain forward slashes, and Windows standard environments, where path components are separated by backslash. So a shortcut to toggle shellslash would be welcome, and co/ seems intuitive.

[t ]t doesn't work

call s:MapNextFamily('t','t') should be changed to
call s:MapNextFamily('t','tab') to switch tab pages

my vim version is 7.4

ignore quickfix buffer when navigating buffers

Is there a way to skip the quickfix buffer when navigate between buffers using [b?
Because the quickfix has its own separate split, it doesn't need to load into the main split again, right?

snip20140504_1

indent lines after moving

It would be nice if lines would be indented (=) after moving. For single lines it should(?) be as trivial as:

function! s:Move(cmd, count, map) abort
  normal! m`
  exe 'move'.a:cmd.a:count
  norm! ``
  normal! =$
  silent! call repeat#set("\<Plug>unimpairedMove".a:map, a:count)
endfunction

For the xnoremap up movement it would need something like

exe = . v:count1 . j

but i don't quite grasp the mapping as it is. In either case: i think it would be very useful and there's little chance of this having a negative impact for anyone unless i'm missing something right now.

Toggle for colorcolumn

I would like to add a toggle for colorcolumn. I toggle this setting often and I think it would sit nicely along with the others. Would you object to this? If not, I will send a pull request.

The feature would toggle colorcolumn between 0 and +1.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.