blob: 038ed1b09b2f261c4a349bc6e380a235d8428217 (
plain)
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
|
-- Store a lot of history
vim.opt.history = 10000
-- Enable mouse support
vim.opt.mouse = "a"
-- Line numbers
vim.opt.number = true
-- Vim janks about a lot as the LSP floats in or out if the sign column width
-- is not fixed ahead of time.
vim.opt.signcolumn = "yes:1"
-- don't take up the whole screen with popups
vim.opt.pumheight = 15
-- lazy.nvim does relative line numbers
vim.wo.relativenumber = false
-- .nvimrc files
vim.opt.exrc = true
-- disable autoformat by default
vim.g.autoformat = false
vim.g.root_spec = { "cwd" }
--[[
local cmp = require("cmp")
local enabled_except_in_comments = function()
if vim.api.nvim_get_mode().mode == "c" then
return true
else
local context = require("cmp.config.context")
return not context.in_treesitter_capture("comment") and not context.in_syntax_group("Comment")
end
end
cmp.setup.filetype("markdown", {
enabled = false,
})
for _, ft in ipairs({ "c", "cpp", "ruby" }) do
cmp.setup.filetype(ft, {
enabled = enabled_except_in_comments,
})
end
]]--
vim.api.nvim_create_user_command("DiagHide", function(args)
vim.diagnostic.enable(false)
end, {})
vim.api.nvim_create_user_command("DiagShow", function(args)
vim.diagnostic.enable(true)
end, {})
vim.api.nvim_create_user_command("FindRefs", function(args)
require("telescope.builtin").lsp_references()
end, {})
|