Skip to content

A must-have configuration for Spacemacs users after defecting to Vim

Notifications You must be signed in to change notification settings

yetone/cosmos-nvim

Repository files navigation

πŸͺ My Neovim Configuration πŸš€

A must-have configuration for Spacemacs users after defecting to Vim

Build Status Build Status

If you want the power of VSCode, the interactivity of Spacemacs, and the text-objects of Vim, I highly recommend you try this configuration.

The leader key is the spacebar.

Each of our shortcut keys has a friendly text description and guide after you press the spacebar, so there is absolutely no need to memorize the shortcut keys, so the spacebar key is the key you can confidently press before everything you want to do.

Key Features

  1. LSP: nvim-lspconfig, lspsaga, lspfuzzy

  2. Spacemacs operating experience:

    a. shortcuts: spacemacs style keyboard shortcuts with which-key,

    b. ivy: Telescope like ivy and helm-swoop

    c. layers: spacemacs layer abstraction

    d. customization: like spacemacs, it can be easily customized by users in particular

    e. etc.

  3. Looking forward to your continued exploration, there are some screenshots

Get A Taste Of

If you're worried about breaking your current vim configuration but want to try it out for yourself, you can use docker to give it a quick try in an isolated environment:

docker run -it -w /root/.config/nvim yetone/cosmos-nvim nvim

Install

1. Requirements

Neovim 0.8+

Only Neovim 0.8 and above are supported, please refer to the official installation documentation of Neovim: Install Neovim

Nerd Fonts

Go to Nerd Fonts homepage to download the patched fonts you are currently using.

Chafa

My configuration use Chafa to render GIF, you can install it by homebrew: brew install chafa

iTerm2 colorscheme [Optional]

If you are using iTerm2 and expect the iTerm colors to blend well with cosmos-nvim colors, it is highly recommended to install and use this colorscheme for iTerm2.

2. Install my configuration

rm -rf ~/.config/nvim.yetone-backup; mv ~/.config/nvim{,.yetone-backup} || true

git clone --depth 1 https://github.com/yetone/cosmos-nvim.git ~/.config/nvim

3. Install your language lsp server in your nvim

For example, if you are writing Python, you can start by opening a Python file and running the following command:

:MasonInstall pyright

And restart nvim.

Custom Configuration

If you want to define your own configuration, you can create a file called .cosmos-nvim.lua in the $HOME root directory (the shortcut is leader - f - e - d), for example:

~/.cosmos-nvim.lua

local cosmos = require('core.cosmos')

return {
  layers = {
    'editor',
    'git',
    {
      'ui',
      enable_beacon = false,
      enable_smooth_scrolling = false,
    },
    {
      'completion',
      tab_complete_copilot_first = false,
    },
  },
  options = {
    -- python3_host_prog = '~/.pyenv/versions/nvim-py3/bin/python',
  },
  before_setup = function()
    -- cosmos.add_plugin('wakatime/vim-wakatime')
  end,
  after_setup = function()
    -- cosmos.add_leader_keymapping('n|aw', { '<cmd>WakaTimeToday<cr>', name = 'WakaTime Today' })
  end,
}

Themes

cosmos-nvim theme colors and highlights are copied from NvChad/base46 project, because NvChad/base46 can't be used alone, so I can only copy the code, please tell me if there is something wrong with this way of using, many thanks to the author siduck! His NvChad neovim distribution is also very impressive!

All available themes are in this directory: lua/layers/ui/themes.

You can preview themes by shortcut leader - t - p, Or directly visit NvChad's themes page to preview the themes:

image

You can switch themes in this way:

Change file ~/.cosmos-nvim.lua(the shortcut is leader - f - e - d)

local cosmos = require('core.cosmos')

return {
  layers = {
    'editor',
    'git',
    {
      'ui',
      theme = 'tokyonight' -- <-- add or modify this option
    },
    'completion',
  },
  -- ...
}

Some Screenshots

Which Key like spacemacs

Fuzzy search commands like spacemacs

Easymotion

Find recent files

The status bar with lsp status

Search current buffer like emacs helm-swoop

List symbols

About

A must-have configuration for Spacemacs users after defecting to Vim

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published

Languages