Giter VIP home page Giter VIP logo

registers.nvim's Introduction

registers.nvim

Show register content when you try to access it in Neovim. Written in Lua.

Warning

This plugin is not maintained actively by me anymore. Any pull requests will still be reviewed and merged but I'm not fixing any bugs or adding features myself. If someone is interested in taking over maintainership please contact me!

Requires Neovim 0.7.0+.

Summary

This plugin adds an interactive and visually pleasing UI for selecting what register item to paste or use next. It offers basic syntax highlighting, a preview, and an equally (if not more) efficient experience using Neovim registers. One simply uses " or CtrlR as one would normally, and then enjoys the benefit of seeing the contents of all filled registers without having to use the :reg command beforehand. It essentially removes an annoying step in using Neovim registers (checking where a specific item is, which register you might have used earlier, etc.), and lets you increase your efficiency while also increasing Neovim’s aesthetic.

Features

  • Non-obtrusive, won't influence your workflow
  • Minimal interface, no visual noise
  • Configurable, there's a setting for almost all aspects of this plugin

Use

The pop-up window showing the registers and their values can be opened in one of the following ways:

  • Call :Registers
  • Press " in normal or visual mode
  • Press CtrlR in insert mode

preview

Empty registers are not shown by default.

Navigate

Use the Up and Down or CtrlP and CtrlN or CtrlJ and CtrlK keys to select the register you want to use and press Enter to apply it, or type the register you want to apply, which is one of the following:

" 09 az : . % # = * + _ /

Example Workflow

With registers.nvim:

  • Copy item to system clipboard or Neovim register (this can also be achieved using registers.nvim);
  • In normal mode, type the " key. The registers.nvim pop-up will appear.
  • You can now use the arrow keys (or other navigation keys) to move to a specific item (representing an item in the Neovim register, i.e., what you see with :reg) in the list being displayed. Pressing enter on this item will ‘select’ it.
  • Alternatively, you can just type the highlighted character being displayed in the left margin of the pop-up, next to the register item you want to select. This resembles a workflow without registers.nvim, except that you get the visual feedback and confirmation of what is inside the register beforehand. It is also useful for remembering which register you placed something in ;) .
    • I.e., type "+ to select from the system clipboard, or use the arrow keys to navigate to + and hit enter)
  • Once you have selected a register item, you can proceed to perform your desired action (e.g., yank, paste, etc.). To do this, simply use the usual keys: y, p, etc.

One can also call the registers.nvim pop-up through other means, not just ". For example, in insert mode, one can use CtrlR (this is default vim behaviour). If one does not want to use these key-binds (or bind your own keys), one can use the :Registers command.

Without registers.nvim:

  • Copy item to system clipboard or vim register;
  • Use the :reg command to view registers. Make sure to remember the Name of the register item you want to use for future reference.
  • In normal mode, type ". You will get no visual feedback.
  • Now type the Name of the register item you want to select, as listed in the output of :reg.
  • Now perform the desired action (usually either yanking, y, or pasting, p)

Using registers.nvim is definitely more aesthetically pleasing and probably makes registers easier for beginners to understand—but is it actually better for experienced Neovim users, too?

Well, users say ;)

I definitely think so. I use registers (and tmux buffers) extensively, and remembering a register’s name that I arbitrarily chose half an hour ago is not always the easiest for me. This means that I usually end up typing ", then realizing that I don’t know what to type next, opening :reg, finding the register I want (usually a quite difficult task), trying to remember its name, typing " again, forgetting the register’s name again, going back to :reg, and finally: typing "<register name>. This costs an excessive amount of time. registers.nvim has solved this problem for me because it previews the contents of a register, removing the need to remember arbitrary register names. In other words, I love the plugin :)

Install

Packer

use {
	"tversteeg/registers.nvim",
	config = function()
		require("registers").setup()
	end,
}

Lazy.nvim

This configuration lazy-loads the plugin only when it’s invoked.

{
	"tversteeg/registers.nvim",
	cmd = "Registers",
	config = true,
	keys = {
		{ "\"",    mode = { "n", "v" } },
		{ "<C-R>", mode = "i" }
	},
	name = "registers",
}

