Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- vim.g.mapleader = " "
- -- =========================
- -- Basic settings
- -- =========================
- vim.opt.number = true
- vim.opt.relativenumber = true
- vim.opt.tabstop = 4
- vim.opt.shiftwidth = 4
- vim.opt.softtabstop = 4
- vim.opt.expandtab = true
- vim.opt.smartindent = true
- vim.opt.mouse = "a"
- vim.opt.termguicolors = true
- vim.opt.clipboard = "unnamedplus"
- vim.opt.ignorecase = true
- vim.opt.smartcase = true
- vim.opt.splitright = true
- vim.opt.splitbelow = true
- vim.opt.updatetime = 250
- vim.opt.signcolumn = "yes"
- -- =========================
- -- lazy.nvim bootstrap
- -- =========================
- local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
- if not vim.uv.fs_stat(lazypath) then
- vim.fn.system({
- "git",
- "clone",
- "--filter=blob:none",
- "https://github.com/folke/lazy.nvim.git",
- "--branch=stable",
- lazypath,
- })
- end
- vim.opt.rtp:prepend(lazypath)
- -- =========================
- -- Plugins
- -- =========================
- require("lazy").setup({
- {
- "ellisonleao/gruvbox.nvim",
- priority = 1000,
- config = function()
- vim.cmd.colorscheme("gruvbox")
- end,
- },
- {
- "nvim-lualine/lualine.nvim",
- dependencies = { "nvim-tree/nvim-web-devicons" },
- config = function()
- require("lualine").setup()
- end,
- },
- {
- "nvim-neo-tree/neo-tree.nvim",
- branch = "v3.x",
- dependencies = {
- "nvim-lua/plenary.nvim",
- "MunifTanjim/nui.nvim",
- "nvim-tree/nvim-web-devicons",
- },
- config = function()
- require("neo-tree").setup({})
- end,
- },
- {
- "nvim-telescope/telescope.nvim",
- dependencies = { "nvim-lua/plenary.nvim" },
- },
- {
- "nvim-treesitter/nvim-treesitter",
- branch = "master",
- build = ":TSUpdate",
- config = function()
- require("nvim-treesitter.configs").setup({
- ensure_installed = {
- "c",
- "cpp",
- "rust",
- "lua",
- "cmake",
- "vim",
- "bash",
- },
- highlight = {
- enable = true,
- },
- })
- end,
- },
- {
- "neovim/nvim-lspconfig",
- config = function()
- vim.lsp.enable({
- "clangd",
- "rust_analyzer",
- })
- end,
- },
- {
- "lewis6991/gitsigns.nvim",
- config = function()
- require("gitsigns").setup()
- end,
- },
- {
- "folke/which-key.nvim",
- config = function()
- require("which-key").setup()
- end,
- },
- {
- "zbirenbaum/copilot.lua",
- config = function()
- require("copilot").setup({
- suggestion = {
- enabled = true,
- auto_trigger = true,
- keymap = {
- accept = "<C-j>",
- },
- },
- panel = {
- enabled = true,
- },
- })
- end,
- },
- })
- -- =========================
- -- Keymaps
- -- =========================
- local map = vim.keymap.set
- map("n", "<C-p>", "<cmd>Telescope find_files<CR>")
- map("n", "<leader>fg", "<cmd>Telescope live_grep<CR>")
- map("n", "<C-n>", "<cmd>Neotree toggle<CR>")
- map("n", "gn", "<cmd>bnext<CR>")
- map("n", "gp", "<cmd>bprevious<CR>")
- map("n", "gc", "<cmd>bdelete<CR>")
- map("n", "gd", vim.lsp.buf.definition)
- map("n", "gr", vim.lsp.buf.references)
- map("n", "K", vim.lsp.buf.hover)
- map("n", "<leader>rn", vim.lsp.buf.rename)
- map("n", "<leader>ca", vim.lsp.buf.code_action)
- map("n", "[g", vim.diagnostic.goto_prev)
- map("n", "]g", vim.diagnostic.goto_next)
- map("n", "<space>a", vim.diagnostic.setloclist)
Advertisement
Add Comment
Please, Sign In to add comment