fix: Add bash and lua support

This commit is contained in:
lif
2025-11-05 15:56:35 +00:00
parent c41bd69bee
commit 92365bd2f2
2 changed files with 91 additions and 86 deletions

View File

@@ -27,7 +27,7 @@ vim.o.background = "dark" -- set to "dark" for dark theme
-- Scrolling and UI settings
vim.opt.cursorline = true
vim.opt.cursorcolumn = true
vim.opt.signcolumn = 'yes'
vim.opt.signcolumn = "yes"
vim.opt.wrap = false
vim.opt.sidescrolloff = 8
vim.opt.scrolloff = 8
@@ -76,17 +76,17 @@ local plugins = {
{ "nvim-treesitter/nvim-treesitter", priority = 1000, build = ":TSUpdate" },
-- LSP
{ 'mason-org/mason.nvim' }, -- installs LSP servers
{ 'neovim/nvim-lspconfig' }, -- configures LSPs
{ 'mason-org/mason-lspconfig.nvim' }, -- links installed to configured
{ 'stevearc/conform.nvim' }, -- Formatting where the LSP doesn't
{ "mason-org/mason.nvim" }, -- installs LSP servers
{ "neovim/nvim-lspconfig" }, -- configures LSPs
{ "mason-org/mason-lspconfig.nvim" }, -- links installed to configured
{ "stevearc/conform.nvim" }, -- Formatting where the LSP doesn't
-- AI trash
-- { 'supermaven-inc/supermaven-nvim' },
{
'saghen/blink.cmp', -- Blink completion tool (LSP, snippets etc)
version = '1.*', -- see keymap here:
"saghen/blink.cmp", -- Blink completion tool (LSP, snippets etc)
version = "1.*", -- see keymap here:
-- opts_extend = { "sources.default" } -- https://cmp.saghen.dev/configuration/keymap.html#default
opts = {
@@ -114,7 +114,7 @@ local plugins = {
{ "<c-l>", "<cmd><C-U>TmuxNavigateRight<cr>" },
{ "<c-\\>", "<cmd><C-U>TmuxNavigatePrevious<cr>" },
},
}
},
}
-- -----------------------------------------------------------------------------------------------
@@ -123,9 +123,12 @@ local plugins = {
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git", "clone", "--filter=blob:none",
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", lazypath,
"--branch=stable",
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
@@ -147,10 +150,10 @@ require("Comment").setup()
-- NB: Make sure to add more from this list!
-- https://github.com/nvim-treesitter/nvim-treesitter/tree/master#supported-languages
require("nvim-treesitter.configs").setup({
ensure_installed = { "typescript", "python", "rust", "go" },
ensure_installed = { "typescript", "python", "rust", "go", "bash", "lua" },
sync_install = false,
auto_install = true,
highlight = { enable = true, },
highlight = { enable = true },
})
vim.opt.foldmethod = "expr"
vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
@@ -163,12 +166,14 @@ vim.opt.foldlevel = 99
-- NB: Make sure to add more from this list!
-- https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md
require("mason").setup()
require("mason-lspconfig").setup({ ensure_installed = { "gopls", "bashls", "beautysh" } })
require("mason-lspconfig").setup({ ensure_installed = { "gopls", "bashls", "stylua" } })
require("conform").setup({
default_format_opts = { lsp_format = "fallback" }, -- Many languages can be formatted directly by their LSP
formatters_by_ft = { -- but some can't, so conform is for those ones
bash = { "beautysh" },
sh = { "shfmt" },
bash = { "shfmt" },
lua = { "stylua" },
javascript = { "prettier" },
javascriptreact = { "prettier" },
typescript = { "prettier" },
@@ -215,9 +220,9 @@ vim.keymap.set("n", "<C-f>", ":NvimTreeFindFile<CR>")
vim.keymap.set("n", "<C-c>", ":NvimTreeClose<CR>")
-- Formatting
vim.keymap.set("n", "<leader>fo", require('conform').format)
vim.keymap.set("n", "<leader>fo", require("conform").format)
vim.keymap.set('n', '<leader>k', vim.diagnostic.goto_next, { desc = "Next diagnostic" })
vim.keymap.set("n", "<leader>k", vim.diagnostic.goto_next, { desc = "Next diagnostic" })
-- vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = "Prev diagnostic" })
local tele_builtin = require("telescope.builtin")
@@ -247,7 +252,9 @@ vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, { desc = "Code action
vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, { desc = "Previous diagnostic" })
vim.keymap.set("n", "]d", vim.diagnostic.goto_next, { desc = "Next diagnostic" })
vim.keymap.set("n", "<leader>q", vim.diagnostic.setloclist, { desc = "Send diagnostics to location list" })
vim.keymap.set("n", "<leader>f", function() vim.lsp.buf.format({ async = true }) end, { desc = "Format buffer" })
vim.keymap.set("n", "<leader>f", function()
vim.lsp.buf.format({ async = true })
end, { desc = "Format buffer" })
-- ----------------------------
-- Telescope / fuzzy finding

View File

@@ -34,7 +34,6 @@ done
fish -c "fisher update"
fish -c "set --universal nvm_default_version $nodejs_version"
if fish -c "which node" >/dev/null 2>&1; then
version=$(node --version)
@@ -44,4 +43,3 @@ else
fish -c "nvm install $nodejs_version"
fish -c "nvm use $nodejs_version"
fi