Configuration

This plugin can be configured by passing a table to require("registers").setup({}). Configuration options can be found in Neovim’s documentation after installing with: :h registers.

Default Values

use {
    "tversteeg/registers.nvim",
    config = function()
        local registers = require("registers")
        registers.setup({
        -- Show these registers in the order of the string
        show = "*+\"-/_=#%.0123456789abcdefghijklmnopqrstuvwxyz:",
        -- Show a line at the bottom with registers that aren't filled
        show_empty = true,
        -- Expose the :Registers user command
        register_user_command = true,
        -- Always transfer all selected registers to the system clipboard
        system_clipboard = true,
        -- Don't show whitespace at the begin and end of the register's content
        trim_whitespace = true,
        -- Don't show registers which are exclusively filled with whitespace
        hide_only_whitespace = true,
        -- Show a character next to the register name indicating how the register will be applied
        show_register_types = true,
        bind_keys = {
            -- Show the window when pressing " in normal mode, applying the selected register as part of a motion, which is the default behavior of Neovim
            normal    = registers.show_window({ mode = "motion" }),
            -- Show the window when pressing " in visual mode, applying the selected register as part of a motion, which is the default behavior of Neovim
            visual    = registers.show_window({ mode = "motion" }),
            -- Show the window when pressing <C-R> in insert mode, inserting the selected register, which is the default behavior of Neovim
            insert    = registers.show_window({ mode = "insert" }),

            -- When pressing the key of a register, apply it with a very small delay, which will also highlight the selected register
            registers = registers.apply_register({ delay = 0.1 }),
            -- Immediately apply the selected register line when pressing the return key
            ["<CR>"]  = registers.apply_register(),
            -- Close the registers window when pressing the Esc key
            ["<Esc>"] = registers.close_window(),

            -- Move the cursor in the registers window down when pressing <C-n>
            ["<C-n>"] = registers.move_cursor_down(),
            -- Move the cursor in the registers window up when pressing <C-p>
            ["<C-p>"] = registers.move_cursor_up(),
            -- Move the cursor in the registers window down when pressing <C-j>
            ["<C-j>"] = registers.move_cursor_down(),
            -- Move the cursor in the registers window up when pressing <C-k>
            ["<C-k>"] = registers.move_cursor_up(),
            -- Clear the register of the highlighted line when pressing <DeL>
            ["<Del>"] = registers.clear_highlighted_register(),
            -- Clear the register of the highlighted line when pressing <BS>
            ["<BS>"]  = registers.clear_highlighted_register(),
        },
        events = {
            -- When a register line is highlighted, show a preview in the main buffer with how the register will be applied, but only if the register will be inserted or pasted
            on_register_highlighted = registers.preview_highlighted_register({ if_mode = { "insert", "paste" } }),
        },
        symbols = {
            -- Show a special character for line breaks
            newline = "",
            -- Show space characters without changes
            space = " ",
            -- Show a special character for tabs
            tab = "·",
            -- The character to show when a register will be applied in a char-wise fashion
            register_type_charwise = "",
            -- The character to show when a register will be applied in a line-wise fashion
            register_type_linewise = "ˡ",
            -- The character to show when a register will be applied in a block-wise fashion
            register_type_blockwise = "",
        },
        window = {
            -- The window can't be wider than 100 characters
            max_width = 100,
            -- Show a small highlight in the sign column for the line the cursor is on
            highlight_cursorline = true,
            -- Don't draw a border around the registers window
            border = "none",
            -- Apply a tiny bit of transparency to the the window, letting some characters behind it bleed through
            transparency = 10,
        },
        -- Highlight the sign registers as regular Neovim highlights
        sign_highlights = {
            cursorlinesign = "CursorLine",
            signcolumn = "SignColumn",
            cursorline = "Visual",
            selection = "Constant",
            default = "Function",
            unnamed = "Statement",
            read_only = "Type",
            expression = "Exception",
            black_hole = "Error",
            alternate_buffer = "Operator",
            last_search = "Tag",
            delete = "Special",
            yank = "Delimiter",
            history = "Number",
            named = "Todo",
        },
        })
    end,
}

