My nvim configuration
| 1 | local lsplist = {} |
| 2 | for _, 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 |
| 6 | end |
| 7 | |
| 8 | vim.lsp.enable(lsplist) |
| 9 | |
| 10 | local original_notify = vim.notify |
| 11 | vim.notify = function(msg, ...) |
| 12 | if type(msg) == "string" and msg:match("Invalid server name") then |
| 13 | return |
| 14 | end |
| 15 | return original_notify(msg, ...) |
| 16 | end |
| 17 | |
| 18 | if 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 | } |
| 30 | end |
| 31 | |
| 32 | vim.cmd([[ |
| 33 | set formatoptions-=cro |
| 34 | set errorformat^=%m@%f |
| 35 | set fdo= |
| 36 | set foldmethod=expr |
| 37 | set foldexpr=v:lua.vim.treesitter.foldexpr() |
| 38 | set noswapfile |
| 39 | colorscheme tokyonight-moon |
| 40 | set undofile |
| 41 | let mapleader=" " |
| 42 | set number |
| 43 | set tabstop=4 |
| 44 | set shiftwidth=4 |
| 45 | set softtabstop=4 |
| 46 | set expandtab |
| 47 | set ignorecase |
| 48 | set smartcase |
| 49 | set foldlevel=99 |
| 50 | set showtabline=2 |
| 51 | set tabline=%!NumberedTabPages() |
| 52 | highlight Normal guibg=NONE ctermbg=NONE |
| 53 | highlight EndOfBuffer guibg=NONE ctermbg=NONE |
| 54 | "set statusline=[%{getcwd()}]\ %f:%{nvim_treesitter#statusline(1000)} |
| 55 | ]]) |
| 56 | |
| 57 | local venv_path = vim.fn.getcwd() .. "/.venv" |
| 58 | if vim.fn.isdirectory(venv_path) == 1 then |
| 59 | vim.env.VIRTUAL_ENV = venv_path |
| 60 | vim.env.PATH = venv_path .. "/bin:" .. vim.env.PATH |
| 61 | end |
| 62 | |
| 63 | vim.o.exrc = true |
| 64 | vim.g.maplocalleader = "," |
| 65 | vim.opt.scrolloff = 10 |
| 66 | vim.diagnostic.config({ |
| 67 | virtual_text = { |
| 68 | severity = vim.diagnostic.severity.ERROR, |
| 69 | }, |
| 70 | }) |