aboutsummaryrefslogtreecommitdiff
path: root/nvim/lua
diff options
context:
space:
mode:
Diffstat (limited to 'nvim/lua')
-rw-r--r--nvim/lua/autocmds.lua1
-rw-r--r--nvim/lua/chadrc.lua24
-rw-r--r--nvim/lua/configs/conform.lua15
-rw-r--r--nvim/lua/configs/lazy.lua47
-rw-r--r--nvim/lua/configs/lspconfig.lua67
-rw-r--r--nvim/lua/mappings.lua8
-rw-r--r--nvim/lua/options.lua9
-rw-r--r--nvim/lua/plugins/init.lua50
8 files changed, 221 insertions, 0 deletions
diff --git a/nvim/lua/autocmds.lua b/nvim/lua/autocmds.lua
new file mode 100644
index 0000000..d2db0bb
--- /dev/null
+++ b/nvim/lua/autocmds.lua
@@ -0,0 +1 @@
+require "nvchad.autocmds"
diff --git a/nvim/lua/chadrc.lua b/nvim/lua/chadrc.lua
new file mode 100644
index 0000000..9f9eecc
--- /dev/null
+++ b/nvim/lua/chadrc.lua
@@ -0,0 +1,24 @@
+-- This file needs to have same structure as nvconfig.lua
+-- https://github.com/NvChad/ui/blob/v3.0/lua/nvconfig.lua
+-- Please read that file to know all available options :(
+
+---@type ChadrcConfig
+local M = {}
+
+M.base46 = {
+ theme = "catppuccin",
+
+ -- hl_override = {
+ -- Comment = { italic = true },
+ -- ["@comment"] = { italic = true },
+ -- },
+}
+
+-- M.nvdash = { load_on_startup = true }
+-- M.ui = {
+-- tabufline = {
+-- lazyload = false
+-- }
+--}
+
+return M
diff --git a/nvim/lua/configs/conform.lua b/nvim/lua/configs/conform.lua
new file mode 100644
index 0000000..35ba6cf
--- /dev/null
+++ b/nvim/lua/configs/conform.lua
@@ -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,
+ -- },
+}
+
+return options
diff --git a/nvim/lua/configs/lazy.lua b/nvim/lua/configs/lazy.lua
new file mode 100644
index 0000000..cd170bd
--- /dev/null
+++ b/nvim/lua/configs/lazy.lua
@@ -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",
+ },
+ },
+ },
+}
diff --git a/nvim/lua/configs/lspconfig.lua b/nvim/lua/configs/lspconfig.lua
new file mode 100644
index 0000000..cc741bd
--- /dev/null
+++ b/nvim/lua/configs/lspconfig.lua
@@ -0,0 +1,67 @@
+require("nvchad.configs.lspconfig").defaults()
+
+local servers = { "html", "cssls", "rust_analyzer", "zls" }
+vim.lsp.enable(servers)
+
+local lspconfig = require("lspconfig")
+
+-- Rust
+lspconfig.rust_analyzer.setup{}
+
+-- Zig
+lspconfig.zls.setup{
+ cmd = { "zls" },
+ filetypes = { "zig", "zir" },
+ root_dir = lspconfig.util.root_pattern("build.zig", "zls.json", ".git")
+}
+
+-- TS/JS
+lspconfig.ts_ls.setup {
+ cmd = { "typescript-language-server", "--stdio" },
+ filetypes = {
+ "javascript", "javascriptreact",
+ "typescript", "typescriptreact",
+ "javascript.jsx", "typescript.tsx"
+ },
+ root_dir = lspconfig.util.root_pattern("package.json", "tsconfig.json", ".git")
+}
+
+-- Python
+lspconfig.pylsp.setup {
+ cmd = { "pylsp" },
+ filetypes = { "python" },
+ settings = {
+ pylsp = {
+ plugins = {
+ black = { enabled = true },
+ ruff = { enabled = true },
+ flake8 = { enabled = true },
+ isort = { enabled = true }
+ }
+ }
+ }
+}
+
+-- Elixir
+lspconfig.elixirls.setup {
+ cmd = { "elixir-ls" },
+ filetypes = { "elixir" },
+}
+
+-- Erlang
+lspconfig.erlangls.setup {
+ cmd = { "erlang-ls" },
+ filetypes = { "erlang" },
+}
+
+-- C/C++
+lspconfig.clangd.setup {
+ cmd = { "clangd" },
+ filetypes = { "c", "cpp" }
+}
+
+-- Gopls
+lspconfig.gopls.setup {
+ cmd = { "gopls" },
+ filetype = { "go" }
+}
diff --git a/nvim/lua/mappings.lua b/nvim/lua/mappings.lua
new file mode 100644
index 0000000..79e634e
--- /dev/null
+++ b/nvim/lua/mappings.lua
@@ -0,0 +1,8 @@
+require "nvchad.mappings"
+
+local map = vim.keymap.set
+local unmap = vim.keymap.del
+
+map("n", ";", ":", { desc = "CMD enter command mode" })
+map({ "n", "i", "v" }, "<C-s>", "<cmd> w <cr>")
+map({ "n", "v" }, "<C-f>", ":%s/")
diff --git a/nvim/lua/options.lua b/nvim/lua/options.lua
new file mode 100644
index 0000000..c5af716
--- /dev/null
+++ b/nvim/lua/options.lua
@@ -0,0 +1,9 @@
+require "nvchad.options"
+
+-- add yours here!
+vim.opt.wrap = false
+vim.opt.spell = true
+vim.opt.spelllang = { "en" }
+
+-- local o = vim.o
+-- o.cursorlineopt ='both' -- to enable cursorline!
diff --git a/nvim/lua/plugins/init.lua b/nvim/lua/plugins/init.lua
new file mode 100644
index 0000000..c9b7ea8
--- /dev/null
+++ b/nvim/lua/plugins/init.lua
@@ -0,0 +1,50 @@
+return {
+ {
+ "stevearc/conform.nvim",
+ -- event = 'BufWritePre', -- uncomment for format on save
+ opts = require "configs.conform",
+ },
+
+ -- These are some examples, uncomment them if you want to see them work!
+ {
+ "neovim/nvim-lspconfig",
+ config = function()
+ require "configs.lspconfig"
+ end,
+ },
+
+ {
+ "mbbill/undotree",
+ event = "BufReadPost",
+ config = function()
+ vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle, { desc = "Toggle UndoTree" })
+ end,
+ },
+
+ -- test new blink
+ -- { import = "nvchad.blink.lazyspec" },
+
+ {
+ "nvim-treesitter/nvim-treesitter",
+ opts = {
+ ensure_installed = {
+ "vim", "lua", "vimdoc",
+ "html", "css", "elixir", "rust"
+ },
+ },
+ },
+
+ {
+ "christoomey/vim-tmux-navigator",
+ lazy = false,
+ },
+
+ {
+ "nvim-tree/nvim-tree.lua",
+ opts = {
+ view = {
+ side = "right"
+ }
+ }
+ },
+}