mirror of
https://github.com/gabehf/nvim-conf.git
synced 2026-03-12 08:50:30 -07:00
[wip] rebuild from scratch
This commit is contained in:
parent
5c607d047b
commit
91ba5541a3
35 changed files with 473 additions and 485 deletions
|
|
@ -1,15 +0,0 @@
|
|||
local options = {
|
||||
formatters_by_ft = {
|
||||
lua = { "stylua" },
|
||||
css = { "prettier" },
|
||||
html = { "prettier" },
|
||||
},
|
||||
|
||||
format_on_save = {
|
||||
-- These options will be passed to conform.format()
|
||||
timeout_ms = 500,
|
||||
lsp_fallback = true,
|
||||
},
|
||||
}
|
||||
|
||||
require("conform").setup(options)
|
||||
24
lua/configs/gitsigns.lua
Normal file
24
lua/configs/gitsigns.lua
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
return {
|
||||
signs = {
|
||||
add = { text = "│" },
|
||||
change = { text = "│" },
|
||||
delete = { text = "" },
|
||||
topdelete = { text = "‾" },
|
||||
changedelete = { text = "~" },
|
||||
untracked = { text = "│" },
|
||||
},
|
||||
|
||||
on_attach = function(bufnr)
|
||||
local gs = package.loaded.gitsigns
|
||||
|
||||
local function opts(desc)
|
||||
return { buffer = bufnr, desc = desc }
|
||||
end
|
||||
|
||||
local map = vim.keymap.set
|
||||
|
||||
map("n", "<leader>rh", gs.reset_hunk, opts "Reset Hunk")
|
||||
map("n", "<leader>ph", gs.preview_hunk, opts "Preview Hunk")
|
||||
map("n", "<leader>gb", gs.blame_line, opts "Blame Line")
|
||||
end,
|
||||
}
|
||||
|
|
@ -1 +0,0 @@
|
|||
require("go").setup()
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
return {
|
||||
defaults = { lazy = true },
|
||||
install = { colorscheme = { "nvchad" } },
|
||||
|
||||
ui = {
|
||||
icons = {
|
||||
ft = "",
|
||||
lazy = " ",
|
||||
loaded = "",
|
||||
not_loaded = "",
|
||||
},
|
||||
},
|
||||
|
||||
performance = {
|
||||
rtp = {
|
||||
disabled_plugins = {
|
||||
"2html_plugin",
|
||||
"tohtml",
|
||||
"getscript",
|
||||
"getscriptPlugin",
|
||||
"gzip",
|
||||
"logipat",
|
||||
"netrw",
|
||||
"netrwPlugin",
|
||||
"netrwSettings",
|
||||
"netrwFileHandlers",
|
||||
"matchit",
|
||||
"tar",
|
||||
"tarPlugin",
|
||||
"rrhelper",
|
||||
"spellfile_plugin",
|
||||
"vimball",
|
||||
"vimballPlugin",
|
||||
"zip",
|
||||
"zipPlugin",
|
||||
"tutor",
|
||||
"rplugin",
|
||||
"syntax",
|
||||
"synmenu",
|
||||
"optwin",
|
||||
"compiler",
|
||||
"bugreport",
|
||||
"ftplugin",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -1,62 +0,0 @@
|
|||
local map = vim.keymap.set
|
||||
local conf = require("nvconfig").ui.lsp
|
||||
|
||||
local on_attach = function(client, bufnr)
|
||||
local function opts(desc)
|
||||
return { buffer = bufnr, desc = desc }
|
||||
end
|
||||
|
||||
map("n", "gD", vim.lsp.buf.declaration, opts "Lsp Go to declaration")
|
||||
map("n", "gd", vim.lsp.buf.definition, opts "Lsp Go to definition")
|
||||
map("n", "K", vim.lsp.buf.hover, opts "Lsp hover information")
|
||||
map("n", "gi", vim.lsp.buf.implementation, opts "Lsp Go to implementation")
|
||||
map("n", "<leader>sh", vim.lsp.buf.signature_help, opts "Lsp Show signature help")
|
||||
map("n", "<leader>wa", vim.lsp.buf.add_workspace_folder, opts "Lsp Add workspace folder")
|
||||
map("n", "<leader>wr", vim.lsp.buf.remove_workspace_folder, opts "Lsp Remove workspace folder")
|
||||
|
||||
map("n", "<leader>wl", function()
|
||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||
end, opts "Lsp List workspace folders")
|
||||
|
||||
map("n", "<leader>D", vim.lsp.buf.type_definition, opts "Lsp Go to type definition")
|
||||
|
||||
map("n", "<leader>ra", function()
|
||||
require "nvchad.lsp.renamer"()
|
||||
end, opts "Lsp NvRenamer")
|
||||
|
||||
map({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, opts "Lsp Code action")
|
||||
map("n", "gr", "<cmd>Telescope lsp_references<CR>", opts "[G]et [R]eferences")
|
||||
|
||||
-- setup signature popup
|
||||
if conf.signature and client.server_capabilities.signatureHelpProvider then
|
||||
require("nvchad.lsp.signature").setup(client, bufnr)
|
||||
end
|
||||
end
|
||||
local on_init = require("nvchad.configs.lspconfig").on_init
|
||||
local capabilities = require("nvchad.configs.lspconfig").capabilities
|
||||
|
||||
local lspconfig = require "lspconfig"
|
||||
local servers = { "html", "cssls", "gopls", "tsserver" }
|
||||
|
||||
-- lsps with default config
|
||||
for _, lsp in ipairs(servers) do
|
||||
lspconfig[lsp].setup {
|
||||
on_attach = on_attach,
|
||||
on_init = on_init,
|
||||
capabilities = capabilities,
|
||||
}
|
||||
end
|
||||
|
||||
-- rust
|
||||
lspconfig.rust_analyzer.setup {
|
||||
settings = {
|
||||
["rust-analyzer"] = {},
|
||||
},
|
||||
}
|
||||
|
||||
-- typescript
|
||||
-- lspconfig.tsserver.setup {
|
||||
-- on_attach = on_attach,
|
||||
-- on_init = on_init,
|
||||
-- capabilities = capabilities,
|
||||
-- }
|
||||
27
lua/configs/nvim-tree.lua
Normal file
27
lua/configs/nvim-tree.lua
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
local function on_attach(bufnr)
|
||||
local api = require "nvim-tree.api"
|
||||
|
||||
api.config.mappings.default_on_attach(bufnr)
|
||||
end
|
||||
|
||||
local M = {
|
||||
disable_netrw = true,
|
||||
on_attach = on_attach,
|
||||
git = { ignore = false },
|
||||
renderer = {
|
||||
icons = {
|
||||
glyphs = {
|
||||
git = { -- this is so stupid lmao
|
||||
unstaged = "😴",
|
||||
staged = "😎",
|
||||
unmerged = "😈",
|
||||
untracked = "😭",
|
||||
renamed = "😶",
|
||||
deleted = "😵",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
return M
|
||||
12
lua/configs/treesitter.lua
Normal file
12
lua/configs/treesitter.lua
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
return {
|
||||
ensure_installed = {
|
||||
"lua", "luadoc", "printf",
|
||||
"vim", "vimdoc", "go",
|
||||
"ruby", "rust", "cpp",
|
||||
},
|
||||
highlight = {
|
||||
enable = true,
|
||||
use_languagetree = true,
|
||||
},
|
||||
indent = { { enable = true } },
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue