Comments (31)
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.
You can also do :verbose omap w
to find out where it comes from.
from vim-wordmotion.
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.
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.
where
^[w
is the output ofCTRL+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.
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.
It should print
test
every time you pressALT+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 defaultciw
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.
Looks like this could be the issue.
from vim-wordmotion.
Yeah that's probably it. Could you test with a different terminal?
from vim-wordmotion.
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.
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.
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.
Those are identical. You can refer to any option as variables with
&
.
That's what I thought.
Where does ∑ come from?
from vim-wordmotion.
I got ∑ from CTRL-v
OPTION-w
.
from vim-wordmotion.
When I tried that I got set <M-w>=<M-w>
🤯😄
from vim-wordmotion.
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.
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.
Running only this plugin yields same result.
from vim-wordmotion.
Could you try the system vim instead of nvim?
from vim-wordmotion.
So in Vim <M-w>
outputs ^[w
for me.
from vim-wordmotion.
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.
I'm also running through tmux, and it still works fine.
$ tmux -V
tmux 3.2
from vim-wordmotion.
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.
Does it work without tmux?
from vim-wordmotion.
Probably relevant iTerm prefs:
from vim-wordmotion.
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.
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.
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.
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.
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.
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)
- Error detected while processing function wordmotion#init HOT 4
- cw and dw revert to default vim behavior HOT 3
- Leading underscore as non-whitespace? HOT 4
- cw with count not work correctly HOT 1
- #define is considered two words HOT 2
- Warn users if they copied the example configurations from the README HOT 3
- Broken lsp rename HOT 3
- Wrong behavior with folds HOT 1
- cw HOT 6
- around word does not select prior separator characters.
- use vim default word definition for `WORD` HOT 4
- wordmotion_prefix not working when using Lazy plugin manager HOT 2
- Hex color codes not recognized as single words HOT 2
- Make w recognize - and CamelCase and W do what w used to do? HOT 4
- Absolutely perfect, thank you HOT 1
- Change or extend pattern to handle text end with 2 or more punctuations? HOT 2
- Last letter left for ciw command HOT 1
- I hope there could be an option to temporarily disable this plugin because sometimes I need to use the original word motion feature. HOT 2
- yank or delete support HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vim-wordmotion.