Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
A scripting language embedded into Vim. It can be used to customize Vim to suit your needs and to create plugins. Also called VimL.
0
votes
Accepted
How to edit the current buffer in another existing buffer?
The problem is more complex than what I described in the OP. But, in short, if you have the information that your current file content is loaded in a buffer that is not listed (by not listed I meant t …
0
votes
How to get the buffer number of `:bn`?
It turns out that the naive way works: (answer in Lua)
vim.cmd('bn')
local buf_right = vim.fn.bufnr()
vim.cmd('bp')
0
votes
1
answer
2k
views
How to simulate an Enter key in command mode?
As title. Is it possible to simulate an Enter(i.e. <CR>) in command-mode, i.e. after pressing :?
1
vote
2
answers
2k
views
How to get the buffer number of `:bn`?
As title. When running :bn the current buffer will be switched to the next buffer. I want to get the buffer number of this buffer without changing the current buffer(or, at least, can switch back to t …
0
votes
1
answer
130
views
How to edit the current buffer in another existing buffer?
As title. I'm in a situation where a file is loaded into a buffer that is not listed in the buffers from the list :ls. So I want to transfer the content of the current unlisted buffer to an existing b …
0
votes
1
answer
887
views
How to take the path argument passed into vim/neovim into account when call `getcwd()` withi...
Solutions in VimScript is welcome since I can translate it into lua one. …
0
votes
How to detect whether the current file might contains a long line?
Finally, I use combination of strwidth and getfsize to achieve my goal:
is_supported = function ()
if vim.fn.strwidth(vim.fn.getline('.')) > 300
or vim.fn.getfsize(vim.fn.expand("%")) > 1024 * 1 …
3
votes
2
answers
94
views
How to detect whether the current file might contains a long line?
I'm using NeoVim so I prefer script written in Lua, but VimScript is also welcome! …