Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

darkmage
darkmage

Posted on

     

Getting Started with SpaceVim

Getting started with Spacevim

A friend of the channel (https://twitch.tv/darkmage666) recently suggested I check out Spacevim. Being a veteran of vim now for over 10 years, it might be time to play around with my setup, provided I have the patience to overcome small nuances and differences in the workflow.

To get started,install Spacevim:

curl -sLf https://spacevim.org/install.sh | bash
Enter fullscreen modeExit fullscreen mode

Then run either vim or nvim.

vimnvim
Enter fullscreen modeExit fullscreen mode

Touninstall Spacevim:

curl -sLf https://spacevim.org/install.sh | bash -s -- --uninstall
Enter fullscreen modeExit fullscreen mode

I wanted my Spacevim start to be relatively pain-free but basic navigation and things I had setup in my original .vimrc did not work out-of-the-box. Specifically, three big issues:

  1. The left-hand keybindings I'd written in my .vimrc were not migrated over.
  2. Attempting to run a python3 curses program inside of nvim results in an error.
  3. Page up and down is some odd 'smooth scrolling' thing.

I solved #2 by using 'vim' with Spacevim instead of nvim, so that was easy.

To solve #3, navigate to~/.SpaceVim.d/init.toml and add this to the bottom:

[[layers]]name = 'core'enable_smooth_scrolling = false
Enter fullscreen modeExit fullscreen mode

For #1, I added the following to the same file,~/.SpaceVim.d/init.toml, in the[options] section:

bootstrap_before = "myspacevim#before"bootstrap_after = "myspacevim#after"
Enter fullscreen modeExit fullscreen mode

Then, I created a folder and file at:~/.SpaceVim.d/autoload/myspacevim.vim and put the following in it:

function! myspacevim#before() abort" Map Right Hand Directionals to Left Hand Commandsnoremap s hnoremap d knoremap f jnoremap g l" Map Left Hand Commands to Right Hand Directionalsnoremap h snoremap k dnoremap j fnoremap l gendfunctionfunction! myspacevim#after() abortendfunction
Enter fullscreen modeExit fullscreen mode

Now I think I am ready to learn some Spacevim! There are a lot of differences with the original Vim, and replicating my user experience (or improving on it) is going to take some time. I really like how it looks out-of-the-box in general, but maybe there's one more tweak I can make before I really get jamming.

To disable "relative line-numbering", I added the following to the same file,~/.SpaceVim.d/init.toml, in the[options] section:

relativenumber = false
Enter fullscreen modeExit fullscreen mode

Now we are cooking with GAS!!! :D

If you enjoyed this blog post, please consider subscribing to myPatreon for $5 a month for access to un-DMCA'd programming videos. I've been developing a text-based roguelike RPG in Python over the last couple months and would love your support. You can watch me live on Twitch at times through the week as well.

Head on over to my linktree athttps://linktr.ee/evildojo for access to all of my social media information, including Github.

If you want a Free $100 VPS credit, head on over tohttps://www.vultr.com/?ref=8973037-8H for $100 free to try out Vultr's Virtual Private Servers and play with SpaceVim yourself :D

Thank you and have a great 2022!

Top comments(1)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss
CollapseExpand
 
johnpiers profile image
John Piers Cilliers
The name is Piers, I'm 66 years old. Just interested in all things Linux. Been using Arch Linux since 2006, still a noob and learning something new about it on a daily basis.
  • Location
    Somerset West, Cape Town, South Africa
  • Work
    Self-employed. Computer Related. Point-of-sale installations & hardware. at Afridyne Systems
  • Joined

I had already populated my init.toml file as I wanted it, but was struggling to get this to work:
bootstrap_before = "myspacevim#before
bootstrap_after = "myspacevim#after
I followed you instructions and created a folder and file at:~/.SpaceVim.d/autoload/myspacevim.vim
And voilà, everything working!

Cheers. Thank you very much.
Piers

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

Computer Science Tutor, Programmer, Gamedev, Hacker, Bug Bounty Hunter
  • Location
    Texas
  • Education
    Bachelor's Degree
  • Work
    Computer Science Mentor at Freelance
  • Joined

More fromdarkmage

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp