-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.lua
More file actions
89 lines (75 loc) · 2.23 KB
/
init.lua
File metadata and controls
89 lines (75 loc) · 2.23 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
89
require("plugins.telescope")
require("plugins.lsp")
vim.cmd.colorscheme("retrobox")
vim.g.mapleader = " "
vim.g.localmapleader = " "
local opts = { noremap = true }
--Telescope
vim.keymap.set("n", "<leader>ff", "<Cmd>:Telescope find_files<CR>", { desc = "Find File DIR" })
vim.keymap.set("n", "<leader>t", "<Cmd>:Telescope<CR>", { desc = "Telescope" })
vim.keymap.set("n", "<leader>fb", "<Cmd>:Telescope buffers<CR>", { desc = "Lists buffer with Telescope" })
vim.keymap.set("n", "<leader>fg", "<Cmd>:Telescope live_grep<CR>", { desc = "live_greb with Telescope" })
vim.keymap.set("n", "<leader>fh", "<Cmd>:Telescope help_tags<CR>", { desc = " Lists help with Telescope" })
-- NOTE: read :h autocommand
-- NOTE: read :h events
-- NOTE: autocmd [grup] event pattren command
local custom_buffer = vim.api.nvim_create_augroup("MyGroup", { clear = false })
vim.api.nvim_create_autocmd("TextYankPost", {
group = custom_buffer,
pattern = "*",
callback = function()
vim.highlight.on_yank({ timeout = 150 })
end,
})
local lsp_grup = vim.api.nvim_create_augroup("lspGrup", {})
vim.api.nvim_create_autocmd("BufWritePre", {
group = lsp_grup,
bufnr = bufnr,
callback = function()
vim.lsp.buf.format({ async = false })
end
})
local opt = vim.opt
vim.opt_local.conceallevel = 2
-- Tab / Indentation
opt.tabstop = 2
opt.shiftwidth = 2
opt.softtabstop = 2
opt.expandtab = true
opt.smartindent = true
opt.wrap = false
-- Search
opt.incsearch = true
opt.ignorecase = true
opt.smartcase = true
opt.hlsearch = false
-- Appearance
opt.number = true
opt.relativenumber = true
opt.termguicolors = true
-- opt.colorcolumn = "100"
opt.signcolumn = "yes"
opt.cmdheight = 1
opt.scrolloff = 10
opt.completeopt = "menuone,noinsert,noselect"
-- Behaviour
opt.title = true
opt.showmode = true
opt.hidden = true
opt.errorbells = false
opt.swapfile = false
opt.backup = false
opt.undodir = vim.fn.expand("~/.vim/undodir")
opt.undofile = true
opt.backspace = "indent,eol,start"
opt.splitright = true
opt.splitbelow = true
opt.autochdir = false
opt.iskeyword:append("-")
opt.selection = "exclusive"
opt.mouse = "a"
opt.clipboard:append("unnamedplus")
opt.modifiable = true
opt.encoding = "UTF-8"
opt.hlsearch = true
opt.guicursor = "n-v-c-sm:block,i-ci-ve:ver25,r-cr-o:hor20"