I'm trying to remap ':w' to 'zz' in vscode vim. I've made 2 attempts, (one commented out). So far its not working. How can I perform this remap?
"vim.commandLineModeKeyBindings": [
{
"before": [":","w"],
"after": ["z", "z"]
// "before": ["z", "z"],
// "after": [":","w"]
},
]
You should be able to use the following to map zz to the save action:
"vim.normalModeKeyBindingsNonRecursive": [
{
"before": ["z", "z"],
"commands": [
":w"
]
}
]
Related
I'm starting to learn vim in VSCode and I have the following settings.json
{
"window.zoomLevel": 1,
"vim.insertModeKeyBindings": [
{
"before": [
"<C-c>"
],
"after": [
"<Esc>"
]
}
],
"vim.hlsearch": true,
"vim.normalModeKeyBindingsNonRecursive":[
{
"before":[
"<leader>",
"/"
],
"commands":[
":nohl"
]
},
{
"before":[
"<space>"
],
"after":[
"<leader>"
]
}
]
}
The problem is the ,/ part. It doesn't hide the highlighted search, it recognizes the leader key but after pressing /, the command :nohl is not executed.
I don't see what's wrong with the code, any help is appreciated.
How can I make vim extension in VSC make to use my keybinding?
In my .vimrc I got those lines:
" s* - CRTL + D like behavior
nnoremap <silent> s* :let #/='\<'.expand('<cword>').'\>'<CR>cgn
xnoremap <silent> s* "sy:let #/=#s<CR>cgn
How could I add them to my VSC?
Tried to add to my settings.json something like below, but got no idea how to add it properly every time I got an error:
Failed to handle key `*`: command '"sy:let #/=#s<CR>cgn' not found
"vim.normalModeKeyBindings": [
{
"before": [
"s",
"*"
],
"commands": [
":nohl:let #/='\\<'.expand('<cword>').'\\>'<CR>cgn",
],
"silent": true
},
{
"before": [
"s",
"*"
],
"commands": [
"\"sy:let #/=#s<CR>cgn",
],
"silent": true
},
]
I'm using VS Code's neovim integration with neovim installed from snap. I want Y to work the same way as D and C. In ~/.config/nvim/init.vim I would add
map Y y$
How do I do this in VS Code? I've tried
"vim.normalModeKeyBindingsNonRecursive": [
{
"before": ["Y"],
"after": ["y$"]
},
],
and
"vim.normalModeKeyBindings": [
{
"before": ["Y"],
"after": ["y$"]
}
],
but neither worked.
Turns out you need to specify and separate each key into an individual "", so that would be:
"vim.normalModeKeyBindings": [
{
"before": ["Y"],
"after": ["y", "$"]
}
]
I really want to use Visual Code and it looks like it has a great Vim mode. Unfortunately I'm one of those people that changed my .vimrc so that deletes, changes and the like would move to the blackhole register so that it wouldn't take over my last yank.
Does anyone know of a way to do something similar for dd or C mappings? I've tried it various ways but can't seem to get it to work.
It seems to only work with a leader like so
"vim.normalModeKeyBindingsNonRecursive": [
{
"before": ["<leader>","d"],
"after": ["\"", "_", "d", "d"]
},
],
"vim.leader": "<space>",
Doing the following though doesn't work. Any ideas?
"vim.normalModeKeyBindingsNonRecursive": [
{
"before": ["d","d"],
"after": ["\"", "_", "d", "d"]
},
],
Black hole register mapping functionality has been fixed in the recent PR, just a few months after you posted this question. Update your VScode to the latest stable release and your mappings should work fine.
If you are interested in how to disable cut functionality for d command, here is how to do it. Put this in your settings.json:
"vim.normalModeKeyBindingsNonRecursive": [
{
"before": ["d"],
"after": [ "\"", "_", "d" ]
}
]
Hope this helps
I try to get some data from Facebook Marketing API. The result I get are generally correct but I have problem with data. It seems like parametr time_range doesn't work.
https://graph.facebook.com/v2.7/act_<MY_ACT>/ads?fields=name,adcreatives{object_story_id},insights{spend,unique_clicks},effective_status¶ms=time_range={%22since%22:%222016-11-15%22,%22until%22:%222016-11-17%22}&limit=2000&access_token=<MY_TOKEN>
Result:
{
"data": [
{
"name": "xx",
"adcreatives": {
"data": [
{
"id": "xx"
}
]
},
"effective_status": "DISAPPROVED",
"id": "xx"
},
{
"name": "xx",
"adcreatives": {
"data": [
{
"id": "xx"
}
]
},
"insights": {
"data": [
{
"spend": xx,
"unique_clicks": "34",
"date_start": "2016-10-19",
"date_stop": "2016-11-17"
}
],
"paging": {
"cursors": {
"before": "MAZDZD",
"after": "MAZDZD"
}
}
},
"effective_status": "CAMPAIGN_PAUSED",
"id": "xx"
},...}
I tried encode it, write in different way, but each time the results are from the last month, so date_start is 2016-10-19 and date_stop is 2016-10-17, not from range I put as parametr in query. How can I fix it?
Edit:
I also tried instead of ¶ms=time_range={%22since%22:%222016-11-15%22,%22until%22:%222016-11-17%22} something like &date_preset=yesterday (yesterday or other correct value listed in documentation) but still I get exact same dates...
You can use the following to get insights within certain time_range:
/act_<ACCT_ID>/insights?level=ad&time_range={"since":"2016-11-15","until":"2016-11-17"}