-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.lua
More file actions
54 lines (44 loc) · 1.39 KB
/
Copy pathinit.lua
File metadata and controls
54 lines (44 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
vim.g.mapleader = " "
vim.g.maplocalleader = ","
vim.opt.clipboard = "unnamedplus"
require("config.lazy")
if vim.fn.has("win32") == 1 then
vim.o.shell = "powershell"
vim.o.shellcmdflag = "-NoLogo -NoProfile -ExecutionPolicy RemoteSigned -Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.Encoding]::UTF8;"
vim.o.shellredir = "2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode"
vim.o.shellpipe = "2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode"
vim.o.shellquote = ""
vim.o.shellxquote = ""
end
vim.o.relativenumber = true
vim.o.exrc = true
vim.o.secure = true
vim.diagnostic.config({
virtual_text = true,
signs = true,
underline = true,
update_in_insert = true,
severity_sort = true,
})
vim.opt.colorcolumn = nil
vim.cmd([[let g:netrw_bufsettings = 'noma nomod nu nobl nowrap ro']])
vim.opt.tabstop = 4
vim.opt.softtabstop = 4
vim.opt.shiftwidth = 4
vim.o.autowriteall = true
vim.api.nvim_create_autocmd(
{ "InsertLeave", "TextChanged", "FocusLost" },
{
pattern = "*",
callback = function()
if vim.bo.modified and vim.bo.buftype == "" then
vim.cmd("silent! write")
end
end,
}
)
vim.keymap.set("n", "<leader>pv", vim.cmd.Ex, { desc = "Go back to netrw" })
vim.keymap.set({ "n", "i" }, "<Esc>", function()
vim.cmd([[nohl]]) -- clear highlight of search
vim.cmd([[stopinsert]]) -- clear messages (the line below statusline)
end)