diff --git a/files/.config/nvim/init.lua b/files/.config/nvim/init.lua index 732d22f..81429da 100644 --- a/files/.config/nvim/init.lua +++ b/files/.config/nvim/init.lua @@ -1,25 +1,4 @@ -vim.g.mapleader = " " -vim.g.maplocalleader = "," -vim.cmd.colorscheme("lunaperche") -vim.opt.smarttab = true -vim.opt.tabstop = 2 -vim.opt.shiftwidth = 2 -vim.opt.clipboard = "unnamedplus" -- use system clipboard - -vim.pack.add{ - { src = 'https://github.com/neovim/nvim-lspconfig' }, - { src = 'https://github.com/junegunn/fzf.vim' }, -} - -vim.lsp.config('chicken', { - cmd = {'chicken-lsp-server'}, - filetypes = {'scheme'}, - root_markers = {'Makefile', 'build.meson', '.git'}, -}) - -vim.lsp.enable('chicken') -vim.lsp.enable('clangd') -vim.lsp.enable('lua_ls') - -vim.keymap.set("n", "b", "Buffers") -vim.keymap.set("n", "f", "Files") +require("config.options") +for _, file in ipairs(vim.fn.globpath(vim.fn.stdpath("config") .. "/lua/config", "*.lua", false, true)) do + require("config." .. vim.fn.fnamemodify(file, ":t:r")) +end diff --git a/files/.config/nvim/lazy-lock.json b/files/.config/nvim/lazy-lock.json new file mode 100644 index 0000000..9c17667 --- /dev/null +++ b/files/.config/nvim/lazy-lock.json @@ -0,0 +1,7 @@ +{ + "blink.cmp": { "branch": "main", "commit": "78336bc89ee5365633bcf754d93df01678b5c08f" }, + "friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" }, + "fzf.vim": { "branch": "master", "commit": "d2a59a992a2455f609c0fde2ebd84427ea8f919a" }, + "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, + "nvim-lspconfig": { "branch": "master", "commit": "51dbf5359da86721662c87ca10eb73add973737b" } +} diff --git a/files/.config/nvim/lazyvim.json b/files/.config/nvim/lazyvim.json new file mode 100644 index 0000000..d8bcaf6 --- /dev/null +++ b/files/.config/nvim/lazyvim.json @@ -0,0 +1,10 @@ +{ + "extras": [ + + ], + "install_version": 8, + "news": { + "NEWS.md": "11866" + }, + "version": 8 +} \ No newline at end of file diff --git a/files/.config/nvim/lua/config/fzf.lua b/files/.config/nvim/lua/config/fzf.lua new file mode 100644 index 0000000..9591982 --- /dev/null +++ b/files/.config/nvim/lua/config/fzf.lua @@ -0,0 +1,2 @@ +vim.keymap.set("n", "b", "Buffers") +vim.keymap.set("n", "f", "Files") diff --git a/files/.config/nvim/lua/config/lazy.lua b/files/.config/nvim/lua/config/lazy.lua new file mode 100644 index 0000000..2145915 --- /dev/null +++ b/files/.config/nvim/lua/config/lazy.lua @@ -0,0 +1,32 @@ +-- https://lazy.folke.io/installation +-- 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) + +-- Make sure to setup `mapleader` and `maplocalleader` before +-- loading lazy.nvim so that mappings are correct. +-- This is also a good place to setup other settings (vim.opt) +vim.g.mapleader = " " +vim.g.maplocalleader = "\\" + +-- Setup lazy.nvim +require("lazy").setup({ + spec = { + { import = "plugins" }, + }, + -- automatically check for plugin updates + checker = { enabled = true }, +}) diff --git a/files/.config/nvim/lua/config/lsp.lua b/files/.config/nvim/lua/config/lsp.lua new file mode 100644 index 0000000..f504e94 --- /dev/null +++ b/files/.config/nvim/lua/config/lsp.lua @@ -0,0 +1,21 @@ +vim.lsp.config('chicken', { + cmd = {'chicken-lsp-server'}, + filetypes = {'scheme'}, + root_markers = {'Makefile', 'build.meson', '.git'}, +}) +vim.diagnostic.config({ + virtual_text = true, + signs = true, + underline = true, + severity_sort = true, +}) +vim.lsp.enable('chicken') +-- requires clang-tools-extra +vim.lsp.enable('clangd') +-- requires lua-language-server +vim.lsp.enable('lua_ls') +-- requires rust-analyzer +vim.lsp.enable('rust_analyzer') +vim.keymap.set("n", "l", function() + vim.lsp.buf.format({ async = true }) +end, { desc = "Format buffer" }) diff --git a/files/.config/nvim/lua/config/options.lua b/files/.config/nvim/lua/config/options.lua new file mode 100644 index 0000000..165fd2c --- /dev/null +++ b/files/.config/nvim/lua/config/options.lua @@ -0,0 +1,7 @@ +vim.g.mapleader = " " +vim.g.maplocalleader = "," +vim.opt.smarttab = true +vim.opt.tabstop = 2 +vim.opt.shiftwidth = 2 +vim.opt.expandtab = true +vim.opt.clipboard = "unnamedplus" -- use system clipboard diff --git a/files/.config/nvim/lua/config/theme.lua b/files/.config/nvim/lua/config/theme.lua new file mode 100644 index 0000000..eefe3a9 --- /dev/null +++ b/files/.config/nvim/lua/config/theme.lua @@ -0,0 +1,2 @@ +vim.cmd.colorscheme("lunaperche") +vim.api.nvim_set_hl(0, "Normal", { bg = "NONE" }) diff --git a/files/.config/nvim/lua/plugins/fzf.lua b/files/.config/nvim/lua/plugins/fzf.lua new file mode 100644 index 0000000..3dfbbf6 --- /dev/null +++ b/files/.config/nvim/lua/plugins/fzf.lua @@ -0,0 +1,5 @@ +return { + { + 'https://github.com/junegunn/fzf.vim' + } +} diff --git a/files/.config/nvim/lua/plugins/lsp.lua b/files/.config/nvim/lua/plugins/lsp.lua new file mode 100644 index 0000000..b26a894 --- /dev/null +++ b/files/.config/nvim/lua/plugins/lsp.lua @@ -0,0 +1,27 @@ +return { + { + 'neovim/nvim-lspconfig', + event = { "BufReadPost", "BufNewFile" }, + cmd = { "LspInfo", "LspInstall", "LspUninstall" }, + }, + + { + 'saghen/blink.cmp', + dependencies = { 'rafamadriz/friendly-snippets' }, + version = '1.*', + opts = { + keymap = { + preset = 'super-tab', + [''] = { 'scroll_signature_up', 'fallback' }, + [''] = { 'scroll_signature_down', 'fallback' }, + }, + completion = { + documentation = { + auto_show = true, + auto_show_delay_ms = 50, + } + }, + signature = { enabled = true } + }, + } +} diff --git a/files/.config/nvim/nvim-pack-lock.json b/files/.config/nvim/nvim-pack-lock.json index 93f1306..aa0a3e4 100644 --- a/files/.config/nvim/nvim-pack-lock.json +++ b/files/.config/nvim/nvim-pack-lock.json @@ -1,5 +1,9 @@ { "plugins": { + "blink.cmp": { + "rev": "0e63407c28bd09ef0d3604478823f7f92dd8d9ec", + "src": "https://github.com/Saghen/blink.cmp" + }, "fzf.vim": { "rev": "d2a59a992a2455f609c0fde2ebd84427ea8f919a", "src": "https://github.com/junegunn/fzf.vim" diff --git a/files/.profile b/files/.profile index b171fc5..1a6028e 100644 --- a/files/.profile +++ b/files/.profile @@ -1,5 +1,5 @@ export ENV="$HOME/.kshrc" -export PATH="$HOME/.local/bin":"$PATH" +export PATH="$HOME/.local/bin":"$PATH":"/usr/lib/jvm/default-jdk/bin":"$HOME/.cargo/bin" export MANPATH="/usr/local/man":"$MANPATH" export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/:/usr/lib/pkgconfig export XKB_DEFAULT_LAYOUT=de @@ -16,6 +16,3 @@ if is_login; then echo 'Press return to start gui' read && exec startx fi -# OPS config -export OPS_DIR="$HOME/.ops" -export PATH="$HOME/.ops/bin:$PATH"