diff --git a/.config/nvim/lua/plugins/completions.lua b/.config/nvim/lua/plugins/completions.lua index 2770861..615a8f5 100644 --- a/.config/nvim/lua/plugins/completions.lua +++ b/.config/nvim/lua/plugins/completions.lua @@ -1,15 +1,15 @@ return { - { - "L3MON4D3/LuaSnip", - dependencies = { - "saadparwaiz1/cmp_luasnip", -- Snippets source for nvim-cmp - "rafamadriz/friendly-snippets", -- Collection of snippets - }, - }, +-- { +-- "L3MON4D3/LuaSnip", +-- dependencies = { +-- "saadparwaiz1/cmp_luasnip", -- Snippets source for nvim-cmp +-- "rafamadriz/friendly-snippets", -- Collection of snippets +-- }, +-- }, { "hrsh7th/nvim-cmp", config = function() - require("luasnip.loaders.from_vscode").lazy_load() -- Load snippets from friendly-snippets +-- require("luasnip.loaders.from_vscode").lazy_load() -- Load snippets from friendly-snippets local cmp = require("cmp") cmp.setup({ @@ -31,7 +31,7 @@ return { [""] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. }), sources = cmp.config.sources({ - --{ name = "nvim_lsp" }, + { name = "nvim_lsp" }, -- Show suggestions from LSP { name = "luasnip" }, -- For luasnip users. }, { { name = "buffer" }, diff --git a/.config/nvim/lua/plugins/debugging.lua b/.config/nvim/lua/plugins/debugging.lua index 2df6154..5b1431e 100644 --- a/.config/nvim/lua/plugins/debugging.lua +++ b/.config/nvim/lua/plugins/debugging.lua @@ -69,7 +69,11 @@ return { }, keys = { { "ea", "VenvSelect", desc = "Activate Virtual Environment" }, - { "es", "lua print(require('venv-selector').venv())", desc = "Show Active Virtual Environment" }, + { + "es", + "lua print(require('venv-selector').venv())", + desc = "Show Active Virtual Environment", + }, }, opts = { search = { @@ -80,10 +84,13 @@ return { command = "fdfind -p '.*/bin/python$' ~/Code/.venvs", }, }, - post_set_venv = function() - local venv_path = require("venv-selector").get_active_path() - vim.env.PYTHONPATH = venv_path .. "/lib/python3.*/site-packages" - end + options = { + on_venv_activate_callback = function() + local python_path = require("venv-selector").python() + --print("Active python: " .. python_path) + vim.env.PYTHONPATH = python_path + end, + }, }, }, } diff --git a/.config/nvim/lua/plugins/language-server.lua b/.config/nvim/lua/plugins/language-server.lua index 45eb12e..50b7e0f 100644 --- a/.config/nvim/lua/plugins/language-server.lua +++ b/.config/nvim/lua/plugins/language-server.lua @@ -1,75 +1,112 @@ return { - { - "mason-org/mason.nvim", - tag = "v1.11.0", - config = function() - require("mason").setup({}) - end, - }, - { - "mason-org/mason-lspconfig.nvim", - tag = "v1.32.0", - config = function() - require("mason-lspconfig").setup({ - ensure_installed = { - "lua_ls", - "bashls", - "dockerls", - --"gh-actions-language-server", - "helm_ls", - "jsonls", - "marksman", - "nginx_language_server", - "pyright", - "ruff", - "yamlls", - }, - }) - end, - }, - { - "nvimtools/none-ls.nvim", - config = function() - local null_ls = require("null-ls") - null_ls.setup({ - sources = { - null_ls.builtins.formatting.stylua, - null_ls.builtins.formatting.mdformat, - }, - }) - vim.keymap.set("n", "af", vim.lsp.buf.format, { desc = "Auto-Format File" }) - end, - }, - { - "neovim/nvim-lspconfig", - tag = "v1.8.0", - lazy = true, - event = { "BufReadPost", "BufNewFile" }, - dependencies = { - "mason-org/mason.nvim", - "mason-org/mason-lspconfig.nvim", - }, - config = function() - local capabilities = require("cmp_nvim_lsp").default_capabilities() - local lspconfig = require("lspconfig") - lspconfig.ts_ls.setup({ - capabilities = capabilities, - }) - lspconfig.lua_ls.setup({ capabilities = capabilities }) - lspconfig.bashls.setup({ capabilities = capabilities }) - lspconfig.dockerls.setup({ capabilities = capabilities }) - lspconfig.helm_ls.setup({ capabilities = capabilities }) - lspconfig.jsonls.setup({ capabilities = capabilities }) - lspconfig.nginx_language_server.setup({ capabilities = capabilities }) - lspconfig.marksman.setup({ capabilities = capabilities }) - lspconfig.pyright.setup({ capabilities = capabilities }) - lspconfig.ruff.setup({ - capabilities = capabilities, - }) - lspconfig.yamlls.setup({ capabilities = capabilities }) - vim.keymap.set("n", "vd", vim.lsp.buf.hover, { desc = "View Docstring" }) - vim.keymap.set("n", "gt", vim.lsp.buf.definition, { desc = "Go To Definition" }) - vim.keymap.set("n", "ca", vim.lsp.buf.code_action, { desc = "Show Code Actions" }) - end, - }, + { + "mason-org/mason.nvim", + tag = "v1.11.0", + config = function() + require("mason").setup({}) + end, + }, + { + "WhoIsSethDaniel/mason-tool-installer.nvim", + config = function() + require("mason-tool-installer").setup({ + ensure_installed = { + "stylua", + "mdformat", + "hadolint", + "yamllint", + "gh-actions-language-server", + }, + }) + end, + }, + { + "mason-org/mason-lspconfig.nvim", + tag = "v1.32.0", + config = function() + require("mason-lspconfig").setup({ + ensure_installed = { + "lua_ls", + "bashls", + --"helm_ls", + "jsonls", + "nginx_language_server", + "basedpyright", + "ruff", + "yamlls", + }, + }) + end, + }, + { + "nvimtools/none-ls.nvim", + config = function() + local null_ls = require("null-ls") + null_ls.setup({ + sources = { + null_ls.builtins.formatting.stylua, + null_ls.builtins.formatting.mdformat, + null_ls.builtins.diagnostics.hadolint, + null_ls.builtins.diagnostics.yamllint.with({ + extra_args = { "-d", "rules:\n document-start: disable" }, + }), + }, + }) + vim.keymap.set("n", "af", vim.lsp.buf.format, { desc = "Auto-Format File" }) + end, + }, + { + "neovim/nvim-lspconfig", + tag = "v1.8.0", + lazy = true, + event = { "BufReadPost", "BufNewFile" }, + dependencies = { + "mason-org/mason.nvim", + "mason-org/mason-lspconfig.nvim", + "WhoIsSethDaniel/mason-tool-installer.nvim", + }, + config = function() + local capabilities = require("cmp_nvim_lsp").default_capabilities() + local lspconfig = require("lspconfig") + lspconfig.ts_ls.setup({ + capabilities = capabilities, + }) + lspconfig.lua_ls.setup({ capabilities = capabilities }) + lspconfig.bashls.setup({ + capabilities = capabilities, + cmd = { "bash-language-server", "start" }, + filetypes = { "sh", "bash" }, + }) + lspconfig.gh_actions_ls.setup({ capabilities = capabilities }) + -- lspconfig.helm_ls.setup({ capabilities = capabilities }) + lspconfig.jsonls.setup({ capabilities = capabilities }) + lspconfig.basedpyright.setup({ + capabilities = capabilities, + settings = { + basedpyright = { + analysis = { + typeCheckingMode = "off", + diagnosticSeverityOverrides = { + reportUnusedImport = false, + reportUnusedVariable = false, + }, + }, + }, + }, + }) + lspconfig.nginx_language_server.setup({ capabilities = capabilities }) + lspconfig.ruff.setup({ + capabilities = capabilities, + init_options = { + settings = { + lineLength = 79, + }, + }, + }) + lspconfig.yamlls.setup({ capabilities = capabilities }) + vim.keymap.set("n", "vd", vim.lsp.buf.hover, { desc = "View Docstring" }) + vim.keymap.set("n", "gt", vim.lsp.buf.definition, { desc = "Go To Definition" }) + vim.keymap.set("n", "ca", vim.lsp.buf.code_action, { desc = "Show Code Actions" }) + end, + }, } diff --git a/.config/nvim/lua/plugins/syntax_highlighting.lua b/.config/nvim/lua/plugins/syntax_highlighting.lua index ac07741..f16b556 100644 --- a/.config/nvim/lua/plugins/syntax_highlighting.lua +++ b/.config/nvim/lua/plugins/syntax_highlighting.lua @@ -12,6 +12,7 @@ return { "query", "markdown", "markdown_inline", + "bash", "json", "jsonc", "python", diff --git a/.zshrc b/.zshrc index a51ea3c..9a9ab7f 100644 --- a/.zshrc +++ b/.zshrc @@ -9,9 +9,7 @@ bindkey -v # Configure cursor function zle-keymap-select { - #RPS1="${${KEYMAP/vicmd/-- NORMAL --}/(main|viins)/-- INSERT --}" - #RPS2=$RPS1 - zle reset-prompt + zle reset-prompt case $KEYMAP in vicmd) @@ -100,6 +98,7 @@ alias ll='ls -alFh' alias ls="ls --color=auto" alias lsl="ls --color=auto -lah" alias ssh=ssh + # Use tmux for local unelevated shells if [ -z "${SUDO_USER}" ] && [ -z "${SSH_CONNECTION}" ] && [ -z "${TERM_PROGRAM}" ]; then tmux new -A -s local_tmux @@ -151,10 +150,7 @@ zinit light zsh-users/zsh-autosuggestions zinit light zsh-users/zsh-syntax-highlighting # Key bindings config -KEYTIMEOUT=5 +#KEYTIMEOUT=5 # ^[ for esc; ^I for tab bindkey '^[[Z' autosuggest-accept -## Explicitly exit ok -#echo "" > /dev/null -