New answers tagged

0 votes

How to search and replace the highlighted text from visual mode?

In order to mimic what you have done for normal mode I would do: vim.keymap.set("v", "<leader>r", [["hy:%s/<C-r>h/<C-r>h/gI<Left><Left><left&...
Vivian De Smedt's user avatar
4 votes
Accepted

How can I extend syntax highlighting with my own keywords?

The correct filetype for JavaScript is javascript, so your file, which corresponds to a non-existing js filetpe, will never be sourced automatically. It should be: ~/.vim/syntax/javascript.vim Vim ...
romainl's user avatar
  • 39.3k
2 votes

How can I extend syntax highlighting with my own keywords?

Your solution is already pretty close. However, there are three minor issues with it: The filetype for JavaScript is called "javascript", not "js". That's what your file is ...
Friedrich's user avatar
  • 1,299
0 votes

How to share config between Vim and Neovim

I used the following: VIMINIT='if has("nvim")|let f="init.lua"|else|let f="vimrc"|end|let $MYVIMRC="~/.config/vim/".f|source $MYVIMRC' Then put all files in ~/....
Tom Hale's user avatar
  • 2,601

Top 50 recent answers are included