aboutsummaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua80
1 files changed, 80 insertions, 0 deletions
diff --git a/init.lua b/init.lua
new file mode 100644
index 0000000..a68778d
--- /dev/null
+++ b/init.lua
@@ -0,0 +1,80 @@
1--------------------------------------------------------------------------------
2-- vim options, first sourced from vimrc, then appended by Neovim specific stuff
3--------------------------------------------------------------------------------
4local configdir = vim.fn.fnamemodify(vim.fn.expand("$MYVIMRC"), ":p:h")
5vim.cmd('source ' .. configdir .. '/vimrc')
6
7vim.opt.encoding='utf-8'
8vim.opt.inccommand = "nosplit" -- Neovim only: preview substitute and such things in real time
9vim.opt.shadafile = configdir .. "/shada.file"
10
11--------------------------------------------------------------------------------
12-- Bootstrap lazy.nvim
13--------------------------------------------------------------------------------
14local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
15if not (vim.uv or vim.loop).fs_stat(lazypath) then
16 local lazyrepo = "https://github.com/folke/lazy.nvim.git"
17 local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
18 if vim.v.shell_error ~= 0 then
19 vim.api.nvim_echo({
20 { "Failed to clone lazy.nvim:\n", "ErrorMsg" },
21 { out, "WarningMsg" },
22 { "\nPress any key to exit..." },
23 }, true, {})
24 vim.fn.getchar()
25 os.exit(1)
26 end
27end
28vim.opt.rtp:prepend(lazypath)
29
30require("lazy").setup({
31 spec = {
32 { import = "plugins", },
33 'coderonline/vim-fancy-line',
34 'coderonline/vim-recently-used',
35 }
36})
37
38-- Restore cursor position
39vim.api.nvim_create_autocmd({ "BufReadPost" }, {
40 callback = function() vim.cmd('silent! normal! g`"zv') end
41})
42
43-- LSP says 'fix available', but there is no such command? Let us fix that:
44vim.api.nvim_create_user_command(
45 'LspFix',
46 function()
47 vim.lsp.buf.code_action()
48 end, {}
49)
50
51-- speaking of lsp, lets enable logging (TODO: remove if you remove
52-- `lua/cmp.lua`, but why would you?)
53vim.g.lsp_log_verbose = 1
54vim.g.lsp_log_file = configdir .. ('/vim-lsp.log')
55vim.lsp.set_log_level 'error'
56if vim.fn.has 'nvim-0.5.1' == 1 then
57 require('vim.lsp.log').set_format_func(vim.inspect)
58end
59
60-- If you need scoop for some dependencies on Windows machines this may come
61-- handy:
62if vim.fn.has("win32") then
63 vim.opt.rtp:append(vim.fn.expand("$HOME\\scoop\\shims"))
64end
65
66if vim.g.neovide then
67 vim.guifont = "monospace:h11:b"
68 vim.g.neovide_cursor_animation_length = 0.03
69 vim.g.neovide_cursor_trail_size = 0.8
70 vim.g.neovide_scroll_animation_length = 0.05
71 vim.g.neovide_transparency = 0.9
72 vim.g.neovide_cursor_animation_length=0
73 vim.g.neovide_cursor_vfx_mode = ""
74 vim.g.neovide_floating_blur_amount_x = 4.0
75 vim.g.neovide_floating_blur_amount_y = 4.0
76 vim.g.neovide_background_color = '#383a62'
77 vim.g.neovide_scale_factor = 1.0
78end
79
80-- vim: tabstop=2 shiftwidth=2 softtabstop=2
..