Code Monkey home page Code Monkey logo

vim-rsi's People

Contributors

edkolev avatar jdelkins avatar jiz4oh avatar justinmk avatar losingkeys avatar mhinz avatar phongnh avatar tpope avatar vheon 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

vim-rsi's Issues

i_<CTRL-E> remapping conflicts with insert completion

i_Ctrl-E is a very useful key to escape out of the insert completion popup and return the text back to the way it was before you started completion. With vim-rsi, this does not work when called from the middle of a line. If you ignore the remapping when pumvisible() is true, I think that will fix the problem.

respect dot operator

:help i_CTRL-G_U gives examples of movement mappings in insert mode that respect the dot operator, for example <home>, <end>, <left>, <right>. How about vim-rsi piggybacking on these, for example,

inoremap <expr> <C-A> col('.') == match(getline('.'), '\S') + 1 ?
                      \ repeat('<C-G>U<Left>', col('.') - 1) :
                      \ (col('.') < match(getline('.'), '\S') ?
                      \     repeat('<C-G>U<Right>', match(getline('.'), '\S') + 0) :
                      \     repeat('<C-G>U<Left>', col('.') - 1 - match(getline('.'), '\S')))
inoremap <expr> <C-E> col('.')>strlen(getline('.'))<bar><bar>pumvisible()?"\<Lt>C-E>":repeat("\<Lt>C-G>U\<Lt>Right>", col('$') - col('.'))
inoremap <expr> <C-B> getline('.')=~'^\s*$'&&col('.')>strlen(getline('.'))?"0\<Lt>C-D>\<Lt>Esc>kJs":"\<Lt>C-G>U\<Lt>Left>"
inoremap <expr> <C-F> col('.')>strlen(getline('.'))?"\<Lt>C-F>":"\<Lt>C-G>U\<Lt>Right>"

Add Ctrl-K mapping for command mode

I use this so much at the command line that I frequently do the same in vim.

Ctrl-K deletes "⇥ from the cursor to the end of the line"

There's probably an elegant way to do this using mappings, but I'm not sure how.

<M-d> does not work in command mode

If I press <M-d> in command mode it uses the mapping for insert mode (:!echo write a few words^Odw).

It should act the same way as <M-BS> which works fine in command mode.

This can be solved by adding:

cnoremap        <M-d> <S-Right><C-w>

Some circumflex letters do not work, such as â and î. æ doesn't work either (Colemak, perhaps other layouts as well).

In Colemak, you attain the circumflex by hitting AltGr+x and then the letter you would like to apply it to.

î is attained by hitting AltGr+x and then i.

â is attained by hitting AltGr+x and then a.

æ is attained by hitting AltGr+z.

I noticed the issue when trying to type in French just now.

I tested all of the French accented characters with vim-rsi disabled, and again when enabled. These are the only three that are affected, and every one of them functions correctly without the plugin enabled.

I haven't tested these with any other layout, so it is unclear if other layouts are affected. It's possible that it has something to do with how they are composed in Colemak.

enable only in command mode

hi, can you add a variable to control this rsi feature only works in command line mode, i.e., give an option to disable it in insert mode? thanks.

Some macros are not recorded successfully

Hi,

whenever I have the following code:

[x]var b = new A();

[x] is the cursor
and if I start writing the following macro:

qq0fnDo<esc>pkJ (which is a macro that does absolutely nothing), and if I I do @q to replay that macro, I get the following resul instead: vakJr b =

Whenever I remove vim-rsi, this doesnt happen anymore (my full dot files are here: https://bitbucket.org/edi9999/dotfiles/src/6b646ff8e5566f751c92c469b128258f62ae4bf0/.vimrc?at=master)

Do you know what is happening here ?

Ctrl-_ to undo in insert mode

Consider adding
inoremap <C-> u
It's very handy for me, but I don't know how important i_CTRL-
is for others.
I don't know if it's even possible to have it in command mode.

Meta mappings not working when $TERM is not xterm

While I see vim-rsi is correctly mapping <M-d>:

:verbose imap <m-d>
i  ä           * <C-O>dw
        Last set from ~/.vim/.cache/neobundle/vim-rsi/plugin/rsi.vim

My $TERM/terminfo(?), prints ALT + D as ^]d, unsurprisingly typing the ä, results in the desired command. When running vim from an xterm, it correctly(?), maps ALT + D as ä.

It seems every other terminal emulator (rxvt, and almost everyone [if not all] based on the vte gtk widget) maps ALT + D as ^]d. Though, setting <M-d> as <esc>d, partially solves the problem:

execute "set <M-d>=\ed"
" I tried using \<Esc>, but it's too fast(?) and exists insert mode and let you in operator pending after inserting a `d`.