registers.nvim's People

Contributors

actions-user avatar austinliuigi avatar dharmx avatar frandsoh avatar frederick888 avatar gotalovefiracode avatar gravndal avatar hanspinckaers avatar hexium310 avatar imgbotapp avatar kyran-c avatar mvargasmoran avatar qibaobin avatar renovate[bot] avatar triarius avatar ttytm avatar tversteeg avatar weihanglo avatar yodaembedding avatar yutkat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

registers.nvim's Issues

Cannot visualise current line if window is too large

Firstly thanks for making this. I really like peekabo and I really like your re-imagining of this functionality and the plan for it to be unobtrusive.

I just downloaded it and noticed something. When I have a lot of registers populated the window opened is quite large and moves the cursor several rows up covering up my current line

image

It makes it harder to know what I actually meant to get out of the register since I can no longer see the line I opened it from. The examples in your README show a less populated registers buffer so it stays below the cursor line. I wonder if it'd be possible to calculate how much space there was above or below and open it where there is more space although since technically you can have 26+9+x registers it might be better to truncate at a certain point and add the ability to scroll the window.

Option to stop showing fed keys?

What would you like registers.nvim to be able to do?

In normal mode, e.g. "ap, it currently prints out "a in command output:

vim.api.nvim_err_writeln(keys)

I think it'd be nice to provide an option to disable this. It especially doesn't play well with set cmdheight=0.

If you have any ideas on how this should be implemented, please tell us here.

If not really needed, perhaps we can even just remove this line?

Is this a feature you are interested in implementing yourself?

Yes

Feature request: paste in normal mode only when selecting with enter

let g:registers_paste_in_normal_mode = 1 lets you paste in normal mode but it always paste, if "a is pressed its pasting the content of "a.
I want an option that let you use copy registers as normal but still let you browse the registers and paste them if you want.

The option can be selected with let g:registers_paste_in_normal_mode = 2

String cannot contain newlines

Please select which platform you are using.

Linux

Was this something which used to work for you, and then stopped?

I never saw this working

Describe the bug

with the latest code

E5108: Error executing lua ...pack/home-manager/start/registers.nvim/lua/registers.lua:187: String cannot contain newlines                                                                                                                                                                                                      
stack traceback:                                                                                                                                                                                                                                                                                                                
        [C]: in function 'nvim_buf_set_lines'                                                                                                                                                                                                                                                                                   
        ...pack/home-manager/start/registers.nvim/lua/registers.lua:187: in function 'update_view'                                                                                                                                                                                                                              
        ...pack/home-manager/start/registers.nvim/lua/registers.lua:380: in function 'registers'        

and neovim 0.7-dev (012c055804876346a3ef5c1d0cdb8e0a7ee58481) but it has been failing ever since I've installed this plugin a few months ago I think.

clipboard error "target STRING not available"

First of all, thanks for this simple and useful nvim plugin! Super useful 👍

When I copy an image to the clipboard (e.g. my avatar while writing this issue on github), registers.nvim break outputting this error:

E5108: Error executing lua ...os/github.com/tversteeg/registers.nvim/lua/registers.lua:81: Vim:clipboard: provider returned invalid data

`<C-r>` doesn't show popup after inserting a space

Steps to reproduce:

  1. Enter insert mode
  2. Type a space
  3. Press <C-r>

This should show the registers popup window, but in this situation, it seems to fall back to the default <C-r> behavior.

I'm using the default config, apart from this option (which I imagine doesn't make a difference):

vim.g.registers_window_border = "single"

It breaks with multi column selection

Please select which platform you are using.

Mac

Was this something which used to work for you, and then stopped?

I never saw this working

Describe the bug

First of all, thanks for this plugin.

In visual mode, with some columns selected, pasting from registers to replace the selected content does not work.

selection (before applying some register to replace the selected content):
image

"0p without this plugin (how it is supposed to work):
image

"0p with this plugin:
image

visual map not work in quickfix or floaterm window

Hi, here is my experience with visual map in quickfix or floaterm window that I feel not right.

vimrc

