mirror of
https://github.com/gabehf/nvim-conf.git
synced 2026-03-07 21:48:17 -08:00
stuff
This commit is contained in:
parent
6567c2cf57
commit
6e55699645
13 changed files with 211 additions and 8 deletions
3
init.lua
3
init.lua
|
|
@ -13,6 +13,8 @@ vim.keymap.set({ "n", "v" }, "<Right>", "")
|
|||
|
||||
vim.keymap.set({ "n", "i" }, "<C-s>", ":w<CR>")
|
||||
|
||||
vim.filetype.add { extension = { templ = "templ" } }
|
||||
|
||||
local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim"
|
||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
vim.fn.system {
|
||||
|
|
@ -55,4 +57,5 @@ vim.o.number = true
|
|||
-- vim.schedule(function()
|
||||
require "options"
|
||||
require "remaps"
|
||||
require "autocmd"
|
||||
-- end)
|
||||
|
|
|
|||
|
|
@ -6,11 +6,15 @@
|
|||
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" },
|
||||
"cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" },
|
||||
"cmp-nvim-ultisnips": { "branch": "main", "commit": "24bca5c3e137b28cd87442d4fc51a2b312dd99cc" },
|
||||
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
|
||||
"conform.nvim": { "branch": "master", "commit": "820eec990d5f332d30cf939954c8672a43a0459e" },
|
||||
"cyberdream.nvim": { "branch": "main", "commit": "b4c594999649584e1176c84a0f617ba1f91ab2eb" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "ea068f1becd91bcd4591fceb6420d4335e2e14d3" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "d96ef3bbff0bdbc3916a220f5c74a04c4db033f2" },
|
||||
"go.nvim": { "branch": "master", "commit": "591a0b837420f27c734600fa5c6de87f18352e50" },
|
||||
"guihua.lua": { "branch": "master", "commit": "3b3126ae87c254f6849e708549ba76c39e3f42f8" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" },
|
||||
"kanagawa.nvim": { "branch": "master", "commit": "bfa818c7bf6259152f1d89cf9fbfba3554c93695" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "31ddbea7c10b6920c9077b66c97951ca8682d5c8" },
|
||||
|
|
|
|||
1
lua/autocmd.lua
Normal file
1
lua/autocmd.lua
Normal file
|
|
@ -0,0 +1 @@
|
|||
-- vim.api.nvim_create_autocmd({ "BufWritePre" }, { pattern = { "*.templ" }, callback = vim.lsp.buf.format })
|
||||
117
lua/configs/cmp.lua
Normal file
117
lua/configs/cmp.lua
Normal file
|
|
@ -0,0 +1,117 @@
|
|||
local cmp = require "cmp"
|
||||
|
||||
-- dofile(vim.g.base46_cache .. "cmp")
|
||||
|
||||
local cmp_ui = require("nvconfig").ui.cmp
|
||||
local cmp_style = cmp_ui.style
|
||||
|
||||
local field_arrangement = {
|
||||
atom = { "kind", "abbr", "menu" },
|
||||
atom_colored = { "kind", "abbr", "menu" },
|
||||
}
|
||||
|
||||
local formatting_style = {
|
||||
-- default fields order i.e completion word + item.kind + item.kind icons
|
||||
fields = field_arrangement[cmp_style] or { "abbr", "kind", "menu" },
|
||||
|
||||
format = function(_, item)
|
||||
local icons = require "nvchad.icons.lspkind"
|
||||
local icon = (cmp_ui.icons and icons[item.kind]) or ""
|
||||
|
||||
if cmp_style == "atom" or cmp_style == "atom_colored" then
|
||||
icon = " " .. icon .. " "
|
||||
item.menu = cmp_ui.lspkind_text and " (" .. item.kind .. ")" or ""
|
||||
item.kind = icon
|
||||
else
|
||||
icon = cmp_ui.lspkind_text and (" " .. icon .. " ") or icon
|
||||
item.kind = string.format("%s %s", icon, cmp_ui.lspkind_text and item.kind or "")
|
||||
end
|
||||
|
||||
return item
|
||||
end,
|
||||
}
|
||||
|
||||
local function border(hl_name)
|
||||
return {
|
||||
{ "╭", hl_name },
|
||||
{ "─", hl_name },
|
||||
{ "╮", hl_name },
|
||||
{ "│", hl_name },
|
||||
{ "╯", hl_name },
|
||||
{ "─", hl_name },
|
||||
{ "╰", hl_name },
|
||||
{ "│", hl_name },
|
||||
}
|
||||
end
|
||||
|
||||
local options = {
|
||||
completion = {
|
||||
completeopt = "menu,menuone",
|
||||
},
|
||||
|
||||
window = {
|
||||
completion = {
|
||||
side_padding = (cmp_style ~= "atom" and cmp_style ~= "atom_colored") and 1 or 0,
|
||||
winhighlight = "Normal:CmpPmenu,CursorLine:CmpSel,Search:None",
|
||||
scrollbar = false,
|
||||
},
|
||||
documentation = {
|
||||
border = border "CmpDocBorder",
|
||||
winhighlight = "Normal:CmpDoc",
|
||||
},
|
||||
},
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
require("luasnip").lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
|
||||
formatting = formatting_style,
|
||||
|
||||
-- mapping = {
|
||||
-- ["<C-p>"] = cmp.mapping.select_prev_item(),
|
||||
-- ["<C-n>"] = cmp.mapping.select_next_item(),
|
||||
-- ["<C-d>"] = cmp.mapping.scroll_docs(-4),
|
||||
-- ["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||
-- ["<C-Space>"] = cmp.mapping.complete(),
|
||||
-- ["<C-e>"] = cmp.mapping.close(),
|
||||
--
|
||||
-- ["<CR>"] = cmp.mapping.confirm {
|
||||
-- behavior = cmp.ConfirmBehavior.Insert,
|
||||
-- select = true,
|
||||
-- },
|
||||
--
|
||||
-- ["<Tab>"] = cmp.mapping(function(fallback)
|
||||
-- if cmp.visible() then
|
||||
-- cmp.select_next_item()
|
||||
-- elseif require("luasnip").expand_or_jumpable() then
|
||||
-- vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<Plug>luasnip-expand-or-jump", true, true, true), "")
|
||||
-- else
|
||||
-- fallback()
|
||||
-- end
|
||||
-- end, { "i", "s" }),
|
||||
--
|
||||
-- ["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||
-- if cmp.visible() then
|
||||
-- cmp.select_prev_item()
|
||||
-- elseif require("luasnip").jumpable(-1) then
|
||||
-- vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<Plug>luasnip-jump-prev", true, true, true), "")
|
||||
-- else
|
||||
-- fallback()
|
||||
-- end
|
||||
-- end, { "i", "s" }),
|
||||
-- },
|
||||
sources = {
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "luasnip" },
|
||||
{ name = "buffer" },
|
||||
{ name = "nvim_lua" },
|
||||
{ name = "path" },
|
||||
},
|
||||
}
|
||||
|
||||
if cmp_style ~= "atom" and cmp_style ~= "atom_colored" then
|
||||
options.window.completion.border = border "CmpBorder"
|
||||
end
|
||||
|
||||
return options
|
||||
|
|
@ -16,6 +16,7 @@ return {
|
|||
"css",
|
||||
"astro",
|
||||
"bash",
|
||||
"templ",
|
||||
},
|
||||
-- highlight = {
|
||||
-- enable = true,
|
||||
|
|
|
|||
|
|
@ -69,4 +69,4 @@ vim.api.nvim_create_autocmd("TextYankPost", {
|
|||
})
|
||||
|
||||
-- set colorscheme
|
||||
vim.cmd.colorscheme "catppuccin-mocha"
|
||||
vim.cmd.colorscheme "cyberdream"
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ return {
|
|||
bash = { "shfmt" },
|
||||
sh = { "shfmt" },
|
||||
lua = { "stylua" },
|
||||
go = { "goimports", "gofumpt", "goimports-reviser" },
|
||||
go = { "goimports", "gofumpt" },
|
||||
javascript = { { "prettierd", "prettier" } },
|
||||
typescript = { { "prettierd", "prettier" } },
|
||||
javascriptreact = { { "prettierd", "prettier" } },
|
||||
|
|
|
|||
14
lua/plugins/go.lua
Normal file
14
lua/plugins/go.lua
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
return {
|
||||
"ray-x/go.nvim",
|
||||
dependencies = { -- optional packages
|
||||
"ray-x/guihua.lua",
|
||||
"neovim/nvim-lspconfig",
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
},
|
||||
config = function()
|
||||
require("go").setup()
|
||||
end,
|
||||
event = { "CmdlineEnter" },
|
||||
ft = { "go", "gomod" },
|
||||
build = ':lua require("go.install").update_all_sync()', -- if you need to install/update all binaries
|
||||
}
|
||||
|
|
@ -28,6 +28,10 @@ return {
|
|||
"clangd",
|
||||
"lua_ls",
|
||||
"pyright",
|
||||
"html",
|
||||
"htmx",
|
||||
"emmet_ls",
|
||||
"templ",
|
||||
},
|
||||
handlers = {
|
||||
function(server_name)
|
||||
|
|
@ -39,6 +43,36 @@ return {
|
|||
},
|
||||
},
|
||||
}
|
||||
require("lspconfig").emmet_ls.setup {
|
||||
-- on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
filetypes = {
|
||||
"css",
|
||||
"eruby",
|
||||
"html",
|
||||
"javascript",
|
||||
"javascriptreact",
|
||||
"less",
|
||||
"sass",
|
||||
"scss",
|
||||
"svelte",
|
||||
"pug",
|
||||
"typescriptreact",
|
||||
"vue",
|
||||
"templ",
|
||||
},
|
||||
init_options = {
|
||||
html = {
|
||||
options = {
|
||||
-- For possible options, see: https://github.com/emmetio/emmet/blob/master/src/config.ts#L79-L267
|
||||
["bem.enabled"] = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
require("lspconfig").htmx.setup {
|
||||
filetypes = { "html", "templ" },
|
||||
}
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,11 @@
|
|||
return {
|
||||
"hrsh7th/nvim-cmp",
|
||||
opts = function()
|
||||
require "configs.cmp"
|
||||
end,
|
||||
config = function(_, opts)
|
||||
require("cmp").setup(opts)
|
||||
end,
|
||||
dependencies = {
|
||||
{
|
||||
-- snippet plugin
|
||||
|
|
@ -11,6 +17,12 @@ return {
|
|||
require "configs.luasnip"
|
||||
end,
|
||||
},
|
||||
{
|
||||
"quangnguyen30192/cmp-nvim-ultisnips",
|
||||
config = function()
|
||||
require("cmp_nvim_ultisnips").setup {}
|
||||
end,
|
||||
},
|
||||
|
||||
-- autopairing of (){}[] etc
|
||||
{
|
||||
|
|
@ -32,6 +44,7 @@ return {
|
|||
{
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
"hrsh7th/cmp-nvim-lua",
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-buffer",
|
||||
"hrsh7th/cmp-path",
|
||||
},
|
||||
|
|
|
|||
|
|
@ -5,12 +5,9 @@ return {
|
|||
dependencies = {
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
lazy = true,
|
||||
opts = function()
|
||||
return { override = require "nvchad.icons.devicons" }
|
||||
end,
|
||||
opts = function()
|
||||
require "configs.nvim-tree"
|
||||
end,
|
||||
-- opts = function()
|
||||
-- return { override = require "nvchad.icons.devicons" }
|
||||
-- end,
|
||||
config = function(_, opts)
|
||||
-- dofile(vim.g.base46_cache .. "devicons")
|
||||
require("nvim-web-devicons").setup(opts)
|
||||
|
|
|
|||
18
lua/plugins/themes.lua
Normal file
18
lua/plugins/themes.lua
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
return {
|
||||
{
|
||||
"scottmckendry/cyberdream.nvim",
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
config = function()
|
||||
require("cyberdream").setup {
|
||||
-- Recommended - see "Configuring" below for more config options
|
||||
transparent = true,
|
||||
italic_comments = true,
|
||||
hide_fillchars = true,
|
||||
-- borderless_telescope = true,
|
||||
terminal_colors = true,
|
||||
}
|
||||
vim.cmd "colorscheme cyberdream" -- set the colorscheme
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
@ -10,6 +10,7 @@ map("n", "<C-k>", "<C-w>k", { desc = "Switch Window up" })
|
|||
map("n", "<leader>qq", ":wa<CR>:qa<CR>")
|
||||
map("i", "jk", "<Esc>")
|
||||
map("n", "<leader>b", "<C-6>")
|
||||
map("n", "<leader>m", ":!")
|
||||
|
||||
-- telescope keybinds
|
||||
local builtin = require "telescope.builtin"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue