-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.lua
More file actions
46 lines (34 loc) · 1.68 KB
/
init.lua
File metadata and controls
46 lines (34 loc) · 1.68 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
vim.g.mapleader = " "
vim.g.maplocalleader = " "
vim.g.have_nerd_font = true
vim.opt.relativenumber = true
vim.opt.cursorline = true
vim.opt.scrolloff = 10
vim.opt.shiftwidth = 4
vim.opt.tabstop = 4
vim.schedule(function()
vim.opt.clipboard = "unnamedplus"
end)
vim.opt.list = true
vim.opt.listchars = { tab = " ", trail = "·", nbsp = "␣" }
vim.opt.mouse = ""
vim.opt.confirm = true
vim.keymap.set("t", "<Esc><Esc>", "<C-\\><C-n>", { desc = "Exit terminal mode" })
vim.keymap.set("n", "<C-h>", "<C-w><C-h>", { desc = "Move focus to the left window" })
vim.keymap.set("n", "<C-l>", "<C-w><C-l>", { desc = "Move focus to the right window" })
vim.keymap.set("n", "<C-j>", "<C-w><C-j>", { desc = "Move focus to the lower window" })
vim.keymap.set("n", "<C-k>", "<C-w><C-k>", { desc = "Move focus to the upper window" })
vim.keymap.set("n", "<Leader>mj", 'yiwoconsole.log();<Esc>hi"<Esc>pa:", <Esc>p', { desc = 'console.log("x:", x);' })
vim.keymap.set("v", "<Leader>mj", 'yoconsole.log();<Esc>hi"<Esc>pa:", <Esc>p', { desc = 'console.log("x:", x);' })
vim.keymap.set("n", "<Leader>mg", 'yiwofmt.Println()<Esc>i"<Esc>pa:", <Esc>p', { desc = 'fmt.Println("x:", x)' })
vim.keymap.set("v", "<Leader>mg", 'yofmt.Println()<Esc>i"<Esc>pa:", <Esc>p', { desc = 'fmt.Println("x:", x)' })
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
error("Error cloning lazy.nvim:\n" .. out)
end
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup("plugins")