if empty(glob('~/.config/nvim/autoload/plug.vim'))
    silent execute '!curl -fLo '.s:home.'/autoload/plug.vim --create-dirs  https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
    autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif

call plug#begin('~/.config/nvim/bundle/pkgs/')

Plug 'tversteeg/registers.nvim'

call plug#end()

filetype plugin on
filetype indent on

reproduce

  1. vim open a file
  2. :grep something in a file
  3. :copen
  4. visually select a line then "+
  5. after hitting + the cursor jump to editing file from quickfix window.

some problem happen from a floaterm window, it go the insert mode instead yank the text

env

I test with nvim-0.7.0 but it should also reproduce with nvim 0.6

Popup stays open on focus lost

If I open the popup with " in normal mode and were to click on the underlying buffer, the popup stays open. The next time i press " again, a new one is created and this can be repeated ad infinitum.

The first time I accidentally ran into it, any keypress would throw me an invalid window id error so there wasn't even a way to get away from it.

Maybe the popup should be closed when the user clicked (unusual with vim, I know) somewhere outside the popup, or at least check that there is at most one popup open?

For illustrative purposes:

registers

It breaks the dot command

After pasting from a register, the dot command does not work as expected.

I made a video to show the problem, I hope you can get the problem with it.

Screen.Recording.2021-05-21.at.08.38.43.mov

Thank you.

