-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.lua
More file actions
116 lines (82 loc) · 3.38 KB
/
init.lua
File metadata and controls
116 lines (82 loc) · 3.38 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
vim.loader.enable()
--
-- ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗
-- ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║
-- ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║
-- ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║
-- ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║
-- ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝
--
-- NOTE: leader keys MUST be set BEFORE plugins load
--#region Global Options
vim.g.mapleader = ' '
vim.g.maplocalleader = ' '
vim.g.have_nerd_font = false
-- Line numbers
vim.o.number = true
-- vim.o.relativenumber = true
-- Enable mouse
vim.o.mouse = 'a'
-- Hide mode (shown in statusline)
vim.o.showmode = false
-- Required by true-color themes and plugins that render inline color previews.
vim.o.termguicolors = true
-- Sync clipboard with OS
vim.schedule(function() vim.o.clipboard = 'unnamedplus' end)
-- Indentation
vim.o.breakindent = true
-- Persistent undo
vim.o.undofile = true
-- Smart case-insensitive search
vim.o.ignorecase = true
vim.o.smartcase = true
-- Sign column
vim.o.signcolumn = 'yes'
-- Faster completion
vim.o.updatetime = 250
-- Faster key sequence completion
vim.o.timeoutlen = 300
-- Split behavior
vim.o.splitright = true
vim.o.splitbelow = true
-- Whitespace characters
vim.o.list = true
vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' }
-- Live substitution preview
vim.o.inccommand = 'split'
-- Highlight cursor line
vim.o.cursorline = true
-- Scrolloff
vim.o.scrolloff = 10
-- Confirm unsaved changes
vim.o.confirm = true
--#endregion
--#region Keymaps
-- Clear search highlights
vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')
-- Diagnostic quickfix
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' })
-- Exit terminal mode
vim.keymap.set('t', '<Esc><Esc>', '<C-\\><C-n>', { desc = 'Exit terminal mode' })
-- Disable arrow keys
-- vim.keymap.set('n', '<left>', '<cmd>echo "Use h to move!!"<CR>')
-- vim.keymap.set('n', '<right>', '<cmd>echo "Use l to move!!"<CR>')
-- vim.keymap.set('n', '<up>', '<cmd>echo "Use k to move!!"<CR>')
-- vim.keymap.set('n', '<down>', '<cmd>echo "Use j to move!!"<CR>')
-- Split navigation
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' })
--#endregion
--#region Autocommands
-- Highlight when yanking text
vim.api.nvim_create_autocmd('TextYankPost', {
desc = 'Highlight when yanking (copying) text',
group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }),
callback = function() vim.hl.on_yank() end,
})
--#endregion
vim.opt.fillchars:append { eob = ' ' }
require 'plugins'
-- vim: ts=2 sts=2 sw=2 et