Compare commits
3 commits
c068921d55
...
e8c74fafe4
Author | SHA1 | Date | |
---|---|---|---|
e8c74fafe4 | |||
857e977aad | |||
33588e1afc |
5 changed files with 135 additions and 94 deletions
|
@ -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 {
|
|||
["<CR>"] = 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" },
|
||||
|
|
|
@ -69,7 +69,11 @@ return {
|
|||
},
|
||||
keys = {
|
||||
{ "<Leader>ea", "<cmd>VenvSelect<cr>", desc = "Activate Virtual Environment" },
|
||||
{ "<Leader>es", "<cmd>lua print(require('venv-selector').venv())<cr>", desc = "Show Active Virtual Environment" },
|
||||
{
|
||||
"<Leader>es",
|
||||
"<cmd>lua print(require('venv-selector').venv())<cr>",
|
||||
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,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
@ -6,6 +6,20 @@ return {
|
|||
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",
|
||||
|
@ -14,13 +28,10 @@ return {
|
|||
ensure_installed = {
|
||||
"lua_ls",
|
||||
"bashls",
|
||||
"dockerls",
|
||||
--"gh-actions-language-server",
|
||||
"helm_ls",
|
||||
--"helm_ls",
|
||||
"jsonls",
|
||||
"marksman",
|
||||
"nginx_language_server",
|
||||
"pyright",
|
||||
"basedpyright",
|
||||
"ruff",
|
||||
"yamlls",
|
||||
},
|
||||
|
@ -35,6 +46,10 @@ return {
|
|||
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", "<leader>af", vim.lsp.buf.format, { desc = "Auto-Format File" })
|
||||
|
@ -48,6 +63,7 @@ return {
|
|||
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()
|
||||
|
@ -56,15 +72,36 @@ return {
|
|||
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.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.marksman.setup({ capabilities = capabilities })
|
||||
lspconfig.pyright.setup({ capabilities = capabilities })
|
||||
lspconfig.ruff.setup({
|
||||
capabilities = capabilities,
|
||||
init_options = {
|
||||
settings = {
|
||||
lineLength = 79,
|
||||
},
|
||||
},
|
||||
})
|
||||
lspconfig.yamlls.setup({ capabilities = capabilities })
|
||||
vim.keymap.set("n", "<leader>vd", vim.lsp.buf.hover, { desc = "View Docstring" })
|
||||
|
|
|
@ -12,6 +12,7 @@ return {
|
|||
"query",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"bash",
|
||||
"json",
|
||||
"jsonc",
|
||||
"python",
|
||||
|
|
8
.zshrc
8
.zshrc
|
@ -9,8 +9,6 @@ bindkey -v
|
|||
|
||||
# Configure cursor
|
||||
function zle-keymap-select {
|
||||
#RPS1="${${KEYMAP/vicmd/-- NORMAL --}/(main|viins)/-- INSERT --}"
|
||||
#RPS2=$RPS1
|
||||
zle reset-prompt
|
||||
|
||||
case $KEYMAP in
|
||||
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue