question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

write command doesn't work when mapped

See original GitHub issue

In my init.vim I have

nnoremap <Space> <Nop>
let mapleader="\<Space>"
nnoremap <leader>w :w<CR>

and in VSCode, everything else works great, but when I press space, nothing happens. Same with space w.

Do I need to do something special for the leader? Is there a way to debug and see what is going wrong?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
theol0403commented, Oct 29, 2020

I don’t think there is a way to override neovim’s save file command, this plugin just has a mechanism to automatically correct :w to :Write. When you use <Cmd> you bypass that correction, thus calling neovim’s save command - not the VSCode save command that normally :w gets corrected to.

0reactions
Shaturcommented, Oct 29, 2020

This command is only replaced inside the VSCode cmdline if I understand correctly. In mappings you should use alternate commands like :Write.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Mapping a command not the same as writing ...
I'm trying to use a mapping in my vimrc to execute a command. The command works if I directly type it into the...
Read more >
Network drive mappings not working properly
go back to command prompt. type in "net use z: "\\george-backup\backup /p:yes; able to access networked mapped drive now from both Explorer ...
Read more >
Conversion of Ex command to mapping not always working
:help sees | as its argument, so I suggest to write a simple function. function! s:search_help(str) exec 'help '.a:str only endfunction ...
Read more >
Having trouble executing <enter> automatically in a stored ...
Put in a literal carriage return character instead - press Ctrl + V, then Enter when writing the map: :map ,k :!python %^M....
Read more >
How to Connect to Network Drives on the Command Line ...
Mapping Network Drives Using Logged-In Credentials · 1. Open a command prompt or PowerShell console as administrator. · 2. Let's map the drive ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found