From 5f65b1504c6b6bdace5b8aa7bc9adf2e30780545 Mon Sep 17 00:00:00 2001 From: Maximilian Wolf <69987866+MaxWolf-01@users.noreply.github.com> Date: Wed, 23 Oct 2024 00:50:00 +0200 Subject: [PATCH] scaffold nvim setup --- .gitignore | 1 + install.conf.yaml | 1 + nvim/init.lua | 39 +++++++++ nvim/lua/filetypes.lua | 11 +++ nvim/lua/lazy.lua | 48 +++++++++++ nvim/lua/lsps/bashls.lua | 1 + nvim/lua/lsps/biome.lua | 1 + .../lsps/docker_compose_language_service.lua | 1 + nvim/lua/lsps/elixirls.lua | 5 ++ nvim/lua/lsps/gleam.lua | 1 + nvim/lua/lsps/golangci_lint_ls.lua | 1 + nvim/lua/lsps/gopls.lua | 14 ++++ nvim/lua/lsps/hls.lua | 1 + nvim/lua/lsps/html.lua | 1 + nvim/lua/lsps/jdtls.lua | 3 + nvim/lua/lsps/jsonls.lua | 1 + nvim/lua/lsps/lua_ls.lua | 26 ++++++ nvim/lua/lsps/nil_ls.lua | 1 + nvim/lua/lsps/nixd.lua | 1 + nvim/lua/lsps/pyright.lua | 10 +++ nvim/lua/lsps/rust_analyzer.lua | 20 +++++ nvim/lua/lsps/tailwindcss.lua | 1 + nvim/lua/lsps/ts_ls.lua | 11 +++ nvim/lua/lsps/zls.lua | 1 + nvim/lua/mappings.lua | 41 ++++++++++ nvim/lua/options.lua | 26 ++++++ nvim/lua/plugins/cmp.lua | 73 +++++++++++++++++ nvim/lua/plugins/conform.lua | 49 +++++++++++ nvim/lua/plugins/lspconfig.lua | 82 +++++++++++++++++++ nvim/lua/plugins/luasnip.lua | 10 +++ nvim/lua/plugins/mason.lua | 18 ++++ nvim/lua/plugins/oil.lua | 15 ++++ nvim/lua/plugins/telescope.lua | 28 +++++++ nvim/lua/plugins/tresitter.lua | 33 ++++++++ nvim/lua/plugins/which-key.lua | 6 ++ setup | 7 +- zsh/aliases | 3 + 37 files changed, 589 insertions(+), 3 deletions(-) create mode 100644 nvim/init.lua create mode 100644 nvim/lua/filetypes.lua create mode 100644 nvim/lua/lazy.lua create mode 100644 nvim/lua/lsps/bashls.lua create mode 100644 nvim/lua/lsps/biome.lua create mode 100644 nvim/lua/lsps/docker_compose_language_service.lua create mode 100644 nvim/lua/lsps/elixirls.lua create mode 100644 nvim/lua/lsps/gleam.lua create mode 100644 nvim/lua/lsps/golangci_lint_ls.lua create mode 100644 nvim/lua/lsps/gopls.lua create mode 100644 nvim/lua/lsps/hls.lua create mode 100644 nvim/lua/lsps/html.lua create mode 100644 nvim/lua/lsps/jdtls.lua create mode 100644 nvim/lua/lsps/jsonls.lua create mode 100644 nvim/lua/lsps/lua_ls.lua create mode 100644 nvim/lua/lsps/nil_ls.lua create mode 100644 nvim/lua/lsps/nixd.lua create mode 100644 nvim/lua/lsps/pyright.lua create mode 100644 nvim/lua/lsps/rust_analyzer.lua create mode 100644 nvim/lua/lsps/tailwindcss.lua create mode 100644 nvim/lua/lsps/ts_ls.lua create mode 100644 nvim/lua/lsps/zls.lua create mode 100644 nvim/lua/mappings.lua create mode 100644 nvim/lua/options.lua create mode 100644 nvim/lua/plugins/cmp.lua create mode 100644 nvim/lua/plugins/conform.lua create mode 100644 nvim/lua/plugins/lspconfig.lua create mode 100644 nvim/lua/plugins/luasnip.lua create mode 100644 nvim/lua/plugins/mason.lua create mode 100644 nvim/lua/plugins/oil.lua create mode 100644 nvim/lua/plugins/telescope.lua create mode 100644 nvim/lua/plugins/tresitter.lua create mode 100644 nvim/lua/plugins/which-key.lua diff --git a/.gitignore b/.gitignore index bead48e..3815742 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ bin *TODO* *todo* secrets +*/**lock.json diff --git a/install.conf.yaml b/install.conf.yaml index 5faf0fd..7a6ed3c 100644 --- a/install.conf.yaml +++ b/install.conf.yaml @@ -27,6 +27,7 @@ ~/.ideavimrc: vim/ideavimrc ~/bin: bin ~/.icons: desktop/icons + ~/.config/nvim: nvim - create: diff --git a/nvim/init.lua b/nvim/init.lua new file mode 100644 index 0000000..f04a0e0 --- /dev/null +++ b/nvim/init.lua @@ -0,0 +1,39 @@ +vim.g.mapleader = " " + +-- Setup package manager +local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim" +if not vim.loop.fs_stat(lazypath) then + local repo = "https://github.com/folke/lazy.nvim.git" + vim.fn.system { + "git", + "clone", + "--filter=blob:none", + repo, + "--branch=stable", + lazypath, + } +end +vim.opt.rtp:prepend(lazypath) + +require "options" + +require("lazy").setup("plugins", require "lazy") + +vim.schedule(function() + vim.filetype.add(require "filetypes") + require "mappings" +end) + +-- vim.cmd.colorscheme "catppuccin" + +-- Add the mason binary path to the PATH variable, so that plugins, such as +-- conform, can use the mason binaries. +local function configure_mason_path() + local is_windows = vim.fn.has "win32" ~= 0 + local sep = is_windows and "\\" or "/" + local delim = is_windows and ";" or ":" + vim.env.PATH = table.concat({ vim.fn.stdpath "data", "mason", "bin" }, sep) + .. delim + .. vim.env.PATH +end +configure_mason_path() diff --git a/nvim/lua/filetypes.lua b/nvim/lua/filetypes.lua new file mode 100644 index 0000000..3294f0d --- /dev/null +++ b/nvim/lua/filetypes.lua @@ -0,0 +1,11 @@ +return { + extension = { + ebnf = "ebnf", + mdx = "markdown", + }, + + filename = { + justfile = "just", + }, +} + diff --git a/nvim/lua/lazy.lua b/nvim/lua/lazy.lua new file mode 100644 index 0000000..862f667 --- /dev/null +++ b/nvim/lua/lazy.lua @@ -0,0 +1,48 @@ +return { + defaults = { lazy = true }, + -- install = { colorscheme = { "catppuccin" } }, + + ui = { + icons = { + ft = "", + lazy = "󰂠 ", + loaded = "", + not_loaded = "", + }, + }, + + performance = { + rtp = { + disabled_plugins = { + "2html_plugin", + "tohtml", + "getscript", + "getscriptPlugin", + "gzip", + "logipat", + "netrw", + "netrwPlugin", + "netrwSettings", + "netrwFileHandlers", + "matchit", + "tar", + "tarPlugin", + "rrhelper", + "spellfile_plugin", + "vimball", + "vimballPlugin", + "zip", + "zipPlugin", + "tutor", + -- "rplugin", + "syntax", + "synmenu", + "optwin", + "compiler", + "bugreport", + "ftplugin", + }, + }, + }, +} + diff --git a/nvim/lua/lsps/bashls.lua b/nvim/lua/lsps/bashls.lua new file mode 100644 index 0000000..a564707 --- /dev/null +++ b/nvim/lua/lsps/bashls.lua @@ -0,0 +1 @@ +return {} diff --git a/nvim/lua/lsps/biome.lua b/nvim/lua/lsps/biome.lua new file mode 100644 index 0000000..a564707 --- /dev/null +++ b/nvim/lua/lsps/biome.lua @@ -0,0 +1 @@ +return {} diff --git a/nvim/lua/lsps/docker_compose_language_service.lua b/nvim/lua/lsps/docker_compose_language_service.lua new file mode 100644 index 0000000..a564707 --- /dev/null +++ b/nvim/lua/lsps/docker_compose_language_service.lua @@ -0,0 +1 @@ +return {} diff --git a/nvim/lua/lsps/elixirls.lua b/nvim/lua/lsps/elixirls.lua new file mode 100644 index 0000000..dd5077d --- /dev/null +++ b/nvim/lua/lsps/elixirls.lua @@ -0,0 +1,5 @@ +return { + cmd = { + vim.fn.stdpath "data" .. "/mason/packages/elixir-ls/language_server.sh", + }, +} diff --git a/nvim/lua/lsps/gleam.lua b/nvim/lua/lsps/gleam.lua new file mode 100644 index 0000000..a564707 --- /dev/null +++ b/nvim/lua/lsps/gleam.lua @@ -0,0 +1 @@ +return {} diff --git a/nvim/lua/lsps/golangci_lint_ls.lua b/nvim/lua/lsps/golangci_lint_ls.lua new file mode 100644 index 0000000..a564707 --- /dev/null +++ b/nvim/lua/lsps/golangci_lint_ls.lua @@ -0,0 +1 @@ +return {} diff --git a/nvim/lua/lsps/gopls.lua b/nvim/lua/lsps/gopls.lua new file mode 100644 index 0000000..e73c79c --- /dev/null +++ b/nvim/lua/lsps/gopls.lua @@ -0,0 +1,14 @@ +return { + settings = { + gopls = { + completeUnimported = true, + usePlaceholders = true, + analyses = { + unusedparams = true, + }, + }, + env = { + GOEXPERIMENT = "rangefunc", + }, + }, +} diff --git a/nvim/lua/lsps/hls.lua b/nvim/lua/lsps/hls.lua new file mode 100644 index 0000000..a564707 --- /dev/null +++ b/nvim/lua/lsps/hls.lua @@ -0,0 +1 @@ +return {} diff --git a/nvim/lua/lsps/html.lua b/nvim/lua/lsps/html.lua new file mode 100644 index 0000000..a564707 --- /dev/null +++ b/nvim/lua/lsps/html.lua @@ -0,0 +1 @@ +return {} diff --git a/nvim/lua/lsps/jdtls.lua b/nvim/lua/lsps/jdtls.lua new file mode 100644 index 0000000..ea95d71 --- /dev/null +++ b/nvim/lua/lsps/jdtls.lua @@ -0,0 +1,3 @@ +return { + cmd = { "jdtls" }, +} diff --git a/nvim/lua/lsps/jsonls.lua b/nvim/lua/lsps/jsonls.lua new file mode 100644 index 0000000..a564707 --- /dev/null +++ b/nvim/lua/lsps/jsonls.lua @@ -0,0 +1 @@ +return {} diff --git a/nvim/lua/lsps/lua_ls.lua b/nvim/lua/lsps/lua_ls.lua new file mode 100644 index 0000000..9d91af2 --- /dev/null +++ b/nvim/lua/lsps/lua_ls.lua @@ -0,0 +1,26 @@ +local rtp = vim.api.nvim_list_runtime_paths() +local library_paths = { + vim.fn.expand "$VIMRUNTIME/lua", + vim.fn.expand "$VIMRUNTIME/lua/vim/lsp", +} +for _, path in ipairs(rtp) do + local lua_path = path .. "/lua" + if vim.fn.isdirectory(lua_path) == 1 then + table.insert(library_paths, lua_path) + end +end + +return { + settings = { + Lua = { + diagnostics = { + globals = { "vim" }, + }, + workspace = { + library = library_paths, + maxPreload = 100000, + preloadFileSize = 10000, + }, + }, + }, +} diff --git a/nvim/lua/lsps/nil_ls.lua b/nvim/lua/lsps/nil_ls.lua new file mode 100644 index 0000000..a564707 --- /dev/null +++ b/nvim/lua/lsps/nil_ls.lua @@ -0,0 +1 @@ +return {} diff --git a/nvim/lua/lsps/nixd.lua b/nvim/lua/lsps/nixd.lua new file mode 100644 index 0000000..a564707 --- /dev/null +++ b/nvim/lua/lsps/nixd.lua @@ -0,0 +1 @@ +return {} diff --git a/nvim/lua/lsps/pyright.lua b/nvim/lua/lsps/pyright.lua new file mode 100644 index 0000000..1f8a183 --- /dev/null +++ b/nvim/lua/lsps/pyright.lua @@ -0,0 +1,10 @@ +return { + settings = { + python = { + analysis = { + autoSearchPaths = true, + typeCheckingMode = "basic", + }, + }, + }, +} diff --git a/nvim/lua/lsps/rust_analyzer.lua b/nvim/lua/lsps/rust_analyzer.lua new file mode 100644 index 0000000..101fcfa --- /dev/null +++ b/nvim/lua/lsps/rust_analyzer.lua @@ -0,0 +1,20 @@ +return { + settings = { + ["rust-analyzer"] = { + check = { + command = "clippy", + }, + diagnostics = { + enable = true, + }, + cargo = { + buildScripts = { + enable = true, + }, + }, + }, + }, + on_attach = function(_, bufnr) + vim.lsp.inlay_hint.enable(true, { bufnr = bufnr }) + end, +} diff --git a/nvim/lua/lsps/tailwindcss.lua b/nvim/lua/lsps/tailwindcss.lua new file mode 100644 index 0000000..a564707 --- /dev/null +++ b/nvim/lua/lsps/tailwindcss.lua @@ -0,0 +1 @@ +return {} diff --git a/nvim/lua/lsps/ts_ls.lua b/nvim/lua/lsps/ts_ls.lua new file mode 100644 index 0000000..02f6c03 --- /dev/null +++ b/nvim/lua/lsps/ts_ls.lua @@ -0,0 +1,11 @@ +return { + init_options = { + preferences = { + importModuleSpecifierPreference = "non-relative", + }, + }, + + on_attach = function(client, bufnr) + require("twoslash-queries").attach(client, bufnr) + end, +} diff --git a/nvim/lua/lsps/zls.lua b/nvim/lua/lsps/zls.lua new file mode 100644 index 0000000..a564707 --- /dev/null +++ b/nvim/lua/lsps/zls.lua @@ -0,0 +1 @@ +return {} diff --git a/nvim/lua/mappings.lua b/nvim/lua/mappings.lua new file mode 100644 index 0000000..b97255d --- /dev/null +++ b/nvim/lua/mappings.lua @@ -0,0 +1,41 @@ +local map = vim.keymap.set + +-- ==================================================================== +-- lsp +-- ==================================================================== + +map("n", "gD", vim.lsp.buf.declaration, { silent = true }) +map("n", "gd", vim.lsp.buf.definition, { silent = true }) +map("n", "gi", vim.lsp.buf.implementation, { silent = true }) +map("n", "gs", vim.lsp.buf.signature_help, { silent = true }) +-- TODO see :help vim.lsp.buf + +-- ==================================================================== +-- diagnostic +-- ==================================================================== + +map("n", "[d", vim.diagnostic.goto_prev, { silent = true }) +map("n", "]d", vim.diagnostic.goto_next, { silent = true }) +map("n", "gef", vim.diagnostic.open_float, { silent = true }) +map("n", "geq", vim.diagnostic.setqflist, { silent = true }) + +-- ==================================================================== +-- oil +-- ==================================================================== + +map("n", "-", "Oil", { silent = true }) + +-- ==================================================================== +-- telescope +-- ==================================================================== + +map("n", "ff", ":Telescope find_files", { silent = true }) +map("n", "fw", ":Telescope live_grep", { silent = true }) +map("n", "fb", ":Telescope buffers", { silent = true }) +map("n", "gi", ":Telescope lsp_implementations", { silent = true }) +map("n", "gd", ":Telescope lsp_definitions", { silent = true }) +map("n", "gr", ":Telescope lsp_references", { silent = true }) +map("n", "gl", ":Telescope diagnostics", { silent = true }) + +-- https://github.com/lukasl-dev/nixos/blob/master/dots/nvim/lua/mappings.lua + diff --git a/nvim/lua/options.lua b/nvim/lua/options.lua new file mode 100644 index 0000000..7f95fba --- /dev/null +++ b/nvim/lua/options.lua @@ -0,0 +1,26 @@ +local o = vim.opt + +o.colorcolumn = "80" +o.showmode = false + +o.number = true +o.relativenumber = true +o.numberwidth = 2 +o.ruler = false + +o.expandtab = true +o.shiftwidth = 2 +o.smartindent = true +o.tabstop = 2 +o.softtabstop = 2 + +o.signcolumn = "yes" +o.splitbelow = true +o.splitright = true +o.timeoutlen = 400 +o.undofile = true + +o.clipboard = "unnamedplus" +o.cursorline = true +o.cursorlineopt = "number" + diff --git a/nvim/lua/plugins/cmp.lua b/nvim/lua/plugins/cmp.lua new file mode 100644 index 0000000..b0a7cfa --- /dev/null +++ b/nvim/lua/plugins/cmp.lua @@ -0,0 +1,73 @@ +return { + { + "hrsh7th/nvim-cmp", + + ---@module "cmp" + ---@return cmp.ConfigSchema + opts = function() + local cmp = require "cmp" + + return { + snippet = { + expand = function(args) + require("luasnip").lsp_expand(args.body) + end, + }, + preselect = cmp.PreselectMode.Item, + window = { + completion = { + scrollbar = false, + border = "rounded", + winhighlight = "Normal:CmpNormal", + }, + }, + mapping = { + [""] = cmp.mapping.select_prev_item(), + [""] = cmp.mapping.select_next_item(), + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.complete(), + [""] = cmp.mapping.close(), + [""] = cmp.mapping.confirm { + behavior = cmp.ConfirmBehavior.Insert, + select = true, + }, + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + elseif require("luasnip").expand_or_jumpable() then + require("luasnip").expand_or_jump() + else + fallback() + end + end, { "i", "s" }), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif require("luasnip").jumpable(-1) then + require("luasnip").jump(-1) + else + fallback() + end + end, { "i", "s" }), + }, + sources = { + { name = "nvim_lsp" }, + { name = "luasnip" }, + { name = "buffer" }, + { name = "nvim_lua" }, + { name = "path" }, + }, + } + end, + }, + + { + "saadparwaiz1/cmp_luasnip", + "hrsh7th/cmp-nvim-lua", + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + }, +} + diff --git a/nvim/lua/plugins/conform.lua b/nvim/lua/plugins/conform.lua new file mode 100644 index 0000000..f923ea2 --- /dev/null +++ b/nvim/lua/plugins/conform.lua @@ -0,0 +1,49 @@ +local function is_available(bufnr, formatter) + return require("conform").get_formatter_info(formatter, bufnr).available +end + +local function javascript(bufnr) + if is_available(bufnr, "biome") then + return { "biome" } + end + return { "prettier", "eslint" } +end + +return { + "stevearc/conform.nvim", + + event = "BufWritePre", + + opts = { + formatters_by_ft = { + lua = { "stylua" }, + go = function(bufnr) + if is_available(bufnr, "gofumpt") then + return { "goimports", "gofumpt" } + end + return { "goimports", "gofmt" } + end, + markdown = { "mdformat" }, + python = function(bufnr) + if is_available(bufnr, "ruff_format") then + return { "ruff_format" } + end + return { "isort", "black" } + end, + typescript = javascript, + typescriptreact = javascript, + javascript = javascript, + javascriptreact = javascript, + zig = { "zigfmt" }, + nix = { "nixfmt" }, + just = { "just" }, + rust = { "rustfmt", lsp_format = "fallback" }, + }, + + format_on_save = { + timeout_ms = 500, + lsp_fallback = true, + }, + }, +} + diff --git a/nvim/lua/plugins/lspconfig.lua b/nvim/lua/plugins/lspconfig.lua new file mode 100644 index 0000000..d5f2a4e --- /dev/null +++ b/nvim/lua/plugins/lspconfig.lua @@ -0,0 +1,82 @@ +-- TODO: sign_define() is deprecated +vim.fn.sign_define( + "DiagnosticSignError", + { text = "", texthl = "DiagnosticSignError" } +) +vim.fn.sign_define( + "DiagnosticSignWarn", + { text = "", texthl = "DiagnosticSignWarn" } +) +vim.fn.sign_define( + "DiagnosticSignInfo", + { text = "", texthl = "DiagnosticSignInfo" } +) +vim.fn.sign_define( + "DiagnosticSignHint", + { text = "", texthl = "DiagnosticSignHint" } +) + +local function on_attach(_, _) end + +local function on_init(client, _) + if client.supports_method "textDocument/semanticTokens" then + client.server_capabilities.semanticTokensProvider = nil + end +end + +local function get_capabilities() + return require("cmp_nvim_lsp").default_capabilities() + + -- local capabilities = vim.lsp.protocol.make_client_capabilities() + -- capabilities.textDocument.completion.completionItem = { + -- documentationFormat = { "markdown", "plaintext" }, + -- snippetSupport = true, + -- preselectSupport = true, + -- insertReplaceSupport = true, + -- labelDetailsSupport = true, + -- deprecatedSupport = true, + -- commitCharactersSupport = true, + -- tagSupport = { valueSet = { 1 } }, + -- resolveSupport = { + -- properties = { + -- "documentation", + -- "detail", + -- "additionalTextEdits", + -- }, + -- }, + -- } + -- return capabilities +end + +return { + "neovim/nvim-lspconfig", + + config = function() + local lsp_files = vim.api.nvim_get_runtime_file("lua/lsps/*.lua", true) + for _, file in ipairs(lsp_files) do + local lsp_name = file:match "([^/]+)%.%w+$" + + local opts = require("lsps." .. lsp_name) + opts.capabilities = get_capabilities() + + local overriden_on_attach = opts.on_attach + opts.on_attach = function(client, bufnr) + on_attach(client, bufnr) + if overriden_on_attach then + overriden_on_attach(client, bufnr) + end + end + + local overriden_on_init = opts.on_init + opts.on_init = function(client, result) + on_init(client, result) + if overriden_on_init then + overriden_on_init(client, result) + end + end + + require("lspconfig")[lsp_name].setup(require("lsps." .. lsp_name)) + end + end, +} + diff --git a/nvim/lua/plugins/luasnip.lua b/nvim/lua/plugins/luasnip.lua new file mode 100644 index 0000000..ba797c9 --- /dev/null +++ b/nvim/lua/plugins/luasnip.lua @@ -0,0 +1,10 @@ +return { + "L3MON4D3/LuaSnip", + + config = function() + require("luasnip.loaders.from_lua").load() + require("luasnip.loaders.from_lua").lazy_load { + paths = vim.g.lua_snippets_path or "", + } + end, +} diff --git a/nvim/lua/plugins/mason.lua b/nvim/lua/plugins/mason.lua new file mode 100644 index 0000000..1754163 --- /dev/null +++ b/nvim/lua/plugins/mason.lua @@ -0,0 +1,18 @@ +return { + "williamboman/mason.nvim", + + cmd = { "Mason", "MasonInstall", "MasonInstallAll", "MasonUpdate" }, + + opts = { + ui = { + icons = { + package_pending = " ", + package_installed = " ", + package_uninstalled = " ", + }, + }, + + max_concurrent_installers = 10, + }, +} + diff --git a/nvim/lua/plugins/oil.lua b/nvim/lua/plugins/oil.lua new file mode 100644 index 0000000..b4e75e9 --- /dev/null +++ b/nvim/lua/plugins/oil.lua @@ -0,0 +1,15 @@ +return { + "stevearc/oil.nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, + + event = "BufWinEnter", + + opts = { + columns = { + "icon", + "permissions", + "size", + }, + }, +} + diff --git a/nvim/lua/plugins/telescope.lua b/nvim/lua/plugins/telescope.lua new file mode 100644 index 0000000..99e38fd --- /dev/null +++ b/nvim/lua/plugins/telescope.lua @@ -0,0 +1,28 @@ +return { + "nvim-telescope/telescope.nvim", + dependencies = { "nvim-treesitter/nvim-treesitter" }, + + cmd = "Telescope", + + opts = { + defaults = { + theme = "dropdown", + prompt_prefix = "  ", + selection_caret = " ", + entry_prefix = " ", + sorting_strategy = "ascending", + layout_config = { + horizontal = { + prompt_position = "top", + preview_width = 0.55, + }, + width = 0.87, + height = 0.80, + }, + mappings = { + n = { ["q"] = require("telescope.actions").close }, + }, + }, + }, +} + diff --git a/nvim/lua/plugins/tresitter.lua b/nvim/lua/plugins/tresitter.lua new file mode 100644 index 0000000..423a6e8 --- /dev/null +++ b/nvim/lua/plugins/tresitter.lua @@ -0,0 +1,33 @@ +return { + { + "nvim-treesitter/nvim-treesitter", + + event = { "BufReadPost", "BufNewFile" }, + cmd = { "TSInstall", "TSBufEnable", "TSBufDisable", "TSModuleInfo" }, + + opts = { + ensure_installed = { "lua", "luadoc", "printf", "vim", "vimdoc" }, + + highlight = { + enable = true, + use_languagetree = true, + }, + + indent = { + enable = true, + }, + }, + + config = function(_, opts) + require("nvim-treesitter.configs").setup(opts) + end, + }, + + { + "IndianBoy42/tree-sitter-just", + dependencies = { "nvim-treesitter/nvim-treesitter" }, + + opts = {}, + }, +} + diff --git a/nvim/lua/plugins/which-key.lua b/nvim/lua/plugins/which-key.lua new file mode 100644 index 0000000..b551ffc --- /dev/null +++ b/nvim/lua/plugins/which-key.lua @@ -0,0 +1,6 @@ +return { + "folke/which-key.nvim", + event = "VeryLazy", + opts = {} +} + diff --git a/setup b/setup index a4b3e0e..4b4a95d 100755 --- a/setup +++ b/setup @@ -56,9 +56,6 @@ cli() { zsh zsh/plugin-files/zap_zsh_install # minimal zsh plugin manager sudo chsh -s "$(which zsh)" "$USER" # set zsh as default shell - # vim plugin manager - curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim - # fuzzy finder if [ ! -d "$HOME/.fzf" ]; then git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf; fi; cd ~/.fzf && git pull && ~/.fzf/install @@ -83,6 +80,8 @@ cli() { sudo apt install -y fastfetch fi + nvim + ### remove bloat # screen reader sudo apt-get remove -y orca @@ -155,6 +154,8 @@ nvim() { wget -O "$appimage_path" "$appimage_url" chmod +x "$appimage_path" echo "Neovim AppImage downloaded and set up at $appimage_path" +# echo "Setting up nerd-fonts" +# curl -o ~/.local/share/fonts/font.tar.xz -L https://github.com/ryanoasis/nerd-fonts/releases/latest/download/UbuntuSans.tar.xz && tar -xf ~/.local/share/fonts/font.tar.xz -C ~/.local/share/fonts && rm ~/.local/share/fonts/font.tar.xz && fc-cache -fv } toolbox() { diff --git a/zsh/aliases b/zsh/aliases index e4f009e..e8714d8 100644 --- a/zsh/aliases +++ b/zsh/aliases @@ -3,6 +3,9 @@ if command -v uv > /dev/null 2>&1; then alias pip='uv pip' fi +alias vi='nvim' +alias vim='nvim' + # git # ####### alias g='git'