From f8acb4edc93d2570856381eb7fb6f75db3955cf6 Mon Sep 17 00:00:00 2001 From: Luca Matei Pintilie Date: Tue, 21 Dec 2021 21:26:50 +0100 Subject: Initial commit2 --- .config/nvim/lua/custom/init.lua | 84 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 .config/nvim/lua/custom/init.lua (limited to '.config/nvim/lua/custom/init.lua') diff --git a/.config/nvim/lua/custom/init.lua b/.config/nvim/lua/custom/init.lua new file mode 100644 index 0000000..473ff84 --- /dev/null +++ b/.config/nvim/lua/custom/init.lua @@ -0,0 +1,84 @@ +-- This is where your custom modules and plugins go. +-- See the wiki for a guide on how to extend NvChad +local hooks = require "core.hooks" +vim.api.nvim_command("nnoremap :m .+1==") +vim.api.nvim_command("nnoremap :m .-2==") +vim.api.nvim_command("inoremap :m .+1==gi") +vim.api.nvim_command("inoremap :m .-2==gi") +vim.api.nvim_command("vnoremap :m '>+1gv=gv") +vim.api.nvim_command("vnoremap :m '<-2gv=gv") + +-- NOTE: To use this, make a copy with `cp example_init.lua init.lua` + +-------------------------------------------------------------------- + +-- To modify packaged plugin configs, use the overrides functionality +-- if the override does not exist in the plugin config, make or request a PR, +-- or you can override the whole plugin config with 'chadrc' -> M.plugins.default_plugin_config_replace{} +-- this will run your config instead of the NvChad config for the given plugin + +-- hooks.override("lsp", "publish_diagnostics", function(current) +-- current.virtual_text = false; +-- return current; +-- end) + +-- To add new mappings, use the "setup_mappings" hook, +-- you can set one or many mappings +-- example below: + +-- hooks.add("setup_mappings", function(map) +-- map("n", "cc", "gg0vG$d", opt) -- example to delete the buffer +-- .... many more mappings .... +-- end) + +-- To add new plugins, use the "install_plugin" hook, +-- NOTE: we heavily suggest using Packer's lazy loading (with the 'event' field) +-- see: https://github.com/wbthomason/packer.nvim +-- examples below: + +hooks.add("install_plugins", function(use) + use { + "williamboman/nvim-lsp-installer", + config = function() + local lsp_installer = require "nvim-lsp-installer" + + lsp_installer.on_server_ready(function(server) + local opts = {} + + if server.name == "denols" then + opts.root_dir = vim.loop.cwd + end + + server:setup(opts) + vim.cmd [[ do User LspAttachBuffers ]] + end) + end, + } + -- Custom stuff + use { "nathom/filetype.nvim" } + + use { + "karb94/neoscroll.nvim", + opt = true, + config = function() + require("neoscroll").setup() + end, + + -- lazy loading + setup = function() + require("core.utils").packer_lazy_load "neoscroll.nvim" + end, + } + + use { + "prettier/vim-prettier", + } + use { + "editorconfig/editorconfig-vim", + } +end) + +-- alternatively, put this in a sub-folder like "lua/custom/plugins/mkdir" +-- then source it with + +-- require "custom.plugins.mkdir" -- cgit v1.2.3