Remembers the last position where you left insert / visual / replace or any other mode!
This plugins requires SmoothCursor.nvim as this plugin implements the actual functionality.
new.mp4
:Telescope last_positions
Setting a keymap is recommended:
vim.api.nvim_set_keymap("n", "<leader>l", "<Cmd>Telescope last_positions<CR>", { desc = "Open Last Positions" })
This is a telescope.nvim plugin, make sure you have it installed.
- Make sure
SmoothCursor.nvim
is installed and show_last_positions is enabled.
require"smoothcursor".setup {
show_last_positions = "leave" -- or "enter"
}
- Install
Myzel394/telescope-last-positions.nvim
with your favorite plugin manager.
"Myzel394/telescope-last-positions.nvim",
- Load extension
require("telescope").load_extension("last_positions")
Configure the extension like any other Telescope extension. The example below show all available configuration options and their default values.
require("telescope").setup {
extensions = {
last_positions = {
-- What modes should be tracked
whitelisted_modes = { "v", "V", "i", "R" },
-- Maps mode to the icon shown in the preview's indicator
mode_icon_map = {
v = " ",
V = "",
i = "",
R = "",
},
-- Maps mode to the name shown next to the actual filename
mode_name_map = {
v = "Visual",
V = "V·Line",
i = "Insert",
R = "Replace",
}
}
}
}