Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] How to change layer options using init.vim #51

Closed
ViiEx opened this issue Jun 6, 2022 · 2 comments
Closed

[Question] How to change layer options using init.vim #51

ViiEx opened this issue Jun 6, 2022 · 2 comments

Comments

@ViiEx
Copy link

ViiEx commented Jun 6, 2022

I'm trying to configure my spacevim using init.vim instead of init.toml. I was wondering tho how can I set the layers options tho.

For example I wanted to change the shell position to be at the bottom instead at the top. With a little bit of digging into the source code of SpaceVim I tried the following:

call SpaceVim#layers#shell#set_variable(['terminal', 'bottom', 30, 1])

The above function is located at .SpaceVim/autoload/SpaceVim/layers/shell.vim at the line 138

That only resulted on opening the shell at the right side instead of the bottom.

Any ideas on how to change the my shell to open the way I intend it to and how can I set layer options on init.vim ?

@Gabirel
Copy link
Owner

Gabirel commented Jun 6, 2022

Sorry for the late reply.

Here is the solution

Main idea: overwrite the default option manually.

call SpaceVim#layers#load('shell')

" this call function MUST STAY BELOW
" Otherwise, it will get overwritten by `call SpaceVim#layers#load('shell')`
call SpaceVim#layers#load('shell',
    \ {
    \  'default_position' : 'bottom',
    \  'default_height' : 100,
    \ }
    \ )
Check demo

image

I hope this would solve your problem. This solution works for each layer as long as SpaceVim provides that option.

Reference

SpaceVim/SpaceVim#4545 (comment)

Other

I will update your question to Hack-SpaceVim documentation. Thank you for your question.

@ViiEx
Copy link
Author

ViiEx commented Jun 6, 2022

Works perfectly thank you a lot for the quick reply!!!!

@ViiEx ViiEx closed this as completed Jun 6, 2022
Gabirel added a commit that referenced this issue Jun 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants