Files
dotfiles/.config/nvim/lua/plug_init/vim_init.lua
2026-01-22 22:54:47 +01:00

60 lines
1.8 KiB
Lua

vim.o.compatible = false
vim.o.showmatch = true
vim.o.hlsearch = true
vim.o.ignorecase = true
vim.o.smartcase = true
vim.o.incsearch = false
vim.o.tabstop = 4
vim.o.softtabstop = -1 -- use shiftwidth value
-- vim.o.expandtab = false -- tabs not spaces -- leaving it out for auto?
vim.o.shiftwidth = 4
vim.o.autoindent = true
vim.o.relativenumber = true
vim.o.number = true
vim.o.wildmode = "longest,list"
vim.o.cursorline = true
vim.o.listchars = "tab: >,lead:·,trail:-,nbsp:+,multispace:•"
vim.o.ttyfast = true
vim.o.scrolloff = 5
vim.o.wrap = false
vim.o.mouse = ""
vim.o.termguicolors = true -- enable truecolor
vim.o.undofile = true
vim.o.undodir = os.getenv("HOME") .. "/.local/share/nvim/undodir"
vim.o.updatetime = 30
vim.o.colorcolumn = "79"
vim.o.cmdheight = 0 -- remove the last interface line under statusline
vim.o.showmode = false -- stop noice from showing mode, lualine will show mode anyway
---
vim.g.netrw_preview = 1
vim.g.netrw_liststyle = 3
vim.g.netrw_winsize = 20
--
--These will:
--
-- 1. Make vertical splitting the default for previewing files
-- 2. Make the default listing style "tree"
-- 3. When a vertical preview window is opened, the directory listing
-- will use only 30% of the columns available; the rest of the window
-- is used for the preview window.
vim.g.mapleader = " "
-- vim.g.maplocalleader = "\\"
-- move highlighted lines up and down, automatic indentation
vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv")
vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv")
-- replace highlighted area without adding to register
vim.keymap.set("x", "<leader>p", '"_dP')
-- copy to system clipboard
vim.keymap.set("n", "<leader>y", '"+y')
vim.keymap.set("v", "<leader>y", '"+y')
vim.keymap.set("n", "<leader>Y", '"+Y')
-- open side panel explorer
--vim.keymap.set("n", "<leader>e", ":Lexplore<CR>") -- now via whichkey
--
--highlights