49 lines
1.3 KiB
Lua
49 lines
1.3 KiB
Lua
-- neovim/vim variables
|
|
local opt = vim.opt
|
|
local keybind = vim.keymap.set
|
|
|
|
-- transperency
|
|
vim.api.nvim_set_hl(0, "Normal", { bg = "none" })
|
|
vim.api.nvim_set_hl(0, "NormalNC", { bg = "none" })
|
|
vim.api.nvim_set_hl(0, "EndOfBuffer", { bg = "none" })
|
|
|
|
-- 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>")
|
|
-- for buffers
|
|
keybind("n", "<leader>bb", "<cmd>bprevious<CR>")
|
|
keybind("n", "<leader>nn", "<cmd>bnext<CR>")
|
|
keybind("n", "<leader>,,", "<cmd>bdel<CR>")
|
|
-- for visual mode
|
|
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 handling
|
|
opt.backup = false
|
|
opt.writebackup = false
|
|
opt.swapfile = false
|
|
opt.undofile = true
|
|
opt.undodir = vim.fn.expand("~/.nvim/undodir")
|
|
opt.autoread = true
|