4coder»Forums
Jeremiah Goerdt
209 posts / 2 projects
Programmer, Linux apologist, and not-so-wiseman.
[Help Request] - Switching "Modes" on Startup
I've setup my 4coder to be modal, similar to vim. When starting a fresh instance of 4coder, I'd like to be in normal mode instead of insert mode. The custom command below is what I use to switch into normal mode while I'm editing.

1
2
3
4
5
uint32_t access = AccessAll;
View_Summary view = get_active_view(app, access);
Buffer_Summary buffer = get_buffer(app, view.buffer_id, access);

switch_keymap(app, normal_map);


I assumed I could simply call this command within the my_start HOOK, but it doesn't work. Any pointers on how to switch keymaps on startup?
Allen Webster
473 posts / 4 projects
Heyo
[Help Request] - Switching "Modes" on Startup
It depends entirely on how you're trying to implement maps. If you're using the built in map system then you want to make sure that every buffer that get's created at start up will set it's map.
Jeremiah Goerdt
209 posts / 2 projects
Programmer, Linux apologist, and not-so-wiseman.
[Help Request] - Switching "Modes" on Startup
Aha, I didn't realize I needed to tell the buffer to switch maps. That fixed my problem.