-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.lua
More file actions
109 lines (90 loc) · 3.48 KB
/
init.lua
File metadata and controls
109 lines (90 loc) · 3.48 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
vim.g.mapleader = " "
vim.g.maplocalleader = " "
-- Diagnostic symbols
require('vilar.diagnostics')
-- Lazy plugin manager
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
require('lazy').setup({
spec="plugins",
change_detection = {
notify = false,
},
})
-- Options
vim.opt.ignorecase = true
vim.opt.smartcase = true
vim.opt.tabstop = 4 -- For actual tabs
vim.opt.shiftwidth = 2 -- For autoindent
vim.opt.expandtab = true -- Subsitute tabs with...
vim.opt.softtabstop = 2 -- ...2 spaces
vim.opt.path = "**" -- Search in subdirectories
vim.opt.virtualedit = "block" -- Allow visual model over "shorter" lines
--~ vim.opt.mouse = "nv" -- Mouse in normal and visual mode (but not insert!)
vim.opt.mouse = "" -- Disable mouse
vim.opt.cursorline = true -- Highlight current line
vim.opt.signcolumn = "yes" -- Column for linting symbols
vim.opt.completeopt = "noinsert,menuone,noselect" -- Completion menu
vim.opt.clipboard = "unnamed" -- Use the '*' register for yank, etc.
vim.opt.hlsearch = false -- Do not highlight search by default
vim.opt.inccommand = "split" -- Live preview for substitutions
vim.opt.shortmess:append("cS") -- No "match x of y" messages for autocompletion and search results
vim.opt.concealcursor = "nv" -- Only show concealed text when editing
vim.opt.foldenable = false -- Disable folds
vim.opt.wildmode = "longest:full,full" -- Complete until longest match, but also show a menu
vim.opt.showcmd = false -- Do not ehco commands
vim.opt.colorcolumn = "80"
require('vilar.marks_stc')
vim.opt.relativenumber = true -- Needed for statuscolumn to work properly
vim.opt.statuscolumn = '%s%3{MarkInLine(v:lnum, v:relnum)} '
require('vilar.lsp')
-- Autochdir does not seem to work, probably because of some plugin
vim.api.nvim_create_autocmd("BufEnter", { pattern="*", command="silent! lcd %:p:h" } )
-- Settings for python seem to be overwritten, probably should move this to ftplugin
vim.api.nvim_create_autocmd("FileType",
{ pattern="python", command="set shiftwidth=2 tabstop=2 expandtab" })
-- Do not continue comments on new lines
vim.api.nvim_create_autocmd("FileType",
{ pattern="*", command="setlocal formatoptions-=ro" })
-- Do not treat list items as comments in markdown
vim.api.nvim_create_autocmd("FileType",
{ pattern="markdown", command="set comments=b:>" })
-- Remove wrapping for markdown files
vim.api.nvim_create_autocmd("FileType",
{ pattern="markdown", command="set nowrap" })
-- Specific textwidths
vim.api.nvim_create_autocmd("FileType",
{ pattern={"text", "telekasten"},
command="setlocal tw=80" })
vim.api.nvim_create_autocmd("FileType",
{ pattern={"markdown"},
command="setlocal tw=0" })
-- Asymptote
vim.api.nvim_create_autocmd({"BufEnter", "BufRead"},
{ pattern="*.asy", command="setf asy" })
-- Colors
vim.opt.termguicolors = true
--~ vim.cmd("colorscheme kanagawa")
--~ vim.cmd("colorscheme habamax.nvim")
vim.cmd("colorscheme forestbones")
-- Spelling
require('vilar.spelling')
-- Keybindings
require('vilar.keybindings')
-- Command and function definitions
require('vilar.commands')
-- Disable the inline diagnostics, as this is handled by the plugins
vim.diagnostic.config({
virtual_text = false,
virtual_lines = false,
})