From 049d71cf0f1914d515e7e1fc28ffed2e68bf8815 Mon Sep 17 00:00:00 2001 From: PeteChu Date: Fri, 31 Mar 2023 12:07:39 +0700 Subject: [PATCH] * chore(defaults.lua): add expandtab and smarttab options * chore(keymaps.lua): add silent and noremap options to NvimTreeToggle keymap * chore(nvim-tree.lua): comment out auto open autocmd * chore(init.lua): disable netrw and add autoformat and debug plugins * feat(autopairs.lua): add nvim-autopairs plugin with default configuration * feat(init.lua): add vim-go plugin * feat(nvim-tree.lua): add custom filter to ignore .git directory in nvim-tree view --- after/plugin/defaults.lua | 5 ++++- after/plugin/keymaps.lua | 2 +- after/plugin/nvim-tree.lua | 2 +- init.lua | 8 ++++++-- lua/custom/plugins/autopairs.lua | 6 ++++++ lua/custom/plugins/init.lua | 4 +++- lua/custom/plugins/nvim-tree.lua | 4 +++- 7 files changed, 24 insertions(+), 7 deletions(-) create mode 100644 lua/custom/plugins/autopairs.lua diff --git a/after/plugin/defaults.lua b/after/plugin/defaults.lua index e4b6011a..77baf46f 100644 --- a/after/plugin/defaults.lua +++ b/after/plugin/defaults.lua @@ -1 +1,4 @@ -vim.opt.relativenumber = true \ No newline at end of file +vim.opt.relativenumber = true + +vim.opt.expandtab = true +vim.opt.smarttab = true \ No newline at end of file diff --git a/after/plugin/keymaps.lua b/after/plugin/keymaps.lua index 109813aa..54731f87 100644 --- a/after/plugin/keymaps.lua +++ b/after/plugin/keymaps.lua @@ -22,4 +22,4 @@ keymap("n", "", "k", opts) keymap("n", "", "l", opts) -- Nvimtree -keymap('n', 'n', ":NvimTreeToggle") +keymap('n', 'n', ":NvimTreeToggle", {silent = true, noremap = true}) \ No newline at end of file diff --git a/after/plugin/nvim-tree.lua b/after/plugin/nvim-tree.lua index e85d0184..bdbfd8d9 100644 --- a/after/plugin/nvim-tree.lua +++ b/after/plugin/nvim-tree.lua @@ -15,7 +15,7 @@ local function open_nvim_tree(data) end -- Auto open -vim.api.nvim_create_autocmd({ "VimEnter" }, { callback = open_nvim_tree }) +-- vim.api.nvim_create_autocmd({ "VimEnter" }, { callback = open_nvim_tree }) -- Auto close vim.api.nvim_create_autocmd({"QuitPre"}, { diff --git a/init.lua b/init.lua index 72890326..88820d62 100644 --- a/init.lua +++ b/init.lua @@ -42,6 +42,10 @@ P.S. You can delete this when you're done too. It's your config now :) vim.g.mapleader = ' ' vim.g.maplocalleader = ' ' +-- disable netrw at the very start of your init.lua (strongly advised) +vim.g.loaded_netrw = 1 +vim.g.loaded_netrwPlugin = 1 + -- Install package manager -- https://github.com/folke/lazy.nvim -- `:help lazy.nvim.txt` for more info @@ -175,8 +179,8 @@ require('lazy').setup({ -- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart -- These are some example plugins that I've included in the kickstart repository. -- Uncomment any of the lines below to enable them. - -- require 'kickstart.plugins.autoformat', - -- require 'kickstart.plugins.debug', + require 'kickstart.plugins.autoformat', + require 'kickstart.plugins.debug', -- NOTE: The import below automatically adds your own plugins, configuration, etc from `lua/custom/plugins/*.lua` -- You can use this folder to prevent any conflicts with this init.lua if you're interested in keeping diff --git a/lua/custom/plugins/autopairs.lua b/lua/custom/plugins/autopairs.lua new file mode 100644 index 00000000..11367f68 --- /dev/null +++ b/lua/custom/plugins/autopairs.lua @@ -0,0 +1,6 @@ +return { + "windwp/nvim-autopairs", + config = function() + require("nvim-autopairs").setup {} + end, +} \ No newline at end of file diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index be0eb9d8..d6e52fbb 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -2,4 +2,6 @@ -- I promise not to create any merge conflicts in this directory :) -- -- See the kickstart.nvim README for more information -return {} +return { + 'fatih/vim-go', +} diff --git a/lua/custom/plugins/nvim-tree.lua b/lua/custom/plugins/nvim-tree.lua index 0fcdf284..5b7c4668 100644 --- a/lua/custom/plugins/nvim-tree.lua +++ b/lua/custom/plugins/nvim-tree.lua @@ -6,7 +6,9 @@ return { "nvim-tree/nvim-web-devicons", }, config = function() - require("nvim-tree").setup {} + require("nvim-tree").setup { + filters = { custom = { "^.git$" } } + } end, } } \ No newline at end of file