New answers tagged

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.
Vladimir Parfinenko's user avatar
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 ...
Sakari Cajanus's user avatar
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') . '/'
Vivian De Smedt's user avatar
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 <...
Federico Bruzzone's user avatar
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) ...
Vivian De Smedt's user avatar
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 % # <, ...
KamilCuk's user avatar
  • 265

Top 50 recent answers are included