Giter Site home page Giter Site logo

Comments (10)

molleweide avatar molleweide commented on August 21, 2024 1

thanks for replying again!

i will try your suggestion and get back.

from doom-nvim.

molleweide avatar molleweide commented on August 21, 2024 1

yes then it works! i will add some jumpkeys and make a pr.

from doom-nvim.

molleweide avatar molleweide commented on August 21, 2024 1

wow thanks I will try this and report back

from doom-nvim.

molleweide avatar molleweide commented on August 21, 2024

also, how does one reload the config?? I am really starting to like doom

from doom-nvim.

NTBBloodbath avatar NTBBloodbath commented on August 21, 2024

Hmm maybe it's because of which-key plugin? Let's try modifying the lua/doom/modules/config/doom-whichkey.lua and adding a jump category, hope it works.

from doom-nvim.

NTBBloodbath avatar NTBBloodbath commented on August 21, 2024

also, how does one reload the config?? I am really starting to like doom

Doom will automatically reload its modules (e.g. keybindings, custom options) and the plugins configurations too (by running :PackerCompile when a config/doom-X.lua had changes) :)

from doom-nvim.

molleweide avatar molleweide commented on August 21, 2024

Hmm maybe it's because of which-key plugin? Let's try modifying the lua/doom/modules/config/doom-whichkey.lua and adding a jump category, hope it works.

Oh now i think i understand what you mean! Do you mean that maybe which-key is "blocking" leader key maps that fall outside of the specified tree in the config. This means that I have to duplicate all my maps in there also basically.

from doom-nvim.

molleweide avatar molleweide commented on August 21, 2024

also, how does one reload the config?? I am really starting to like doom

Doom will automatically reload its modules (e.g. keybindings, custom options) and the plugins configurations too (by running :PackerCompile when a config/doom-X.lua had changes) :)

I realize that forgot to mention more specifically how do I relead custom keybindings?
Would I need a special command for this? Because commands like so $MYVIMRC doesn't work here right?
Currently I am restarting vim every time to refresh mappings.

from doom-nvim.

NTBBloodbath avatar NTBBloodbath commented on August 21, 2024

Hmm live-reloading in Lua is a bit more complex because of the require functions.

Basically there's a Lua table called package.loaded that contains all the Lua modules loaded, so by example you can do package.loaded["doom.core"] = nil to "unload" the Doom core module, and then require it again but this doesn't do the trick for this case.

At the moment you can write something like that in a custom function in your doom_config.lua:

functions = {
    reload_custom_settings = function()
		-- Our handler for the user-defined settings
		local load_custom_settings = require("doom.core.functions").load_custom_settings
		-- Get the user-defined settings, the 'nvim' field in our 'doom_config.lua'
		local custom_settings = require("doom.core.config").load_config().nvim

		-- Iterate over all the custom settings fields, e.g. global_variables, mappings, etc.
		for field, _ in pairs(custom_settings) do
			-- Load the custom settings again (reload them).
			-- This function takes two parameters, the options list and the options scope, e.g. mappings
			load_custom_settings(custom_settings[field], field)
		end
	end,
},

And lately in your mappings field in the same file, you could set a mapping for this function:

mappings = {
	{ "n", "rc", "<cmd>lua require('doom.core.config').load_config().nvim.functions.reload_custom_settings()<CR>" },
},

from doom-nvim.

NTBBloodbath avatar NTBBloodbath commented on August 21, 2024

Sure, also in case that it doesn't work you can try commenting these lines locally because the custom functions are being called on launch and maybe this one can cause some issues.

And what I just said gave me an idea to improve doom's extensibility, I'll be implementing it this week :)

from doom-nvim.

Related Issues (20)

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.