New answers tagged vimscript
1
vote
How to detect IntelliJ/IdeaVim in vimrc?
Since IdeaVim 1.8.0 you can use the following condition: has("ide"). This works because IdeaVim supports VimScript for several years since 1.7.0.
0
votes
How to get the current word starting from the cursor?
Using vimscript: matchstr(getline('.'), '\k*', getpos('.')[2]-1).
getline('.') gets the current line, matchstrpos searches for the current keyword pattern \k* starting from the current cursor position ...
1
vote
Accepted
How can I match a regexp containing newlines?
I would try:
:execute 'match PrompterCompletion /' . substitute(g:last_completion_text, "[\n\<C-m>]", '\\n', 'g') . '/'
0
votes
Vimscript - Surround word under cursor with quotes
In NVIM you can use this function and map <leader>sw or <leader>sW to use :lua Surround("w") and :lua Surround("W") respectively.
After pressing <leader>sw or <...
1
vote
Accepted
Neovim paste without overwriting register w/ Lua
I believe you should do:
vim.api.nvim_set_keymap('v', 'p', 'pgvy', { noremap = true })
The first argument is the mode:
n for Normal (equivalent to nnoremap)
v for Visual (equivalent to vnoremap)
...
1
vote
What are the escaping rules of command arguments?
What are the rules that :file arguments are escaped?
The argument to :file is undergoing expand() function. expand() expands wildcards and all special keywords. All special characters % # <, ...
Top 50 recent answers are included
Related Tags
vimscript × 1535vimrc × 249
key-bindings × 129
neovim × 122
functions × 112
regular-expression × 56
autocmd × 51
syntax-highlighting × 48
buffers × 40
search × 38
command-line × 34
variables × 34
gvim × 33
visual-mode × 32
vim-windows × 30
plugin-system × 26
external-command × 25
statusline × 23
cursor-movement × 21
register × 21
lua × 21
terminal × 20
autocompletion × 20
vimscript-python × 20
highlight × 19