-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.lua
61 lines (58 loc) · 1.52 KB
/
settings.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
-- I'm lazy
local opt = vim.opt
-- Define workspace path
vim.env.WORKSPACE = '~/Documents/github/'
opt.clipboard = 'unnamedplus'
opt.modelines = 0
opt.maxmempattern = 2500
-- GUI stuff
vim.g.colors_name = 'gruvbox-flat'
vim.g.gruvbox_flat_style = 'dark'
opt.guifont = 'JetBrains Mono:h12'
opt.termguicolors = true
opt.mouse = 'n'
opt.number = true
opt.relativenumber = true
opt.wrap = true
opt.cursorline = true
opt.breakindent = true
opt.linebreak = true
opt.scrolloff = 8
opt.tabstop = 2
opt.softtabstop = 2
opt.shiftwidth = 2
opt.expandtab = true
opt.shiftround = true
opt.lazyredraw = true
opt.hlsearch = false
opt.incsearch = true
opt.inccommand = 'nosplit'
opt.splitright = true
-- Neovide-specific cursor settings
vim.g.neovide_cursor_animation_length = 0.05
vim.g.neovide_cursor_animate_in_insert_mode = 0
-- Highlight yanked text
vim.cmd([[
augroup highlightYank
autocmd!
autocmd TextYankPost * silent! lua vim.highlight.on_yank{higroup = "Visual", timeout = 300}
augroup END
]])
-- Some settings for files with more prose
vim.cmd([[
augroup writingStuff
autocmd!
autocmd FileType text,tex,md setlocal spell
autocmd FileType text,tex,md set tabstop = 2
autocmd FileType text,tex,md set softtabstop = 2
autocmd FileType text,tex,md set shiftwidth = 2
autocmd FileType text,md set textwidth = 80
augroup END
]])
-- Autocommands for compiling/running C++ files
vim.cmd([[
augroup cppCommands
autocmd!
autocmd FileType cpp nnoremap <C-'> <Cmd>term g++ -std=c++11 -o %:r.out % && %:r.out<CR>
augroup END
]])