Giter VIP home page Giter VIP logo

Comments (31)

chaoren avatar chaoren commented on September 16, 2024

Could you elaborate? Do you mean cw? You might have a conflicting omap for w.

What's the output of :omap w?

from vim-wordmotion.

chaoren avatar chaoren commented on September 16, 2024

You can also do :verbose omap w to find out where it comes from.

from vim-wordmotion.

nomasprime avatar nomasprime commented on September 16, 2024

Hi @chaoren, didn't realise GitHub wasn't displaying some text in my initial comment, had to add back ticks to display properly. Added more info too. Hopefully makes more sense now 😄

Both omap commands output <Plug>WordMotion_w. Second adds Last set from…wordmotion.vim line 60.

from vim-wordmotion.

chaoren avatar chaoren commented on September 16, 2024

So whether <M-w> mappings work out of the box depends on your terminal. You can test this with

:map <M-w> :echo 'test'<CR>

It should print test every time you press ALT+w.

If it doesn't print test, then you probably need to do

:set <M-w>=^[w

where ^[w is the output of CTRL+v ALT+w instead of a literal ^[w.

So your vimrc would need to have this to work:

    set <M-w>=^[w
    let g:wordmotion_mappings = {'w': '<M-w>'}

from vim-wordmotion.

chaoren avatar chaoren commented on September 16, 2024

where ^[w is the output of CTRL+v ALT+w instead of a literal ^[w.

I hope this part makes sense. You have to type :set <M-w>=, then while the cursor is still there hit the actual keys CTRL+v and then ALT+w. This will insert the actual key codes produced by ALT+w and lets vim recognize it as <M-w>.

from vim-wordmotion.

chaoren avatar chaoren commented on September 16, 2024

Curious why ci<M-w> etc work as I'd expect

I have no idea how you got ci<M-w> to work if <M-w> is not working. Are you sure it's not just doing the default ciw motion?

from vim-wordmotion.

nomasprime avatar nomasprime commented on September 16, 2024

It should print test every time you press ALT+w.

It does.

I have no idea how you got ci<M-w> to work if <M-w> is not working. Are you sure it's not just doing the default ciw motion?

ci<M-w> is definitely working as expected, changes entire default Vim word.

<M-w> works except with c<M-w>.

My terminal is iTerm and option [meta] key is set to Esc+.

from vim-wordmotion.

nomasprime avatar nomasprime commented on September 16, 2024

Looks like this could be the issue.

from vim-wordmotion.

chaoren avatar chaoren commented on September 16, 2024

Yeah that's probably it. Could you test with a different terminal?

from vim-wordmotion.

nomasprime avatar nomasprime commented on September 16, 2024

Tried with Apple Terminal and nothing happens at all, cursor doesn't even move to end of default Vim word.

I already have set t_TI= t_TE= in Vim config. Not sure what the difference is between this and let &t_TI="" let &t_TE="".

from vim-wordmotion.

chaoren avatar chaoren commented on September 16, 2024

It works for me in both iTerm2 3.4.8 and Apple Terminal 2.11 (440).

I just had to set

	set <M-w>=∑
	let g:wordmotion_mappings = {'w': '<M-w>', 'iw': 'i<M-w>'}

from vim-wordmotion.

chaoren avatar chaoren commented on September 16, 2024

Not sure what the difference is between this and let &t_TI="" let &t_TE="".

Those are identical. You can refer to any option as variables with &.

from vim-wordmotion.

nomasprime avatar nomasprime commented on September 16, 2024

Those are identical. You can refer to any option as variables with &.

That's what I thought.

Where does ∑ come from?

from vim-wordmotion.

chaoren avatar chaoren commented on September 16, 2024

I got ∑ from CTRL-v OPTION-w.

from vim-wordmotion.

nomasprime avatar nomasprime commented on September 16, 2024

When I tried that I got set <M-w>=<M-w> 🤯😄

from vim-wordmotion.

chaoren avatar chaoren commented on September 16, 2024

Works for me in both homebrew vim and system vim. Please share your terminal version and vim version. And try running vim with a minimal vimrc that contains only this plugin.

$ vim --version
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled May 29 2021 12:30:43)
macOS version - x86_64
Included patches: 1-2900
Compiled by Homebrew

$ /usr/bin/vim --version
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled May  8 2021 05:44:12)
macOS version
Included patches: 1-2029
Compiled by [email protected]

from vim-wordmotion.

nomasprime avatar nomasprime commented on September 16, 2024

Ah, I'm on NeoVim:

NVIM v0.5.0-dev+a03ffe160
Build type: Release
LuaJIT 2.1.0-beta3
Compilation: clang -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNDEBUG -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/tmp/neovim-20210617-54190-lr4tf9/build/config -I/tmp/neovim-20210617-54190-lr4tf9/src -I/usr/local/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/usr/local/opt/gettext/include -I/tmp/neovim-20210617-54190-lr4tf9/build/src/nvim/auto -I/tmp/neovim-20210617-54190-lr4tf9/build/include
Compiled by [email protected]

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/local/Cellar/neovim/HEAD-a03ffe1_2/share/nvim"

Run :checkhealth for more info

I'll try with only this plugin…

from vim-wordmotion.

nomasprime avatar nomasprime commented on September 16, 2024

Running only this plugin yields same result.

from vim-wordmotion.

chaoren avatar chaoren commented on September 16, 2024

Could you try the system vim instead of nvim?

from vim-wordmotion.

nomasprime avatar nomasprime commented on September 16, 2024

So in Vim <M-w> outputs ^[w for me.

from vim-wordmotion.

nomasprime avatar nomasprime commented on September 16, 2024

I was also running tmux which I've now disabled.

Now <M-w> outputs ÷. NB not plus, something else…I think part of the issue might be that my keyboard is programmed with Dvorak layout but system is QWERTY 🤔

from vim-wordmotion.

chaoren avatar chaoren commented on September 16, 2024

I'm also running through tmux, and it still works fine.

$ tmux -V
tmux 3.2

from vim-wordmotion.

nomasprime avatar nomasprime commented on September 16, 2024

My tmux.conf (removed extraneous bindkeys):

# # Environment
set-environment -g SHLVL 1

# # General Options

set-option -g -w automatic-rename off
set-option -g -w window-status-current-format ' #W #F #I '
set-option -g -w window-status-current-style fg=green
set-option -g -w window-status-format ' #W #F #I '
set-option -g -w window-status-separator ''
set-option -g -w window-status-style fg=colour08
set-option -g -w xterm-keys on
set-option -g base-index 1
set-option -g default-terminal "screen-256color"
set-option -g display-time 3000
set-option -g focus-events on
set-option -g history-limit 10000
set-option -g mode-keys vi
set-option -g mouse on
set-option -g pane-base-index 1
set-option -g prefix M-C-t
set-option -g renumber-windows on
set-option -g set-titles on
set-option -g set-titles-string '#T \ #W \ #S \ #h'
set-option -g status-keys "emacs"
set-option -g status-left ' #S '
set-option -g status-right " $USER@#h  %a %-d %b %R "
set-option -g status-style fg=colour07,bg=colour18
set-option -g window-status-bell-style fg=blue,bold,underscore
set-option -ga pane-active-border-style bg=default,fg=colour08
set-option -ga pane-border-style bg=default,fg=colour19
set-option -ga terminal-overrides ',*:Ss=\E[%p1%d q:Se=\E[ q'
set-option -ga terminal-overrides ',xterm-256color:Tc'
set-option -ga word-separators :/
set-option -s escape-time 0
# Dimming prototype
# set-option -g window-active-style bg=black
# set-option -g window-style bg=#27292A
# set-option -ga pane-active-border-style bg=default,fg=colour19
# set-option -ga pane-border-style bg=#27292A,fg=colour19

…

from vim-wordmotion.

chaoren avatar chaoren commented on September 16, 2024

Does it work without tmux?

from vim-wordmotion.

nomasprime avatar nomasprime commented on September 16, 2024

Probably relevant iTerm prefs:

Screenshot 2021-06-27 at 13 44 26

from vim-wordmotion.

nomasprime avatar nomasprime commented on September 16, 2024

Does it work without tmux?

No.

I'm now testing with system Vim with tmux, guess that leaves iTerm and mismatch between programmed keyboard layout and system setting.

from vim-wordmotion.

chaoren avatar chaoren commented on September 16, 2024

Try Apple Terminal, no tmux, system vim, empty vimrc except for the plugin, and qwerty instead of dvorak. That should remove all the variables.

If that works, you can start adding things back until something breaks, then we'll know exactly what's causing the issue.

from vim-wordmotion.

nomasprime avatar nomasprime commented on September 16, 2024

Now when I type <M-w> I get a bell sound. Mapping, as you suggested previous, same bell sound. Interestingly, after mapping <M-w> outputs ÷ again.

from vim-wordmotion.

nomasprime avatar nomasprime commented on September 16, 2024

Didn't get anywhere with this.

Still seems really odd that ci<M-w> is working but c<M-w> doesn't. Makes me suspect Vim/plugin's where the issue lies.

Fortunately c<M-w>'s probably the least, if ever, used functionality so can probably get on fine without it.

from vim-wordmotion.

chaoren avatar chaoren commented on September 16, 2024

Well I can't help you since I can't reproduce. Please let me know if you figure out what the problem is.

from vim-wordmotion.

nomasprime avatar nomasprime commented on September 16, 2024

No problem, understand. Tricky with so many variables involved.

Will update if I figure it out and thanks for trying, much appreciated 👍

from vim-wordmotion.

Related Issues (20)

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.