If I understand correctly, problem with that is that you use <M-d> fast enough (below ttimeoutlen?) the command gets executed as two: ^[, and d and you get out of insert mode and d is inserted in normal mode.

Anyway, I think a plausible workaround could be checking the term, and in case is not xterm, run that line. If you are interested I can do a PR.

Alt maps break macros and mappings that use <esc> + char

Hi,
for the past week or so I was obsessed with setting up Alt mappings for all the possible keys based on the example provided in vim-rsi. I digged the idea of being able to use Alt as another modifier key. I even created a plugin that enables that (it's a work in progress, but I probably won't bother to finalize it).

Since then, I've learned that setting up alt mappings breaks 2 other things:

  • regular mappings that use esc + character and
  • macros that have esc + char

Here's how the issues can be reproduced in vim-rsi:

  • the following macro doesn't work istuff^[f.astuff^[. f. does not do what it should because ^[ + f is recognized as
  • this mapping does not work imap <C-s> <Esc>ddi (this example is obviously made up)

Basically, anytime <Esc> + b, d, f, n or p (alt mappings from vim-rsi) is executed in a macro or a mapping, I think it won't work. And it will be dang hard to debug why.

For me personally, the biggest issue are f and n because they are used all to often in macros.

Not sure if there's any solution to this, but I hope bringing this up helps.

a couple missing keybinds?

Hi! thank you for all the great plugins!
I noticed that sensible.vim defines two binds:

if empty(mapcheck('<C-U>', 'i'))
    inoremap <C-U> <C-G>u<C-U>
endif

if empty(mapcheck('<C-W>', 'i'))
    inoremap <C-W> <C-G>u<C-W>
endif

These are missing from rsi.vim, shouldn't these be added also if sensible.vim does not exist?

M-f, M-d go one char too far

If you're at the bar in: as |df hj
And you hit M-f in Emacs, you end up at: as df| hi (your next char goes right after the df)

But in vim-rsi you end up at as df |hj

Same thing for M-d, slurping the space after the deleted text while Emacs leaves that space there.

C-k map is missing

C-u deletes from the cursor to the beginning of the line, C-k deletes from the cursor to the end of the line

I use both of these pretty frequently in bash, vim-rsi provides C-u but not C-k.

Rapid pressing <esc> n from insert mode causes glitches

I am using Cygwin's MinTTY. $TERM is xterm-256color.

Following scenario:

  1. Go to insert mode
  2. Press <esc>
  3. Quickly press n (as in, go to next search result)

rather than going to the next match, results in cursor being moved as if I pressed <esc>ja and it doesn't go to normal mode.

What's interesting is that rather than entering insert mode again, it looks like I never left insert mode in the first place.

This leads me to believing that I am pressing keys quick enough that it gets interpreted as an escape sequence of one keypress, which matches some libreadline key binding. Following this logic, it manifests only now because before I've installed vim-rsi, that sequence was unbound and its components got interpreted as separate keypresses.

I can fix the behavior by adding let g:rsi_no_meta = 1 to .vimrc, but this breaks altb in command mode.

I think adding an option whether to include readline keybindings in insert mode would be sufficient. Actually, this is caused by noremap! <M-n> <Down>... not sure what to make of it.

Really curious about `set <F31> ..`. Care to shine some light on that?

Hi,
love the plugin. I was mind-blown to find Alt mappings can be used in terminal vim (tried to google that before, no success).

I was skimming the source code of the plugin and saw this:
https://github.com/tpope/vim-rsi/blob/master/plugin/rsi.vim#L51-55

I'm not particularly good with vimscript, but I don't even know where to start looking that up? Where do the - come from? Is that a vim, bash, system thing..?

I'd be grateful even for the point in a direction so I can figure it out myself. Thanks!

i_CTRL-E remapping conflicts with insert completion

coc has a custom popup window now and use coc#pum#visible() check whether insert completion is visible.

maybe vim-rsi should give user a function to customize i_CTRL-E and c_CTRL-Y, like

let pumvisible_func = get(g:, 'pumvisible_func', 'pumvisible')

inoremap <expr> <C-E> col('.')>strlen(getline('.'))<bar><bar>pumvisible_func()?"\<Lt>C-E>":"\<Lt>End>"

any suggestions will be appreciated

You know Readline key bindings?

Question asked in the README:

You know Readline key bindings? Of course you do, they're in your shell, your REPL, and perhaps even the GUI for your OS.

Turns out - no I don't, even with a decade of using linux terminals. But this plugin is very helpful through the doc to show me Readline key bindings that I didn't know existed.

Have CLI <M-b> and <M-f> move over "words" instead of "WORDS"

This is something that repeatedly pops up for me.
While current implementation of <M-b> and <M-f> in command line is useful, I'd prefer to have it work just as in bash - that is, respecting "word".

I miss this the most when trying to manually edit the middle "piece" of the filename, example:

:e /path/need_to_edit_this_part/path/file.txt

If the feature is acceptable, I'd even be willing to try to implement this, but I'm worried no one would want to merge and later maintain the vimscript I write :/

inoremap <C-K> <C-O>d$

the subject says it all, just a kill to the end of the line. I like it. not sure what or if it breaks any vim stuff, nothing I could see.

CTRL-T overrides default mapping in some search modes

CTRL-T mapping is currently explicitly disabled in regular search modes (/ and ?) to allow for default behaviour of jumping between incsearch results. Recently (I believe) Vim started supporting /_CTRL-G and /_CTRL-T in other search modes like :global, :vglobal, and :substitute. Previous special casing in vim-rsi doesn't work for them so it is impossible to jump back (/_CTRL-G works as expected). Can these modes also be special-cased to preserve default CTRL-T behaviour?

Ctrl a and Ctrl e when soft wrapping

Nice plugin. though I have noticed that, for example, C-a moves to the first character in the line, not the first character in the visible line when lines are wrapped.

Would it be possible for the plugin to detect this and use 0 rather than ^ to move to the start of the line? And similar behaviour for C-e, ie using $ for end of line when wrapped.

Thanks

Martin

m-t

How about including word transposition with m-t?

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.