Compare commits

...

10 Commits

8 changed files with 103 additions and 68 deletions

View File

@@ -127,16 +127,16 @@ autocmd("BufRead", {
})
-- SQL files
autocmd("FileType", {
pattern = { "sql", "mysql", "plsql" },
callback = function()
local cmp = require("cmp")
cmp.setup.buffer({
sources = {
{ name = "vim-dadbod" },
{ name = "nvim_lsp" },
{ name = "buffer" },
},
})
end,
})
-- autocmd("FileType", {
-- pattern = { "sql", "mysql", "plsql" },
-- callback = function()
-- local cmp = require("cmp")
-- cmp.setup.buffer({
-- sources = {
-- { name = "vim-dadbod" },
-- { name = "nvim_lsp" },
-- { name = "buffer" },
-- },
-- })
-- end,
-- })

View File

@@ -20,8 +20,8 @@ map("t", "<Esc><Esc>", "<C-\\><C-n>", { desc = "Exit terminal mode" })
-- Explorer keymaps (Snacks explorer)
-- Ctrl+Shift+e - Toggle explorer
map("n", "<C-S-e>", function() Snacks.explorer() end, { desc = "Toggle Explorer" })
map("i", "<C-S-e>", function() Snacks.explorer() end, { desc = "Toggle Explorer" })
map("n", "<C-e>", function() Snacks.explorer() end, { desc = "Toggle Explorer" })
map("i", "<C-e>", function() Snacks.explorer() end, { desc = "Toggle Explorer" })
-- Note: Ctrl+Shift+v and Ctrl+Shift+h for opening files in splits
-- are configured in the snacks picker config (lua/plugins/editor.lua)

View File

@@ -17,7 +17,7 @@ opt.number = true -- Show line numbers
opt.relativenumber = true -- Relative line numbers
opt.signcolumn = "yes" -- Always show sign column
opt.termguicolors = true -- True color support
opt.wrap = true -- Disable line wrap
opt.wrap = false -- Disable line wrap
-- Indentation
opt.expandtab = true -- Use spaces instead of tabs

View File

@@ -14,6 +14,7 @@ return {
cmd = { "DBUI", "DBUIToggle", "DBUIAddConnection", "DBUIFindBuffer" },
dependencies = {
{ "tpope/vim-dadbod", lazy = true },
{ "kristijanhusak/vim-dadbod-completion", ft = { 'sql', 'mysql', 'plsql' }, lazy = true },
},
init = function()
-- UI configuration
@@ -41,44 +42,21 @@ return {
end,
},
-- Autocompletion for dadbod
-- Completion
{
"kristijanhusak/vim-dadbod-completion",
dependencies = {
"tpope/vim-dadbod",
"hrsh7th/nvim-cmp",
},
ft = { "sql", "mysql", "plsql" },
init = function()
-- Setup completion for SQL files
vim.api.nvim_create_autocmd("FileType", {
pattern = { "sql", "mysql", "plsql" },
callback = function()
local cmp = require("cmp")
local sources = cmp.get_config().sources or {}
'saghen/blink.cmp',
opts = {
sources = {
default = { "lsp", "path", "snippets", "buffer" },
per_filetype = {
sql = { 'snippets', 'dadbod', 'buffer' },
},
-- add vim-dadbod-completion to your completion providers
providers = {
dadbod = { name = "Dadbod", module = "vim_dadbod_completion.blink"}
}
}
}
}
-- Add dadbod completion source
table.insert(sources, { name = "vim-dadbod-completion" })
cmp.setup.buffer({
sources = cmp.config.sources(sources),
})
end,
})
end,
},
-- Add dadbod-completion to nvim-cmp sources
{
"hrsh7th/nvim-cmp",
optional = true,
dependencies = {
"kristijanhusak/vim-dadbod-completion",
"nvim-cmp",
},
opts = function(_, opts)
opts.sources = opts.sources or {}
table.insert(opts.sources, { name = "vim-dadbod-completion" })
end,
},
}

View File

@@ -156,4 +156,38 @@ return {
},
},
},
-- Help comment and uncomment lines
{
'numToStr/Comment.nvim',
opts = {
padding = true,
-- LHS of toggle mappings in NORMAL mode
toggler = {
line = 'gcc',
block = 'gbc',
},
-- LHS of operator-pending mappings in NORMAL and VISUAL
opleader = {
line = "gc",
block = "gb",
},
-- LHS of extra mappings
extra = {
-- Add comment on the line above
above = 'gcO',
-- Add comment on the line below
below = 'gco',
-- Add comment at the end of line
eol = 'gcA',
},
mappings = {
basic = true,
extra = true,
},
},
},
}

View File

@@ -23,24 +23,26 @@ return {
opts = {
ensure_installed = {
-- LSP servers
"gopls", -- Go
"lua-language-server", -- Lua
"gopls", -- Go
"lua-language-server", -- Lua
"typescript-language-server", -- TypeScript/JavaScript
"js-debug-adapter", -- JS
"html-lsp", -- HTML
"css-lsp", -- CSS
"json-lsp", -- JSON
"yaml-language-server", -- YAML
"marksman", -- Markdown
"sqlls", -- SQL
"pyright", --Python
"ruff", --Python
"docker-language-server", -- Docker
"js-debug-adapter", -- JS
"html-lsp", -- HTML
"css-lsp", -- CSS
"json-lsp", -- JSON
"yaml-language-server", -- YAML
"marksman", -- Markdown
"sqlls", -- SQL
"pyright", --Python
"ruff", --Python
"docker-language-server", -- Docker
"zls", -- Zig
-- Linters
"golangci-lint",
"eslint_d",
"markdownlint",
"hadolint",
"shellcheck",
-- Formatters
"gofumpt",
"goimports",
@@ -107,8 +109,15 @@ return {
-- Lua
lua_ls = {
root_dir = make_root_detector({ ".luarc.json", ".luarc.jsonc", ".luacheckrc", ".stylua.toml", "stylua.toml",
"selene.toml", "selene.yml" }),
root_dir = make_root_detector({
".luarc.json",
".luarc.jsonc",
".luacheckrc",
".stylua.toml",
"stylua.toml",
"selene.toml",
"selene.yml",
}),
settings = {
Lua = {
workspace = {
@@ -233,6 +242,8 @@ return {
"gitcommit",
"git_rebase",
"dockerfile",
"latex",
"typst",
},
highlight = { enable = true },
indent = { enable = true },

7
lua/plugins/markdown.lua Normal file
View File

@@ -0,0 +1,7 @@
return {
"OXY2DEV/markview.nvim",
lazy = false,
dependencies = {
"saghen/blink.cmp",
},
}

5
lua/plugins/zig.lua Normal file
View File

@@ -0,0 +1,5 @@
return {
'https://codeberg.org/ziglang/zig.vim',
lazy = true,
ft = { "zig" },
}