-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.lua
More file actions
88 lines (74 loc) · 2.12 KB
/
init.lua
File metadata and controls
88 lines (74 loc) · 2.12 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
require("config.lazy")
vim.opt.termguicolors = true
vim.opt.clipboard = "unnamedplus"
--help files open in full window and are listed in buffer elements
vim.api.nvim_create_autocmd("FileType", {
pattern = "help",
callback = function()
vim.cmd("only")
vim.bo.buflisted = true
end,
})
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
vim.o.tabstop = 4
vim.o.softtabstop = 4
vim.o.shiftwidth = 4
vim.o.expandtab = true
vim.o.autoindent = true
vim.o.smartindent = true
vim.o.signcolumn = "yes"
vim.o.foldenable = false
vim.o.wrap = false
vim.wo.relativenumber = true
vim.o.background = "dark"
vim.wo.cursorline = true
--KEYMAPS
vim.keymap.set("n", "<Tab>", function()
require("oil").open()
end)
vim.keymap.set("n", "<A-j>", ":m .+1<CR>==", { silent = true })
vim.keymap.set("n", "<A-k>", ":m .-2<CR>==", { silent = true })
vim.keymap.set("v", "<A-j>", ":m '>+1<CR>gv=gv", { silent = true })
vim.keymap.set("v", "<A-k>", ":m '<-2<CR>gv=gv", { silent = true })
--unhighlight
vim.keymap.set("n", "<leader>h", ":noh<CR>", { silent = true })
--terminal
vim.keymap.set("t", "<Esc>", [[<C-\><C-n>]])
--saving&quitting
vim.keymap.set("n", "<C-s>", ":w<CR>")
vim.keymap.set("n", "<F5>", ":wa<CR>")
vim.keymap.set("n", "<BS>", ":confirm bdelete<CR>")
vim.keymap.set("n", "<C-BS>", ":qa<CR>")
--telescope
local builtin = require("telescope.builtin")
vim.keymap.set("n", "<leader>f", builtin.find_files, {})
vim.keymap.set("n", "<leader>g", builtin.live_grep, {})
vim.keymap.set("n", "<leader>b", builtin.buffers, {})
--harpoon
local harpoon = require("harpoon")
harpoon:setup()
vim.keymap.set("n", "<leader>a", function()
harpoon:list():add()
end)
vim.keymap.set("n", "<leader>e", function()
harpoon.ui:toggle_quick_menu(harpoon:list())
end)
vim.keymap.set("n", "<C-h>", function()
harpoon:list():select(1)
end)
vim.keymap.set("n", "<C-j>", function()
harpoon:list():select(2)
end)
vim.keymap.set("n", "<C-k>", function()
harpoon:list():select(3)
end)
vim.keymap.set("n", "<C-l>", function()
harpoon:list():select(4)
end)
vim.keymap.set("n", "<C-,>", function()
harpoon:list():prev()
end)
vim.keymap.set("n", "<C-.>", function()
harpoon:list():next()
end)