Files
dotfiles/.config/nvim/lua/plug_init/vim_init.lua

54 lines
1.7 KiB
Lua

vim.opt.compatible = false
vim.opt.showmatch = true
vim.opt.hlsearch = true
vim.opt.incsearch = false
vim.opt.tabstop = 4
vim.opt.softtabstop = -1 -- use shiftwidth value
vim.opt.expandtab = false -- tabs not spaces
vim.opt.shiftwidth = 4
vim.opt.autoindent = true
vim.opt.relativenumber = true
vim.opt.number = true
vim.opt.wildmode = "longest,list"
vim.opt.cursorline = true
vim.opt.ttyfast = true
vim.opt.scrolloff = 5
vim.opt.wrap = false
vim.opt.mouse = ""
vim.opt.termguicolors = true -- enable truecolor
vim.opt.undofile = true
vim.opt.undodir = os.getenv("HOME") .. "/.local/share/nvim/undodir"
vim.opt.updatetime = 30
vim.opt.colorcolumn = "79"
vim.opt.cmdheight = 0 -- remove the last interface line under statusline
vim.opt.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 = 25
--
--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 = " "
-- 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