Skip to content
This repository has been archived by the owner on Apr 16, 2024. It is now read-only.

mapping problem with commandline and search / #76

Closed
molleweide opened this issue Jul 28, 2021 · 11 comments
Closed

mapping problem with commandline and search / #76

molleweide opened this issue Jul 28, 2021 · 11 comments
Milestone

Comments

@molleweide
Copy link
Contributor

molleweide commented Jul 28, 2021

Hi again,

I try this binding

	    {'n', ';', ':'},

and it does work but the command line is not being shown upon pressing ; now.

  1.    press `;`     ->    shows nothing
    
  2.    press `h`     ->    shows `:h`
    

so the command works but it just doesn't show on the first key press / or initial ;.

Does this only happen to me?

And it is the same with / search commands also.
If I press / nothing shows but I know that the command works under the hood.

@NTBBloodbath
Copy link
Collaborator

Hey, that's because Doom sets the silent option for the mappings, maybe we should make it optional :)

@NTBBloodbath NTBBloodbath added this to the 3.1.0 milestone Jul 28, 2021
@molleweide
Copy link
Contributor Author

Aaha that makes sense then

@molleweide
Copy link
Contributor Author

molleweide commented Jul 29, 2021

Can i pass a fourth arg table with silent=false or does this have to be modified inside of doom core first?

@NTBBloodbath
Copy link
Collaborator

NTBBloodbath commented Jul 29, 2021

Hi, you will need to do it yourself at the moment, but I'll implement it in a very near future!

You will need to modify this lua/doom/core/functions/init.lua block a bit, basically removing the opts variable and doing a conditional assignment. So it should look like this:

elseif scope == 'mappings' then
	for _, map in ipairs(settings_tbl) do
		-- scope, lhs, rhs, options
		utils.map(map[1], map[2], map[3], map[4] and map[4] or {})
	end

and you will be able to pass your custom options for your mappings (see :h map-arguments and :h nvim_set_keymap() to know the valid options).

Side note: the map() function automatically sets the noremap argument and that's gonna be changed in the future too if needed.

@molleweide
Copy link
Contributor Author

Hey, that's because Doom sets the silent option for the mappings, maybe we should make it optional :)

yes I think that would be a great idea. another example that doesn't work also is for using the 'map' keyword
instead of 'n' or 'v'.

Hi, you will need to do it yourself at the moment, but I'll implement it in a very near future!

You will need to modify this lua/doom/core/functions/init.lua block a bit, basically removing the opts variable and doing a conditional assignment. So it should look like this:

elseif scope == 'mappings' then
	for _, map in ipairs(settings_tbl) do
		-- scope, lhs, rhs, options
		utils.map(map[1], map[2], map[3], map[4] and map[4] or {})
	end

and you will be able to pass your custom options for your mappings (see :h map-arguments and :h nvim_set_keymap() to know the valid options).

Side note: the map() function automatically sets the noremap argument and that's gonna be changed in the future too if needed.

Thanks man for the direction! I will try to get it to work. brb!!

@NTBBloodbath
Copy link
Collaborator

Hey, that's because Doom sets the silent option for the mappings, maybe we should make it optional :)

yes I think that would be a great idea. another example that doesn't work also is for using the 'map' keyword
instead of 'n' or 'v'.

Do you mean nmap and these stuff? If that's the case then it's not possible, the Lua api for the keybindings only takes the keybind mode and if the noremap option was not passed then the mapping is automatically set to <mode>map. You can take a look at :h nvim_set_keymap().

Hi, you will need to do it yourself at the moment, but I'll implement it in a very near future!
You will need to modify this lua/doom/core/functions/init.lua block a bit, basically removing the opts variable and doing a conditional assignment. So it should look like this:

elseif scope == 'mappings' then
	for _, map in ipairs(settings_tbl) do
		-- scope, lhs, rhs, options
		utils.map(map[1], map[2], map[3], map[4] and map[4] or {})
	end

and you will be able to pass your custom options for your mappings (see :h map-arguments and :h nvim_set_keymap() to know the valid options).
Side note: the map() function automatically sets the noremap argument and that's gonna be changed in the future too if needed.

Thanks man for the direction! I will try to get it to work. brb!!

No problem, glad to help. Hope it works for you! :)

@molleweide
Copy link
Contributor Author

Allright cool I am going to read the nvim api docs and make sure i understand.

@molleweide
Copy link
Contributor Author

hey are you thinking about including nvim-mapper into doom for key mappings?

@NTBBloodbath
Copy link
Collaborator

@molleweide Hey, yeah and it's already implemented in the development branch :)

@molleweide
Copy link
Contributor Author

very nice! i have to check out the develp branch.

@NTBBloodbath
Copy link
Collaborator

I'll be closing this because the feature was already implemented in the development version so I can have a better track of the next version milestone 🙂

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants