Compare commits

...

7 Commits

Author SHA1 Message Date
7ac45d5fd3 Add dadbod and dadbod ui 2024-11-28 18:46:56 +01:00
e812cdee4c Add treesitter 2024-11-28 18:39:03 +01:00
2bc0ffdcac Add ctrl+e to telescope find files 2024-11-22 09:37:40 +01:00
536e8fec88 Add telescope 2024-11-22 08:40:35 +01:00
2724b2ac2a Add easyalign 2024-11-22 08:39:59 +01:00
f0bc3e37df Figure out how to format json 2024-11-21 12:39:12 +01:00
3b130ee4e7 Try configuring language servers 2024-11-21 10:54:36 +01:00
6 changed files with 272 additions and 127 deletions

View File

@@ -36,4 +36,4 @@ vim.schedule(function()
require "mappings" require "mappings"
end) end)
vim.o.guifont = "Hasklug Nerd Font Mono:h14" vim.o.guifont = "Hasklug Nerd Font Mono:h14"

View File

@@ -1,32 +1,34 @@
{ {
"LuaSnip": { "branch": "master", "commit": "0f7bbce41ea152a94d12aea286f2ce98e63c0f58" }, "LuaSnip": { "branch": "master", "commit": "0f7bbce41ea152a94d12aea286f2ce98e63c0f58" },
"NvChad": { "branch": "v2.5", "commit": "bbc3d43db088c141b142a40cd5f717635833a54e" }, "NvChad": { "branch": "v2.5", "commit": "bbc3d43db088c141b142a40cd5f717635833a54e" },
"base46": { "branch": "v2.5", "commit": "8971be55aeb6d5fe086169c0ee9ce647a3871570" }, "base46": { "branch": "v2.5", "commit": "40943fc668bf8f1caa4cc45f71c784cf0d3cc34f" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
"cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
"conform.nvim": { "branch": "master", "commit": "023f795dbcf32d4351b6a9ed2e613d471b5bb812" }, "conform.nvim": { "branch": "master", "commit": "a203480a350b03092e473bf3001733d547160a73" },
"friendly-snippets": { "branch": "main", "commit": "de8fce94985873666bd9712ea3e49ee17aadb1ed" }, "friendly-snippets": { "branch": "main", "commit": "de8fce94985873666bd9712ea3e49ee17aadb1ed" },
"gitsigns.nvim": { "branch": "main", "commit": "ac5aba6dce8c06ea22bea2c9016f51a2dbf90dc7" }, "gitsigns.nvim": { "branch": "main", "commit": "5f808b5e4fef30bd8aca1b803b4e555da07fc412" },
"indent-blankline.nvim": { "branch": "master", "commit": "7871a88056f7144defca9c931e311a3134c5d509" }, "indent-blankline.nvim": { "branch": "master", "commit": "7871a88056f7144defca9c931e311a3134c5d509" },
"lazy.nvim": { "branch": "main", "commit": "7967abe55752aa90532e6bb4bd4663fe27a264cb" }, "lazy.nvim": { "branch": "main", "commit": "56ead98e05bb37a4ec28930a54d836d033cf00f2" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "43894adcf10bb1190c2184bd7c1750e8ea2b3dce" },
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
"menu": { "branch": "main", "commit": "657bfc91382c0928453d9a4d0a10ec92db5de2bb" }, "menu": { "branch": "main", "commit": "657bfc91382c0928453d9a4d0a10ec92db5de2bb" },
"minty": { "branch": "main", "commit": "a3d69bd63fc98f640815f94b797bf978e9193022" }, "minty": { "branch": "main", "commit": "b454ca0229f8e22a631fd3c014ec99973fb8cad4" },
"nvim-autopairs": { "branch": "master", "commit": "b464658e9b880f463b9f7e6ccddd93fb0013f559" }, "nvim-autopairs": { "branch": "master", "commit": "b464658e9b880f463b9f7e6ccddd93fb0013f559" },
"nvim-cmp": { "branch": "main", "commit": "f17d9b4394027ff4442b298398dfcaab97e40c4f" }, "nvim-cmp": { "branch": "main", "commit": "ed31156aa2cc14e3bc066c59357cc91536a2bc01" },
"nvim-lspconfig": { "branch": "master", "commit": "f012c1b176f0e3c71f40eb309bdec0316689462e" }, "nvim-lspconfig": { "branch": "master", "commit": "e8f9c46c99e1901167a92ab13e2357158e5aabdb" },
"nvim-tree.lua": { "branch": "master", "commit": "f7c65e11d695a084ca10b93df659bb7e68b71f9f" }, "nvim-tree.lua": { "branch": "master", "commit": "ca7c4c33cac2ad66ec69d45e465379716ef0cc97" },
"nvim-treesitter": { "branch": "master", "commit": "37427012d1c77c544356bfff0c9acc88fd3256bc" }, "nvim-treesitter": { "branch": "master", "commit": "4d035005d338e4b1eb71a175bd44974e2f64740f" },
"nvim-web-devicons": { "branch": "master", "commit": "e87554285f581047b1bf236794b0eb812b444b87" }, "nvim-web-devicons": { "branch": "master", "commit": "edbe0a65cfacbbfff6a4a1e98ddd60c28c560509" },
"plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" },
"projectmgr.nvim": { "branch": "main", "commit": "2d29b21b5afefa7a1690854c56db9b43195d9a10" }, "projectmgr.nvim": { "branch": "main", "commit": "2d29b21b5afefa7a1690854c56db9b43195d9a10" },
"supermaven-nvim": { "branch": "main", "commit": "07d20fce48a5629686aefb0a7cd4b25e33947d50" }, "supermaven-nvim": { "branch": "main", "commit": "07d20fce48a5629686aefb0a7cd4b25e33947d50" },
"telescope.nvim": { "branch": "master", "commit": "85922dde3767e01d42a08e750a773effbffaea3e" }, "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
"ui": { "branch": "v3.0", "commit": "9b31c25fc497d1ef726de15ae297769dbf90c1a5" }, "ui": { "branch": "v3.0", "commit": "7905539f1e10f460811dc0db800355611f8a527a" },
"volt": { "branch": "main", "commit": "41c03a5d6a0a8a997e774a3482d82e5ef820c6ba" }, "vim-dadbod": { "branch": "master", "commit": "fe5a55e92b2dded7c404006147ef97fb073d8b1b" },
"which-key.nvim": { "branch": "main", "commit": "68e37e12913a66b60073906f5d3f14dee0de19f2" } "vim-dadbod-ui": { "branch": "master", "commit": "28a16902cb2134c934b85da5250033ee43b0dee5" },
"vim-easy-align": { "branch": "master", "commit": "9815a55dbcd817784458df7a18acacc6f82b1241" },
"volt": { "branch": "main", "commit": "8d35e03c70490190149a77c59155618ef4370721" },
"which-key.nvim": { "branch": "main", "commit": "9b365a6428a9633e3eeb34dbef1b791511c54f70" }
} }

View File

@@ -1,15 +1,64 @@
local options = { -----------------------------------------------------------
formatters_by_ft = { -- Conform.nvim Formatter Configuration
lua = { "stylua" }, -----------------------------------------------------------
-- css = { "prettier" },
-- html = { "prettier" },
},
-- format_on_save = { local options = {
-- -- These options will be passed to conform.format() -- Disable LSP formatting fallback
-- timeout_ms = 500, lsp_fallback = false,
-- lsp_fallback = true,
-- }, -----------------------------------------------------------
-- Formatter Assignments by File Type
-----------------------------------------------------------
formatters_by_ft = {
-- Lua
lua = { "stylua" },
-- Web Development
javascript = { "prettierd", "prettier", stop_after_first = true },
typescript = { "prettierd", "prettier", stop_after_first = true },
typescriptreact = { "prettierd", "prettier", stop_after_first = true },
astro = { "prettierd", "prettier", stop_after_first = true },
svelte = { "prettierd", "prettier", stop_after_first = true },
html = { "prettierd", "prettier", stop_after_first = true },
css = { "prettierd", "prettier", stop_after_first = true },
json = { "prettierd", "prettier", stop_after_first = true },
yml = { "prettierd", "prettier", stop_after_first = true },
toml = { "prettierd", "prettier", stop_after_first = true },
-- Systems Programming
rust = { "rustfmt" },
c = { "clangformat" },
cpp = { "clangformat" },
-- Shell and Configuration
sh = { "shfmt" },
nix = { "nixpkgsfmt" },
},
-----------------------------------------------------------
-- Custom Formatter Configurations
-----------------------------------------------------------
formatters = {
-- Nix formatter configuration
nixpkgsfmt = {
command = "nixpkgs-fmt",
args = {},
},
-- C/C++ formatter configuration
clangformat = {
inherit = false,
command = "clang-format",
},
},
-----------------------------------------------------------
-- Format on Save Settings
-----------------------------------------------------------
format_on_save = {
timeout_ms = 2500, -- Maximum time to wait for formatting
lsp_fallback = false, -- Don't fallback to LSP formatting
},
} }
return options return options

