-------------------------------------------------------------------------------- -- vim options, first sourced from vimrc, then appended by Neovim specific stuff -------------------------------------------------------------------------------- local configdir = vim.fn.fnamemodify(vim.fn.expand("$MYVIMRC"), ":p:h") vim.cmd('source ' .. configdir .. '/vimrc') vim.opt.encoding='utf-8' vim.opt.inccommand = "nosplit" -- Neovim only: preview substitute and such things in real time vim.opt.shadafile = configdir .. "/shada.file" -------------------------------------------------------------------------------- -- Bootstrap lazy.nvim -------------------------------------------------------------------------------- local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not (vim.uv or vim.loop).fs_stat(lazypath) then local lazyrepo = "https://github.com/folke/lazy.nvim.git" local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) if vim.v.shell_error ~= 0 then vim.api.nvim_echo({ { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, { out, "WarningMsg" }, { "\nPress any key to exit..." }, }, true, {}) vim.fn.getchar() os.exit(1) end end vim.opt.rtp:prepend(lazypath) require("lazy").setup({ spec = { { import = "plugins", }, 'coderonline/vim-fancy-line', 'coderonline/vim-recently-used', } }) -- Restore cursor position vim.api.nvim_create_autocmd({ "BufReadPost" }, { callback = function() vim.cmd('silent! normal! g`"zv') end }) -- LSP says 'fix available', but there is no such command? Let us fix that: vim.api.nvim_create_user_command( 'LspFix', function() vim.lsp.buf.code_action() end, {} ) -- speaking of lsp, lets enable logging (TODO: remove if you remove -- `lua/cmp.lua`, but why would you?) vim.g.lsp_log_verbose = 1 vim.g.lsp_log_file = configdir .. ('/vim-lsp.log') vim.lsp.set_log_level 'error' if vim.fn.has 'nvim-0.5.1' == 1 then require('vim.lsp.log').set_format_func(vim.inspect) end -- If you need scoop for some dependencies on Windows machines this may come -- handy: if vim.fn.has("win32") then vim.opt.rtp:append(vim.fn.expand("$HOME\\scoop\\shims")) end if vim.g.neovide then vim.guifont = "monospace:h11:b" vim.g.neovide_cursor_animation_length = 0.03 vim.g.neovide_cursor_trail_size = 0.8 vim.g.neovide_scroll_animation_length = 0.05 vim.g.neovide_transparency = 0.9 vim.g.neovide_cursor_animation_length=0 vim.g.neovide_cursor_vfx_mode = "" vim.g.neovide_floating_blur_amount_x = 4.0 vim.g.neovide_floating_blur_amount_y = 4.0 vim.g.neovide_background_color = '#383a62' vim.g.neovide_scale_factor = 1.0 end -- vim: tabstop=2 shiftwidth=2 softtabstop=2