Hold Control (or Opt, if you're on a Mac) + Left (or h, if you're a neovim purist) to jump to the closest symbol,
beginning of word, or uppercase character inside a word that is on the left of the current cursor position. Use
<Right> (or l) to move to the right, using the same logic.
Hold Control (or Opt) + Backspace to delete what's on the left of the cursor, using the same smart logic for the
jump; use Del to delete, instead, what's on its right.
Important
The plugin must NOT be lazy loaded!
{
"neovim-idea/camelhumps-nvim",
lazy = false,
}use {
"neovim-idea/camelhumps-nvim",
}Plug "neovim-idea/camelhumps-nvim"In your config function, simply add the following lines:
local camelhumps = require("camelhumps").setup()
vim.keymap.set({ "n", "i", "v" }, "<M-Left>", camelhump.left, { noremap = true, silent = true })
vim.keymap.set({ "n", "i", "v" }, "<M-Right>", camelhump.right, { noremap = true, silent = true })
vim.keymap.set({ "n", "i", "v" }, "<M-BS>", camelhump.left_delete, { noremap = true, silent = true })
vim.keymap.set({ "n", "i", "v" }, "<M-Del>", camelhump.right_delete, { noremap = true, silent = true })As you might have guessed, the plugin exposes four, high level methods:
left(), to move the cursor to the leftright(), to move the cursor to the rightleft_delete(), to delete text on the left of the cursorright_delete(), to delete text on the right of the cursor
Install lua, luarocks and busted, usually via brew as such:
brew install lua luarocks bustedThen, you can run the tests like so
chmod +x run_tests.sh
./run_tests.sh- recognise enums such as
FOO_BAR_BAZad jump them altogether - have a round of checks on the tests and make sure to document behaviours diverging from IntelliJ
-
left/right{_delete}have quite some duplicate code: make it centralized - wrap internal functions that are testsed into a
_privatemodule, and export them if_G.testing_enabled == true - make
run_tests.shdetect if deps are already installed and, if so, skip the process
BTC 12CQ1L7qQvF3pPXhAgomnSfWaVkL19nV5F