View File

@@ -1,24 +1,101 @@
-- load defaults i.e lua_lsp -----------------------------------------------------------
-- LSP Configuration
-----------------------------------------------------------
-- Load NvChad LSP defaults
require("nvchad.configs.lspconfig").defaults() require("nvchad.configs.lspconfig").defaults()
local lspconfig = require "lspconfig" local lspconfig = require("lspconfig")
local nvlsp = require("nvchad.configs.lspconfig")
-- EXAMPLE -----------------------------------------------------------
local servers = { "html", "cssls" } -- Language Server Configurations
local nvlsp = require "nvchad.configs.lspconfig" -----------------------------------------------------------
-- lsps with default config local servers = {
for _, lsp in ipairs(servers) do -----------------------------------------------------------
lspconfig[lsp].setup { -- Web Development
on_attach = nvlsp.on_attach, -----------------------------------------------------------
on_init = nvlsp.on_init, -- HTML & CSS
capabilities = nvlsp.capabilities, emmet_language_server = {},
} html = {},
end cssls = {},
-- JavaScript & Frameworks
svelte = {},
astro = {},
-- Tailwind CSS
tailwindcss = {
settings = {
tailwindCSS = {
experimental = {
classRegex = {
{ "cva\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]" },
{ "cx\\(([^)]*)\\)", "(?:'|\"|`)([^']*)(?:'|\"|`)" },
{ "cn\\(([^)]*)\\)", "(?:'|\"|`)([^']*)(?:'|\"|`)" },
},
},
},
},
},
-- JSON & Linting
jsonls = {},
eslint = {},
-- configuring single server, example: typescript -----------------------------------------------------------
-- lspconfig.ts_ls.setup { -- DevOps & Infrastructure
-- on_attach = nvlsp.on_attach, -----------------------------------------------------------
-- on_init = nvlsp.on_init, -- Docker
-- capabilities = nvlsp.capabilities, docker_compose_language_service = {},
-- } dockerls = {},
-- Server Configuration
nginx_language_server = {},
-----------------------------------------------------------
-- Systems Programming
-----------------------------------------------------------
-- Rust
rust_analyzer = {},
-- C/C++
clangd = {},
-- Go
gopls = {},
-----------------------------------------------------------
-- Scripting & Configuration
-----------------------------------------------------------
-- Lua
lua_ls = {},
-- Nix
nixd = {},
-- C# (currently disabled)
-- csharp_ls = {},
-----------------------------------------------------------
-- Database & Backend
-----------------------------------------------------------
-- SQL
sqls = {},
-- PHP
phpactor = {},
}
-----------------------------------------------------------
-- Apply Server Configurations
-----------------------------------------------------------
-- Iterate through servers and apply common configuration
for name, opts in pairs(servers) do
opts.on_init = nvlsp.on_init
opts.on_attach = nvlsp.on_attach
opts.capabilities = nvlsp.capabilities
lspconfig[name].setup(opts)
end

View File

@@ -1,10 +1,14 @@
require "nvchad.mappings" require "nvchad.mappings"
-- add yours here
local map = vim.keymap.set local map = vim.keymap.set
map("n", ";", ":", { desc = "CMD enter command mode" }) map("n", ";", ":", { desc = "CMD enter command mode" })
map("i", "jk", "<ESC>") map("i", "jk", "<ESC>")
-- map({ "n", "i", "v" }, "<C-s>", "<cmd> w <cr>") -- Easy-align mappings
map("x", "ga", "<Plug>(EasyAlign)", { silent = true })
map("n", "ga", "<Plug>(EasyAlign)", { silent = true })
map("n", "<C-e>", function()
require("telescope.builtin").oldfiles()
end, { desc = "Open recent files with Telescope" })

