update arch

This commit is contained in:
2024-06-02 09:31:22 -05:00
parent c49181befc
commit 75825901b3
37 changed files with 460 additions and 86 deletions

View File

@@ -0,0 +1,6 @@
column_width = 120
line_endings = "Unix"
indent_type = "Spaces"
indent_width = 2
quote_style = "AutoPreferDouble"
call_parentheses = "None"

49
.config/nvim/init.lua Normal file
View File

@@ -0,0 +1,49 @@
vim.g.base46_cache = vim.fn.stdpath "data" .. "/nvchad/base46/"
vim.g.mapleader = " "
-- bootstrap lazy and all plugins
local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
local repo = "https://github.com/folke/lazy.nvim.git"
vim.fn.system { "git", "clone", "--filter=blob:none", repo, "--branch=stable", lazypath }
end
vim.opt.rtp:prepend(lazypath)
local lazy_config = require "configs.lazy"
-- load plugins
require("lazy").setup({
{
"NvChad/NvChad",
lazy = false,
branch = "v2.5",
import = "nvchad.plugins",
config = function()
require "options"
end,
},
{ import = "plugins" },
}, lazy_config)
-- load theme
dofile(vim.g.base46_cache .. "defaults")
dofile(vim.g.base46_cache .. "statusline")
require "nvchad.autocmds"
vim.schedule(function()
require "mappings"
end)
vim.opt.guicursor = ""
vim.opt.nu = true
vim.opt.relativenumber = true
vim.api.nvim_set_keymap('n', '<C-d>', '<C-d>zz', {noremap = true})
vim.api.nvim_set_keymap('n', '<C-u>', '<C-u>zz', {noremap = true})
vim.api.nvim_set_keymap('n', 'n', 'nzzzv', {noremap = true})
vim.api.nvim_set_keymap('n', 'N', 'Nzzzv', {noremap = true})
vim.api.nvim_set_option("clipboard","unnamedplus")

View File

@@ -0,0 +1,9 @@
-- This file needs to have same structure as nvconfig.lua
-- https://github.com/NvChad/NvChad/blob/v2.5/lua/nvconfig.lua
---@type ChadrcConfig
local M = {}
M.ui = {theme = 'catppuccin'}
return M

View File

@@ -0,0 +1,15 @@
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)

View File

@@ -0,0 +1,47 @@
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",
},
},
},
}

View File

@@ -0,0 +1,23 @@
-- EXAMPLE
local on_attach = require("nvchad.configs.lspconfig").on_attach
local on_init = require("nvchad.configs.lspconfig").on_init
local capabilities = require("nvchad.configs.lspconfig").capabilities
local lspconfig = require "lspconfig"
local servers = { "html", "cssls" }
-- lsps with default config
for _, lsp in ipairs(servers) do
lspconfig[lsp].setup {
on_attach = on_attach,
on_init = on_init,
capabilities = capabilities,
}
end
-- typescript
lspconfig.tsserver.setup {
on_attach = on_attach,
on_init = on_init,
capabilities = capabilities,
}

View File

@@ -0,0 +1,11 @@
require "nvchad.mappings"
local map = vim.keymap.set
map("n", ";", ":", { desc = "CMD enter command mode" })
map("i", "jk", "<ESC>")
map("", "<C-h>", "<cmd> TmuxNavigateLeft<CR>", { desc = "window left" })
map("", "<C-l>", "<cmd> TmuxNavigateRight<CR>", { desc = "window right" })
map("", "<C-j>", "<cmd> TmuxNavigateDown<CR>", { desc = "window down" })
map("", "<C-k>", "<cmd> TmuxNavigateUp<CR>", { desc = "window up" })

View File

@@ -0,0 +1,11 @@
local parser_config = require 'nvim-treesitter.parsers'.get_parser_configs()
--parser_config.powershell_es = {
-- install_info = {
-- url = "/home/user/.local/share/tree-sitter-PowerShell",
-- files = { "src/parser.c" },
-- generate_requires_npm = false,
-- requires_generate_from_grammar = false,
-- },
-- filetype = "ps1",
--}
return parser_config

View File

@@ -0,0 +1,96 @@
local M = {}
M.general = {
n = {
["<C-h>"] = {"<cmd> TmuxNavigateLeft<CR>", "window left"},
["<C-l>"] = {"<cmd> TmuxNavigateRight<CR>", "window right"},
["<C-j>"] = {"<cmd> TmuxNavigateDown<CR>", "window down"},
["<C-k>"] = {"<cmd> TmuxNavigateUp<CR>", "window up"},
}
}
M.dap = {
plugin = true,
n = {
["<leader>db"] = {
"<cmd> DapToggleBreakpoint <CR>",
"Add breakpoint at line"
},
["<F5>"] = {
"<cmd> DapContinue <CR>",
"Start Debugging"
},
["<F6>"] = {
"<cmd> DapTerminate <CR>",
"Stop Debugging"
},
["<F10>"] = {
"<cmd> DapStepOver <CR>",
"Step Over"
},
["<F11>"] = {
"<cmd> DapStepInto <CR>",
"Step Into"
},
["<F12>"] = {
"<cmd> DapStepOut <CR>",
"Stop Out"
},
["<leader>dus"] = {
function ()
local widgets = require('dap.ui.widgets');
local sidebar = widgets.sidebar(widgets.scopes);
sidebar.open();
end,
"Open debugging sidebar"
}
}
}
M.dap_go = {
plugin = true,
n = {
["<leader>dgt"] = {
function()
require('dap-go').debug_test()
end,
"Debug go test"
},
["<leader>dgl"] = {
function()
require('dap-go').debug_last()
end,
"Debug last go test"
}
}
}
M.gopher = {
plugin = true,
n = {
["<leader>gsj"] = {
"<cmd> GoTagAdd json <CR>",
"Add json struct tags"
},
["<leader>gse"] = {
"<cmd> GoTagAdd env <CR>",
"Add env struct tags"
},
["<leader>gsy"] = {
"<cmd> GoTagAdd yaml <CR>",
"Add yaml struct tags"
}
}
}
M.crates = {
n = {
["<leader>rcu"] = {
function ()
require('crates').upgrade_all_crates()
end,
"update crates"
}
}
}
return M

View File

@@ -0,0 +1,6 @@
require "nvchad.options"
-- add yours here!
-- local o = vim.o
-- o.cursorlineopt ='both' -- to enable cursorline!

View File

@@ -0,0 +1,55 @@
return {
{
"stevearc/conform.nvim",
-- event = 'BufWritePre', -- uncomment for format on save
config = function()
require "configs.conform"
end,
},
{
"christoomey/vim-tmux-navigator",
lazy = false,
},
{
"williamboman/mason.nvim",
opts = {
ensure_installed = {
"gopls",
"rust-analyzer",
"pyright",
"mypy",
"ruff",
"black",
"debugpy",
"powershell-editor-services",
"bash-language-server",
"eslint-lsp",
"js-debug-adapter",
"prettier",
"typescript-language-server"
},
},
},
{
"nvim-treesitter/nvim-treesitter",
opts = {
ensure_installed = {
"lua",
"javascript",
"typescript",
"tsx",
"go",
"terraform",
"c_sharp",
"bash",
},
},
},
{
"neovim/nvim-lspconfig",
config = function()
require("nvchad.configs.lspconfig").defaults()
require "configs.lspconfig"
end,
},
}