Setup Neovim and LazyVim

I. Install Neovim




II. Install LazyVim

  • Follow the instructions to install LazyVim: https://www.lazyvim.org/installation
  • Install fd, ripgrep, fzf, lazygit:
    • Mac OS:
      brew install fd ripgrep fzf lazygit
    • Linux:
      apt install fd-find ripgrep fzf lazygit



III. Configuration

  • Install toggleterm.nvim. Create file: ~/.config/nvim/lua/plugins/toggleterm.lua:
    -- ~/.config/nvim/lua/plugins/toggleterm.lua
    return {
      {
        "akinsho/toggleterm.nvim",
        tag = "2.4.0",
        keys = {
          { "<leader>th", "<cmd>ToggleTerm size=15 direction=horizontal<cr>", desc = "Open a horizontal terminal" },
          { "<leader>tt", "<cmd>ToggleTerm<cr>", desc = "Toggle terminal" },
          { "<F7>", "<cmd>ToggleTerm<cr>", desc = "Toggle terminal" },
          { "<F7>", "<cmd>ToggleTerm<cr>", mode= "t", desc = "Toggle terminal" },
        },
        opts = {
          --[[ things you want to change go here]]
        },
      },
    }
  • Set options in ~/.config/nvim/lua/config/options.lua:
    -- ~/.config/nvim/lua/config/options.lua
    vim.opt.relativenumber = false -- Relative line numbers
    vim.opt.shiftwidth = 4 -- Size of an indent
    vim.opt.tabstop = 4 -- Number of spaces tabs count for
    
  • Install nightfox colorscheme. Create file: ~/.config/nvim/lua/plugins/colorscheme.lua:
    -- ~/.config/nvim/lua/plugins/colorscheme.lua
    return {
      -- add nightfox colorscheme
      { "EdenEast/nightfox.nvim" },
    
      -- Configure LazyVim to load nightfox
      {
        "LazyVim/LazyVim",
        opts = {
          colorscheme = "carbonfox",
        },
      }
    }



See also

No comments:

Post a Comment