View File

@@ -1,86 +1,99 @@
return { return {
{ {
"stevearc/conform.nvim", "junegunn/vim-easy-align",
-- event = 'BufWritePre', -- uncomment for format on save lazy = false, -- Load the plugin immediately
opts = require "configs.conform", keys = {
}, -- Custom keymappings for easy-align
{ "ga", "<Plug>(EasyAlign)", mode = { "n", "x" }, desc = "Easy Align" }
},
},
{ {
"charludo/projectmgr.nvim", 'nvim-telescope/telescope.nvim',
lazy = false, -- Required for proper functionality tag = '0.1.8',
}, -- or , branch = '0.1.x',
dependencies = { 'nvim-lua/plenary.nvim' }
},
-- These are some examples, uncomment them if you want to see them work! {
{ "charludo/projectmgr.nvim",
"neovim/nvim-lspconfig", lazy = false,
config = function() },
require "configs.lspconfig"
end,
},
{ {
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
dependencies = { config = function()
-- Installer for language servers require "configs.lspconfig"
"williamboman/mason.nvim", end,
"williamboman/mason-lspconfig.nvim", },
},
config = function()
require("mason").setup()
require("mason-lspconfig").setup({
ensure_installed = {
"lua_ls", -- Lua
"gopls", -- Go
"tsserver", -- JavaScript/TypeScript
},
})
local lspconfig = require("lspconfig") {
"stevearc/conform.nvim",
event = "BufWritePre",
opts = require "configs.conform",
},
-- Lua Language Server -- Supermaven
lspconfig.lua_ls.setup {} {
"supermaven-inc/supermaven-nvim",
lazy = false,
config = function()
require("supermaven-nvim").setup {
keymaps = {
accept_suggestion = "<A-l>",
clear_suggestion = "<C-]>",
accept_word = "<C-j>",
},
ignore_filetypes = { cpp = true }, -- or { "cpp", }
color = {
suggestion_color = "#ffffff",
cterm = 244,
},
log_level = "info", -- set to "off" to disable logging completely
disable_inline_completion = false, -- disables inline completion for use with cmp
disable_keymaps = false, -- disables built in keymaps for more manual control
condition = function()
return false
end, -- condition to check for stopping supermaven, `true` means to stop supermaven when the condition is true.
}
end,
},
-- Go Language Server {
lspconfig.gopls.setup {} "nvim-treesitter/nvim-treesitter",
opts = {
ensure_installed = {
"vim", "lua", "vimdoc",
"html", "css"
},
},
},
-- JavaScript/TypeScript Language Server {
lspconfig.tsserver.setup {} "tpope/vim-dadbod",
end, lazy = false,
}, },
{
-- Supermaven 'kristijanhusak/vim-dadbod-ui',
{ lazy = false,
"supermaven-inc/supermaven-nvim", dependencies = {
lazy = false, 'tpope/vim-dadbod',
config = function() },
require("supermaven-nvim").setup { cmd = {
keymaps = { 'DBUI',
accept_suggestion = "<A-l>", 'DBUIToggle',
clear_suggestion = "<C-]>", 'DBUIAddConnection',
accept_word = "<C-j>", 'DBUIFindBuffer',
}, },
ignore_filetypes = { cpp = true }, -- or { "cpp", } init = function()
color = { vim.g.db_ui_use_nerd_fonts = 1
suggestion_color = "#ffffff", end,
cterm = 244, },
}, {
log_level = "info", -- set to "off" to disable logging completely "kristijanhusak/vim-dadbod-completion",
disable_inline_completion = false, -- disables inline completion for use with cmp dependencies = {
disable_keymaps = false, -- disables built in keymaps for more manual control 'kristijanhusak/vim-dadbod-ui',
condition = function() 'kristijanhusak/vim-dadbod',
return false },
end, -- condition to check for stopping supermaven, `true` means to stop supermaven when the condition is true. },
}
end,
},
-- {
-- "nvim-treesitter/nvim-treesitter",
-- opts = {
-- ensure_installed = {
-- "vim", "lua", "vimdoc",
-- "html", "css"
-- },
-- },
-- },
} }