fix(config): new config, it's been a while
This commit is contained in:
commit
1fe92c532b
11 changed files with 385 additions and 0 deletions
28
lua/config/lazy.lua
Normal file
28
lua/config/lazy.lua
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
-- Bootstrap lazy.nvim
|
||||
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)
|
||||
|
||||
-- Setup lazy.nvim
|
||||
require("lazy").setup({
|
||||
spec = {
|
||||
-- plugin import
|
||||
{ import = "plugins" },
|
||||
},
|
||||
-- Configure any other settings here. See the documentation for more details.
|
||||
install = {},
|
||||
-- automatically check for plugin updates
|
||||
checker = { enabled = true },
|
||||
})
|
||||
54
lua/config/vim.lua
Normal file
54
lua/config/vim.lua
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
-- set the leader
|
||||
vim.g.mapleader = " "
|
||||
|
||||
-- neovim/vim variables
|
||||
local opt = vim.opt
|
||||
local keybind = vim.keymap.set
|
||||
|
||||
-- basic
|
||||
opt.relativenumber = true
|
||||
opt.number = true
|
||||
opt.termguicolors = true
|
||||
|
||||
-- indentation
|
||||
opt.tabstop = 2
|
||||
opt.softtabstop = 0
|
||||
opt.shiftwidth = 2
|
||||
opt.smarttab = true
|
||||
opt.smartindent = true
|
||||
|
||||
-- searches
|
||||
opt.incsearch = true
|
||||
|
||||
-- mapleader
|
||||
vim.g.mapleader = " "
|
||||
|
||||
-- keybinds
|
||||
keybind("n", "<leader>hh", "<cmd>lua vim.diagnostic.setqflist()<CR>", { desc = "LSP Diagonistics" })
|
||||
|
||||
-- buffer keybinds
|
||||
keybind("n", "<leader>bb", "<cmd>bprevious<CR>", { desc = "Switch to previous buffer" })
|
||||
keybind("n", "<leader>nn", "<cmd>bnext<CR>", { desc = "Switch to next buffer" })
|
||||
keybind("n", "<leader>,,", "<cmd>bdel<CR>", { desc = "Delete Buffer" })
|
||||
|
||||
-- visual mode keybinds
|
||||
keybind("v", "<leader>ii", '"+y', { desc = "Copy to clipboard ( + yank)" })
|
||||
keybind("v", "<", "<gv", { desc = "Indent left and reselect" })
|
||||
keybind("v", ">", ">gv", { desc = "Indent right and reselect" })
|
||||
keybind("v", "<S-Up>", ":m '<-2<CR>gv", { desc = "Move selection up" })
|
||||
keybind("v", "<S-Down>", ":m '>+1<CR>gv", { desc = "Move selection down" })
|
||||
|
||||
-- friend keybinds
|
||||
keybind("i", "jk", "<Esc>", { desc = "Keybind set for Justin" })
|
||||
|
||||
-- file explorer
|
||||
keybind("n", "<leader>mm", "<Cmd>Neotree toggle<CR>", { desc = "Toggle File Explorer" })
|
||||
keybind("n", "<leader>jj", "<Cmd>Neotree action=focus<CR>", { desc = "Focus on file explorer" })
|
||||
|
||||
-- file handling
|
||||
opt.backup = false
|
||||
opt.writebackup = false
|
||||
opt.swapfile = false
|
||||
opt.undofile = true
|
||||
opt.undodir = vim.fn.expand("~/.nvim/undodir")
|
||||
opt.autoread = true
|
||||
Loading…
Add table
Add a link
Reference in a new issue