EDIT: typo in the video. The result of the dot command is expected to be { foo, but with this plugin: {.

Feature request: Support command-line/ex modes

Thanks for this great plugin first of all. I had been using vim-peekaboo which is no longer being maintained and has got glitches from time to time, switching to this plugin saved me from this pain.

Back to the feature request, I'm wondering if comand-line/ex modes can be supported as well? For example after : & Ctrl-R, it'd be nice to see the pop-up as well.

registers.nvim conflicts with use of <C-R> in iabbrev RHS

Please select which platform you are using.

No response

Was this something which used to work for you, and then stopped?

I never saw this working

Describe the bug

To recreate:

  • Install and configure registers.nvim
  • Add an abbrevation to init.vim or similar iabbrev XYZ <C-R>=2*3<CR>
  • Open an empty file, type XYZ . NeoVim shows an error about a recursive mapping

I suspect this is because registers.nvim captures <C-R> somehow.

Feature Request: delay pop-up

registers.nvim looks great and I would look forward to using it as a replacement for https://github.com/junegunn/vim-peekaboo.

However, one thing that blocks me from doing that is a delay in the pop-up. Probably 75% of the time I know which registers I want and the pop-up is just a distraction. It would nice if I could configure a delay (e.g. 500ms) before the pop-up appears, which allows me to see the registers only if I pause for a moment's indecision.

Great work though, looks great so far!

Vim 0.8 Error E5113: Error while calling lua chunk

Please select which platform you are using.

Mac

Was this something which used to work for you, and then stopped?

It used to work, and then stopped

Describe the bug

Since the update to Neovim 0.8 I have been getting the following error:

Error detected while processing /Users/claus/.local/share/nvim/plugged/registers.nvim/plugin/registers.lua:
E5113: Error while calling lua chunk: vim/shared.lua:0: key found in more than one map: symbols
stack traceback:
        [C]: in function 'error'
        vim/shared.lua: in function 'tbl_extend'
        ...l/share/nvim/plugged/registers.nvim/plugin/registers.lua:67: in main chunk
Press ENTER or type command to continue

A cursory search on E5113 indicates that this might be a Homebrew issue (I do have Neovim installed via Homebrew). Got any ideas?

Error when invoking Registers at the end of file.

After opening a file in nvim I do a GG to paste something in the bottom of the file then :Registers and get this error:

E5108: Error executing lua ...os/.config/nvim/plugged/registers.nvim/lua/registers.lua:161: 'height' key must be a positive
 Integer
Press ENTER or type command to continue

Guess it's just that it doesn't fit within the screen.

image

Output is incorrect when using <Ctrl-R>

Hey 👋🏼,

Cheers for creating this plugin. 🍻

I noted a somewhat nasty bug today when trying to do a lot of color replacements. I yank a color with ye and when move the cursor to the beginning of the color I want to replace and run ce<c-r>0. The yanked color is pasted but not at the correct stop. See attached gif.

Peek 2021-05-20 08-43

"Clipboard: no provider" error message when used on headless hosts

When using this awesome plugin on a headless machine that's not running X11 or wayland (or any clipboard proxying SSH magic), the following error message is displayed by neovim (version 0.6.1) when opening the registers.nvim UI:

clipboard: No provider. Try ":checkhealth" or ":h clipboard".
clipboard: No provider. Try ":checkhealth" or ":h clipboard".
Press ENTER or type command to continue

Nothing in my configuration sets the clipboard, but it seems to be upset that an X11/wayland clipboard tool is not available. Ideally, the plugin should continue without warning and use the neovim internal clipboard

Steps to reproduce:

  1. Create a chroot or VM and install latest nvim
  2. Add registers.vnim to config
  3. Try to open registers panel without installing X11 or wayland

Let me know if there is anything else I can do to help with this. Thanks!

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

github-actions
.github/workflows/ci.yml
  • actions/checkout v3
  • dineshsonachalam/markdown-autodocs v1.0.7
  • stefanzweifel/git-auto-commit-action v4

  • Check this box to trigger a request for Renovate to run again on this repository

It's not working with coc.nvim

Hi, thanks for the plugin!

If I use this plugin and coc.nvim, and try to show register content, I get the following error.

E5108: Error executing lua .../site/pack/packer/start/registers.nvim/lua/registers.lua:81: Vim
(call):E785: complete() can only be used in Insert mode

Minimum configuration

local packer_exists = pcall(vim.cmd, [[packadd packer.nvim]])

vim.g.node_host_prog = "NODE_PATH"
vim.g.python3_host_prog = "PYTHON3_PATH"

return require('packer').startup(function()
  use {'wbthomason/packer.nvim', opt = true}
  use "tversteeg/registers.nvim"
  use {
    'neoclide/coc.nvim',
    run = 'yarn install --frozen-lockfile',
    config = function()
      vim.cmd("let g:coc_global_extensions = ['coc-tsserver']")
    end
  }
end)
2021-03-19.13-58-47.mp4

Colon register not available

Hi, and thanks for a wonderful plugin that actually makes me take advantage of the registers!

At the moment, it seems there is no way to access the colon register while using the plugin. Is there a way around this?

registers.nvim inserts extra whitespace when pasting

Recreation instructions:

  1. Install registers.nvim, set:
let g:registers_show_empty_registers=0
let g:registers_hide_only_whitespace=1
let g:registers_delay=500
  1. Create a file contained some indented and non-indented text, e.g.
if x > y then:
    x = 3
endif
  1. Yank the paragraph of text with yip.
  2. Press p to paste a copy, note that it is pasted correctly.
  3. Enter insert mode, press Ctrl-R, wait 500 ms to see the menu. Then press 0. Note that the text that's inserted has a 'staircase' effect of extra leading whitespace:
if x > y then:
        x = 3
    endif

Keymappings are not set if file is opened by ":edit …" or Telescope.

Thanks in advance.

I was having issues related to Issue 40 that you fixed in yesterday's update. I have updated, but I'm now having a strange problem where the keymappings aren't set for any file opened after nvim has started. So if I open a file from the command line > nvim /path/to/file, there are no problems. But if I cold-start nvim and then either :edit /path/to/file or open by Telescope, the keymappings aren't set.

I noticed that in the updated release you also made changes to the way the keymappings are run. Is that possibly the origin of the problem?

Some details:

I'm using packer and I don't do anything fancy for loading:

  use 'tversteeg/registers.nvim'

If I open a file from the command line, there are no problems. But when I open nvim from my project directory and use telescope to find and open a file, or :e /path/to/file, the keybindings aren't set, but the plugin seems to be loaded. I can run :Registers and get the popup window, or even

:lua require'reigsters'.registers()

But the behaviour with " (in V or N mode) or <C-r> (in I mode) is as plain nvim.

Let me know if I can help.

NVIM v0.6.0-dev
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/cc -g -O2 -fdebug-prefix-map=/build/neovim-gauiiQ/neovim-0.6.0~ubuntu1+git202109271150-96614f84a-adeb5640f=. -fstack-protector-strong -Wformat -Werror=format-security -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_TS_HAS_SET_MATCH_LIMIT -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/build/neovim-gauiiQ/neovim-0.6.0~ubuntu1+git202109271150-96614f84a-adeb5640f/build/config -I/build/neovim-gauiiQ/neovim-0.6.0~ubuntu1+git202109271150-96614f84a-adeb5640f/src -I/build/neovim-gauiiQ/neovim-0.6.0~ubuntu1+git202109271150-96614f84a-adeb5640f/.deps/usr/include -I/usr/include -I/build/neovim-gauiiQ/neovim-0.6.0~ubuntu1+git202109271150-96614f84a-adeb5640f/build/src/nvim/auto -I/build/neovim-gauiiQ/neovim-0.6.0~ubuntu1+git202109271150-96614f84a-adeb5640f/build/include
Compiled by buildd@lgw01-amd64-024

Features: +acl +iconv +tui
See ":help feature-compile"

Some things I've tried:

  • $> nvim foo.txt vs $> nvim then :e foo.txt. Keybindings are no loaded in the latter case.
  • I tried using packer to load the package on keypress as in Issue 41. It made no difference.
  • This is strange. If I open a file so that the mappings aren't loaded, and then I manually source registers.vim (where the mappings are set), then nothing happens. (The neovim instance isn't fixed.)

registers.nvim breaks iabbrev commands with <C-R>

I have an iabbrev like this:

iabbrev DATE <C-R>=strftime("%F")<CR>

It inserts the date when I type DATE. With https://github.com/junegunn/vim-peekaboo, this works. However, with registers.nvim, this abbrevation breaks; when I press space after DATE, I go to the command line with just = shown.

My registers.nvim configuration is:

let g:registers_show_empty_registers=0
let g:registers_hide_only_whitespace=1
let g:registers_delay=500

The option g:registers_window_border does not work.

It seems that I can not change the border of floating window via this option.

minimal init.vim:

set runtimepath+=/home/haojiedong/.local/share/nvim/site/pack/packer/start/registers.nvim
" double does not work neither
let g:registers_window_border = "single"

nvim -u init.vim

If we press " in normal mode, the floating window still does not have a nice single line border.

  • nvim version: 0.5.0
  • OS: Linux CentOS 7.4

Feature request: option to define what registers to show

Thanks for making this pluguin, works great.

One thing I'm missing is the ability to filter the type of registers that I want to see. I generally only want to check the selection and numbered registers and it is distracting to see all of them. Could we have an option to pass a list of the types of registers to show?

Visual mode yank to register broken?

I am trying to figure out if I am doing something wrong. My normal workflow is to visually highlight something, then hit "ay to grab it. When I hit "a using the plugin, it pastes the a register on top of what I am trying to yank into that same a register. I saw this issue but no detail: #4 Let me know if I am doing silly or missing something, thanks.

mini.vim I used to test this:

set nocompatible
filetype plugin indent on
syntax on
set hidden

call plug#begin('~/.config/nvim/plugged')

Plug 'tversteeg/registers.nvim', { 'branch': 'main' }
let g:registers_window_border = "double" "'none' by default, can be 'none', 'single','double', 'rounded', 'solid', or 'shadow'
let g:registers_show_empty_registers = 0 "1 by default, an additional line with the registers without content

call plug#end()

Unable to paste from `"` in insert mode using `<C-R>`

Please select which platform you are using

Mac

Was this something which used to work for you, and then stopped?

I never saw this working

Describe the bug

In ctrl-r mode, when trying to insert from " register, the following error happens:

image

Thanks for the plugin, btw.

Neovim version

NVIM v0.8.0
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by [email protected]

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/opt/homebrew/Cellar/neovim/0.8.0/share/nvim"

Run :checkhealth for more info

Setup

local registers = require("registers")
registers.setup({
	register_user_command = false,
	system_clipboard = false,
	show_register_types = false,
	show_empty = false,
	bind_keys = {
		return_key = false,
		ctrl_n = false,
		ctrl_p = false,
		ctrl_j = false,
		ctrl_k = false,
	},
	window = {
		highlight_cursorline = false,
		border = "rounded",
	},
})

Loading async with keys using packer

👋🏼

I just noted today that this plugin wasn't working any more for me. I have it setup with the following packer settings:

use({ -- Interactive registers.
    'tversteeg/registers.nvim',
    keys = {{'i', '<c-r>'}, {'n', '"'}, {'v', '"'}},
})

This previously worked fine and loaded registers.nvim when I triggered one of the keys. This is no longer working - likely due to recent changes.

Text garbled when using the plugin

Before anything I want to mention I love this plugin. Thanks for creating it!

I have a weird issue and I am not sure how to even begin debugging it. When using the plugin my text gets pushed around and... garbled? This doesn't happen when pasting from a register directly which is weird. Any advice?

Here's a GIF that'll hopefully make it clearer, I am having a hard time describing it accurately.

registers

The popup windows only show a small part

Please select which platform you are using.

Mac

Was this something which used to work for you, and then stopped?

I never saw this working

Describe the bug

so the popup window always starts from the current line where the cursor is at?
If the cursor is at the bottom, then the popup window only shows a small part of it. Is there any option to config where to display the popup window?
CleanShot 2022-05-08 at 00 11 13@2x

registers.nvim conflicts with telescope.nvim

This is reporting work-around.

i_<C-R> is default map to call registers.
So when we put i_<C-R> to call registers from telescope.nvim prompt, this plugin kills the window of telescope.nvim.

In such case, we should suppress imap <C-R> and set new map like this:

vim.g.registers_insert_mode = false -- Suppress imap <C-R>
vim.cmd([[
    imap <buffer> <expr> <C-R> &ft=='TelescopePrompt' ? '<C-R>' : registers#peek('<C-R>')
]])

Could you put this guide on your README.md?

Support Ctrl-R in command line mode

What would you like registers.nvim to be able to do?

When in command-line mode (:), Ctrl-R pastes a register in. However, unlike in insert mode, registers.nvim doesn't pop up a window in this case. It would be nice if it did.

Thanks for all your hard work on this plugin!

If you have any ideas on how this should be implemented, please tell us here.

Sorry, not that familiar with the internals...

Is this a feature you are interested in implementing yourself?

Maybe

Option to change floating window background color

Currently, the background color of floating window is hardly discernable from the main window background color, making it difficult to know the boundary between them. It would be great to give the user a choice to change the background highlight of this floating window.

pmenu does not conform to list of registers

Firstly, thank you for this plugin! I use the registers a fair bit and this is useful for me!

The issue:
What:

  • The popup window does not conform to the list of registers in it for me. I fully appreciate that this may not be an issue with the plugin and that I may be missing a configuration somewhere.

image

Feature request: hide the window after the action key is pressed

Hello, I have switched to this from peekaboo and I have to say the floating window is far superior to peekaboo's janky splits. The only difference is that peekaboo highlights the register after choosing it and closes only when the "action" key (sey p for paste) is pressed. This makes me not-forget which register I am using and it would be great to have an option for that here.

Here is exactly what I mean:

  1. After " is pressed the window pops up as it does now.
  2. A register key is pressed, say a. This moves the cursor to highlight register a and the window does not close. If the register is selected "manually" (with <C-j>/<C-k> or arrow keys and confirmed with <CR>) the window also stays open, waiting for the "action" key.
  3. An "action" key is pressed, say p. The window closes and the register contents are pasted into the working buffer.

This could be a separate option, say vim.g.registers_close_after_select, defaulting to 1 (the current behavior). There could also be a separate highlight group, say RegistersSelected to further emphasize the selected register before p is pressed (if you are feeling fancy).

Thanks again for making this plugin, it's making my life much easier!

It's not working in visual block

Hi, thanks for the plugin.

I've been waiting a time for some to replace vim-peekaboo since it does not work with nvim property.

Whenever I try to select a visual block and paste something from a register, I have a problem. To simulate, just try to paste in visual block mode with the plugin.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.