Skip to content

Instantly share code, notes, and snippets.

@gourab5139014
Created July 8, 2024 16:40
Show Gist options
  • Save gourab5139014/7aad51d272bbf5a0edb9489674b07f2c to your computer and use it in GitHub Desktop.
Save gourab5139014/7aad51d272bbf5a0edb9489674b07f2c to your computer and use it in GitHub Desktop.
Backup on new NVIM
vim.cmd("set expandtab")
vim.cmd("set tabstop=4")
vim.cmd("set softtabstop=4")
vim.cmd("set shiftwidth=4")
vim.g.mapleader=" "
vim.cmd("set number")
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)
local plugins = {
{ "catppuccin/nvim", name = "catppuccin", priority = 1000 },
{
'nvim-telescope/telescope.nvim', tag = '0.1.8',
dependencies = { 'nvim-lua/plenary.nvim' }
},
{"nvim-treesitter/nvim-treesitter", build = ":TSUpdate"}
}
local opts = {}
require("lazy").setup(plugins, opts)
local builtin=require("telescope.builtin")
vim.keymap.set('n', '<C-p>', builtin.find_files, {})
vim.keymap.set('n', '<leader>fg', builtin.live_grep, {})
require("catppuccin").setup()
vim.cmd.colorscheme="catppuccin"
local config = require("nvim-treesitter.configs")
config.setup({
ensure_installed = {"erlang","lua"},
highlight = { enable = true },
indent = { enable = true },
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment