irongit

My nvim configuration

hygo-nvim/lua/options.lua
70 lines1.6 KBLua
1local lsplist = {}
2for _, file in ipairs(vim.fn.readdir(vim.fn.stdpath("config") .. "/lsp")) do
3 if file:sub(-4) == ".lua" then
4 table.insert(lsplist, file:sub(1, -5))
5 end
6end
7
8vim.lsp.enable(lsplist)
9
10local original_notify = vim.notify
11vim.notify = function(msg, ...)
12 if type(msg) == "string" and msg:match("Invalid server name") then
13 return
14 end
15 return original_notify(msg, ...)
16end
17
18if vim.env.SSH_TTY ~= nil then
19 vim.g.clipboard = {
20 name = "OSC 52",
21 copy = {
22 ["+"] = require("vim.ui.clipboard.osc52").copy("+"),
23 ["*"] = require("vim.ui.clipboard.osc52").copy("*"),
24 },
25 paste = {
26 ["+"] = require("vim.ui.clipboard.osc52").paste("+"),
27 ["*"] = require("vim.ui.clipboard.osc52").paste("*"),
28 },
29 }
30end
31
32vim.cmd([[
33set formatoptions-=cro
34set errorformat^=%m@%f
35set fdo=
36set foldmethod=expr
37set foldexpr=v:lua.vim.treesitter.foldexpr()
38set noswapfile
39colorscheme tokyonight-moon
40set undofile
41let mapleader=" "
42set number
43set tabstop=4
44set shiftwidth=4
45set softtabstop=4
46set expandtab
47set ignorecase
48set smartcase
49set foldlevel=99
50set showtabline=2
51set tabline=%!NumberedTabPages()
52highlight Normal guibg=NONE ctermbg=NONE
53highlight EndOfBuffer guibg=NONE ctermbg=NONE
54"set statusline=[%{getcwd()}]\ %f:%{nvim_treesitter#statusline(1000)}
55]])
56
57local venv_path = vim.fn.getcwd() .. "/.venv"
58if vim.fn.isdirectory(venv_path) == 1 then
59 vim.env.VIRTUAL_ENV = venv_path
60 vim.env.PATH = venv_path .. "/bin:" .. vim.env.PATH
61end
62
63vim.o.exrc = true
64vim.g.maplocalleader = ","
65vim.opt.scrolloff = 10
66vim.diagnostic.config({
67 virtual_text = {
68 severity = vim.diagnostic.severity.ERROR,
69 },
70})