lazyvim
This commit is contained in:
		
							
								
								
									
										13
									
								
								nvim/lua/config/autocmds.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								nvim/lua/config/autocmds.lua
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,13 @@
 | 
			
		||||
-- Autocmds are automatically loaded on the VeryLazy event
 | 
			
		||||
-- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua
 | 
			
		||||
-- Add any additional autocmds here
 | 
			
		||||
local function open_nvim_tree(data)
 | 
			
		||||
  local directory = vim.fn.isdirectory(data.file) == 1
 | 
			
		||||
  if not directory then
 | 
			
		||||
    return
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  vim.cmd.cd(data.file)
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
vim.api.nvim_create_autocmd({ "VimEnter" }, { callback = open_nvim_tree })
 | 
			
		||||
							
								
								
									
										20
									
								
								nvim/lua/config/keymaps.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								nvim/lua/config/keymaps.lua
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,20 @@
 | 
			
		||||
-- Keymaps are automatically loaded on the VeryLazy event
 | 
			
		||||
-- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua
 | 
			
		||||
-- Add any additional keymaps here
 | 
			
		||||
 | 
			
		||||
local function map(mode, lhs, rhs, opts)
 | 
			
		||||
  local keys = require("lazy.core.handler").handlers.keys
 | 
			
		||||
  ---@cast keys LazyKeysHandler
 | 
			
		||||
  -- do not create the keymap if a lazy keys handler exists
 | 
			
		||||
  if not keys.active[keys.parse({ lhs, mode = mode }).id] then
 | 
			
		||||
    opts = opts or {}
 | 
			
		||||
    opts.silent = opts.silent ~= false
 | 
			
		||||
    if opts.remap and not vim.g.vscode then
 | 
			
		||||
      opts.remap = nil
 | 
			
		||||
    end
 | 
			
		||||
    vim.keymap.set(mode, lhs, rhs, opts)
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
map("t", "<Esc><Esc>", [[<C-\><C-n>]], {})
 | 
			
		||||
map("", "tl", require("lsp_lines").toggle, { desc = "Toggle lsp_lines" })
 | 
			
		||||
							
								
								
									
										46
									
								
								nvim/lua/config/lazy.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										46
									
								
								nvim/lua/config/lazy.lua
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,46 @@
 | 
			
		||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
 | 
			
		||||
if not vim.loop.fs_stat(lazypath) then
 | 
			
		||||
  -- bootstrap lazy.nvim
 | 
			
		||||
  -- stylua: ignore
 | 
			
		||||
  vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath })
 | 
			
		||||
end
 | 
			
		||||
vim.opt.rtp:prepend(vim.env.LAZY or lazypath)
 | 
			
		||||
 | 
			
		||||
require("lazy").setup({
 | 
			
		||||
  spec = {
 | 
			
		||||
    -- add LazyVim and import its plugins
 | 
			
		||||
    { "LazyVim/LazyVim", import = "lazyvim.plugins" },
 | 
			
		||||
    -- import any extras modules here
 | 
			
		||||
    -- { import = "lazyvim.plugins.extras.lang.typescript" },
 | 
			
		||||
    -- { import = "lazyvim.plugins.extras.lang.json" },
 | 
			
		||||
    -- { import = "lazyvim.plugins.extras.ui.mini-animate" },
 | 
			
		||||
    -- import/override with your plugins
 | 
			
		||||
    { import = "plugins" },
 | 
			
		||||
  },
 | 
			
		||||
  defaults = {
 | 
			
		||||
    -- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup.
 | 
			
		||||
    -- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default.
 | 
			
		||||
    lazy = false,
 | 
			
		||||
    -- It's recommended to leave version=false for now, since a lot the plugin that support versioning,
 | 
			
		||||
    -- have outdated releases, which may break your Neovim install.
 | 
			
		||||
    version = false, -- always use the latest git commit
 | 
			
		||||
    -- version = "*", -- try installing the latest stable version for plugins that support semver
 | 
			
		||||
  },
 | 
			
		||||
  install = { colorscheme = { "tokyonight", "habamax" } },
 | 
			
		||||
  checker = { enabled = true }, -- automatically check for plugin updates
 | 
			
		||||
  performance = {
 | 
			
		||||
    rtp = {
 | 
			
		||||
      -- disable some rtp plugins
 | 
			
		||||
      disabled_plugins = {
 | 
			
		||||
        "gzip",
 | 
			
		||||
        -- "matchit",
 | 
			
		||||
        -- "matchparen",
 | 
			
		||||
        -- "netrwPlugin",
 | 
			
		||||
        "tarPlugin",
 | 
			
		||||
        "tohtml",
 | 
			
		||||
        "tutor",
 | 
			
		||||
        "zipPlugin",
 | 
			
		||||
      },
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
})
 | 
			
		||||
							
								
								
									
										9
									
								
								nvim/lua/config/options.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								nvim/lua/config/options.lua
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,9 @@
 | 
			
		||||
-- Options are automatically loaded before lazy.nvim startup
 | 
			
		||||
-- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua
 | 
			
		||||
-- Add any additional options here
 | 
			
		||||
--
 | 
			
		||||
 | 
			
		||||
local opt = vim.opt
 | 
			
		||||
local diag = vim.diagnostic
 | 
			
		||||
opt.scrolloff = 999
 | 
			
		||||
diag.config({ virtual_text = false })
 | 
			
		||||
		Reference in New Issue
	
	Block a user