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