From 5e19cae8734f22ab7781e52073a998e6c0b3d9c6 Mon Sep 17 00:00:00 2001 From: baldeau Date: Fri, 13 Dec 2024 12:25:43 +0100 Subject: [PATCH] update --- DEPENDS.md | 3 +++ image.lua | 26 ++++++++++++++++++++++++++ lua/config/remap.lua | 4 ++++ lua/plugins/code_runner.lua | 16 ++++++++++++++++ lua/plugins/go.lua | 14 ++++++++++++++ lua/plugins/jupyter.lua | 6 ++++++ lua/plugins/lsp.lua | 3 +++ lua/plugins/prettier.lua | 1 + lua/plugins/quarto.lua | 36 ++++++++++++++++++++++++++++++++++++ lua/plugins/themes.lua | 15 ++++++++++++++- lua/plugins/treesitter.lua | 1 + lua/plugins/ui.lua | 1 + 12 files changed, 125 insertions(+), 1 deletion(-) create mode 100644 image.lua create mode 100644 lua/plugins/code_runner.lua create mode 100644 lua/plugins/go.lua create mode 100644 lua/plugins/jupyter.lua create mode 100644 lua/plugins/quarto.lua diff --git a/DEPENDS.md b/DEPENDS.md index 18fd31c..1215f1e 100644 --- a/DEPENDS.md +++ b/DEPENDS.md @@ -5,12 +5,15 @@ - git - nerd font compatible font - tree-sitter cli +- pyright (python lsp) +- black (python formatter) ## Languages - Dart - Rust - Golang +- Python ## Formatters diff --git a/image.lua b/image.lua new file mode 100644 index 0000000..e7a7195 --- /dev/null +++ b/image.lua @@ -0,0 +1,26 @@ + +-- enabled = true, +-- clear_in_insert_mode = false, +-- download_remote_images = true, +-- only_render_image_at_cursor = false, +-- filetypes = { "norg" }, +-- }, +-- html = { +-- enabled = false, +-- }, +-- css = { +-- enabled = false, +-- }, +-- }, +-- max_width = nil, +-- max_height = nil, +-- max_width_window_percentage = nil, +-- max_height_window_percentage = 50, +-- window_overlap_clear_enabled = false, -- toggles images when windows are overlapped +-- window_overlap_clear_ft_ignore = { "cmp_menu", "cmp_docs", "" }, +-- editor_only_render_when_focused = false, -- auto show/hide images when the editor gains/looses focus +-- tmux_show_only_in_active_window = false, -- auto show/hide images in the correct Tmux window (needs visual-activity off) +-- hijack_file_patterns = { "*.png", "*.jpg", "*.jpeg", "*.gif", "*.webp", "*.avif" }, -- render image files as images when opened +-- }) +-- end, +-- } diff --git a/lua/config/remap.lua b/lua/config/remap.lua index a776315..c1ba4a3 100644 --- a/lua/config/remap.lua +++ b/lua/config/remap.lua @@ -95,3 +95,7 @@ vim.keymap.set("n", "l", require("smart-splits").swap_buf_right) vim.keymap.set("n", "e", function() vim.diagnostic.open_float(nil, { focus = true, scope = "cursor" }) end) + +-- Molten +-- vim.keymap.set("n", "", ":MoltenEvaluateLine", {}) +-- vim.keymap.set("n", "", ":MoltenEvaluateLine", {}) diff --git a/lua/plugins/code_runner.lua b/lua/plugins/code_runner.lua new file mode 100644 index 0000000..93fa6af --- /dev/null +++ b/lua/plugins/code_runner.lua @@ -0,0 +1,16 @@ +return { + "CRAG666/code_runner.nvim", + dependencies = { + "CRAG666/betterTerm.nvim", + }, + config = function() + require("code_runner").setup({ + filetype = { + dart = { + "cd $dir &&", + "dart run $fileName", + }, + }, + }) + end, +} diff --git a/lua/plugins/go.lua b/lua/plugins/go.lua new file mode 100644 index 0000000..b20f507 --- /dev/null +++ b/lua/plugins/go.lua @@ -0,0 +1,14 @@ +return { + "ray-x/go.nvim", + dependencies = { -- optional packages + "ray-x/guihua.lua", + "neovim/nvim-lspconfig", + "nvim-treesitter/nvim-treesitter", + }, + config = function() + require("go").setup() + end, + event = { "CmdlineEnter" }, + ft = { "go", "gomod" }, + build = ':lua require("go.install").update_all_sync()', -- if you need to install/update all binaries +} diff --git a/lua/plugins/jupyter.lua b/lua/plugins/jupyter.lua new file mode 100644 index 0000000..e09cc24 --- /dev/null +++ b/lua/plugins/jupyter.lua @@ -0,0 +1,6 @@ +return { + "benlubas/molten-nvim", + version = "^1.0.0", + build = ":UpdateRemotePlugins", + init = function() end, +} diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index 4c95078..4bba279 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -145,6 +145,9 @@ return { require("lspconfig")["sourcekit"].setup({ capabilities = capabilities, }) + require("lspconfig")["pylsp"].setup({ + capabilities = capabilities, + }) require("lspconfig")["clangd"].setup({ cmd = { "clangd", diff --git a/lua/plugins/prettier.lua b/lua/plugins/prettier.lua index 4fdce65..8269110 100644 --- a/lua/plugins/prettier.lua +++ b/lua/plugins/prettier.lua @@ -13,6 +13,7 @@ return { swift = { "swiftformat" }, c = { "clang-format" }, cpp = { "clang-format" }, + python = { "black" }, }, }) end, diff --git a/lua/plugins/quarto.lua b/lua/plugins/quarto.lua new file mode 100644 index 0000000..f513733 --- /dev/null +++ b/lua/plugins/quarto.lua @@ -0,0 +1,36 @@ +return { + { + "quarto-dev/quarto-nvim", + dependencies = { + "jmbuhr/otter.nvim", + "nvim-treesitter/nvim-treesitter", + }, + config = function() + require("quarto").setup({ + debug = false, + lspFeatures = { + enabled = true, + chunks = "curly", + languages = { "r", "python", "bash", "html" }, + diagnostics = { + enabled = true, + triggers = { "BufWritePost" }, + }, + completion = { + enabled = true, + }, + }, + codeRunner = { + enabled = true, + default_method = "molten", -- 'molten' or 'slime' + ft_runners = {}, -- filetype to runner, ie. `{ python = "molten" }`. + -- Takes precedence over `default_method` + never_run = { "yaml" }, -- filetypes which are never sent to a code runner + }, + }) + local runner = require("quarto.runner") + vim.keymap.set("n", "", runner.run_cell, { desc = "run cell", silent = true }) + vim.keymap.set("n", "", runner.run_cell, { desc = "run cell", silent = true }) + end, + }, +} diff --git a/lua/plugins/themes.lua b/lua/plugins/themes.lua index 0c18f37..966ca2c 100644 --- a/lua/plugins/themes.lua +++ b/lua/plugins/themes.lua @@ -23,7 +23,7 @@ return { end, set_light_mode = function() local uname = vim.loop.os_uname() - if uname.sysname == 'Linux' then + if uname.sysname == "Linux" then vim.api.nvim_set_option_value("background", "dark", {}) vim.cmd("colorscheme moonfly") else @@ -33,4 +33,17 @@ return { end, }, }, + { + "ray-x/aurora", + init = function() + vim.g.aurora_italic = 1 + vim.g.aurora_transparent = 1 + vim.g.aurora_bold = 1 + end, + config = function() + vim.cmd.colorscheme("aurora") + -- override defaults + vim.api.nvim_set_hl(0, "@number", { fg = "#e933e3" }) + end, + }, } diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index f57e7e6..2c5b67a 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -10,6 +10,7 @@ return { "go", "lua", "vim", + "go", }, auto_install = true, }, diff --git a/lua/plugins/ui.lua b/lua/plugins/ui.lua index 82729dc..cb32896 100644 --- a/lua/plugins/ui.lua +++ b/lua/plugins/ui.lua @@ -16,6 +16,7 @@ return { }, { "mrjones2014/smart-splits.nvim", + priority = 1000, build = "./kitty/install-kittens.bash", }, {