-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoptions.lua
76 lines (60 loc) · 2.01 KB
/
options.lua
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
-- Leader
vim.g.mapleader = " "
vim.b.mapleader = " "
-- Side numbers
vim.wo.number = true
vim.wo.relativenumber = true
-- Mouse
vim.api.nvim_set_option("mouse", "a")
-- Scroll
vim.wo.scroll = 0
vim.wo.scrolloff = 3
-- Encoding
vim.api.nvim_set_option("encoding", "utf-8")
-- Keybinds
vim.api.nvim_set_keymap("n", "k", "gk", {noremap = true, silent = true})
vim.api.nvim_set_keymap("n", "j", "gj", {noremap = true, silent = true})
vim.api.nvim_set_keymap("n", "0", "g0", {noremap = true, silent = true})
vim.api.nvim_set_keymap("n", "$", "g$", {noremap = true, silent = true})
vim.api.nvim_set_keymap("i", "jj", "<ESC>", {noremap = true, silent = true})
-- Undo file
vim.api.nvim_set_option("undofile", true)
vim.api.nvim_set_option("undodir", "/Users/bendike/.config/nvim/undodir")
-- Splits open at the bottom and right, which is non-retarded, unlike vim defaults.
vim.o.splitright = true
vim.o.splitbelow = true
-- enable syntax highlighting
vim.cmd("syntax on")
-- enable filetype detection
vim.cmd("filetype plugin indent on")
-- enable syntax highlighting
vim.cmd("syntax on")
-- enable filetype detection
vim.cmd("filetype plugin indent on")
-- Tab stuff
vim.o.tabstop = 4
-- implicit tab size
vim.o.softtabstop = 4
-- another kind of stabstop
vim.o.shiftwidth = 4
-- convert tabs to spaces
vim.o.expandtab = true
vim.o.autoindent = true
-- FZF
vim.api.nvim_set_keymap("n", "<C-p>", ":Rg <CR>",
{noremap = true, silent = true})
-- Git
vim.api.nvim_set_keymap("n", "<leader>lg", ":LazyGit <CR>",
{noremap = true, silent = true})
vim.api.nvim_set_keymap("n", "<leader>bl", ":Gitsigns blame_line <CR>",
{noremap = true, silent = true})
-- Show diagnostic in floating window
vim.g["cursorhold_updatetime"] = 100
vim.cmd([[au CursorHold * lua vim.diagnostic.open_float(0,{scope = "cursor"})]])
vim.diagnostic.config({
-- virtual_text = false,
virtual_text = {source = true},
severity_sort = true
-- signs = true,
-- float = {border = "single"}
})