* 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
This commit is contained in:
PeteChu 2023-03-31 12:07:39 +07:00
parent 42ca0e4245
commit 049d71cf0f
7 changed files with 24 additions and 7 deletions

View File

@ -1 +1,4 @@
vim.opt.relativenumber = true vim.opt.relativenumber = true
vim.opt.expandtab = true
vim.opt.smarttab = true

View File

@ -22,4 +22,4 @@ keymap("n", "<C-k>", "<C-w>k", opts)
keymap("n", "<C-l>", "<C-w>l", opts) keymap("n", "<C-l>", "<C-w>l", opts)
-- Nvimtree -- Nvimtree
keymap('n', '<leader>n', ":NvimTreeToggle<cr>") keymap('n', '<leader>n', ":NvimTreeToggle<cr>", {silent = true, noremap = true})

View File

@ -15,7 +15,7 @@ local function open_nvim_tree(data)
end end
-- Auto open -- Auto open
vim.api.nvim_create_autocmd({ "VimEnter" }, { callback = open_nvim_tree }) -- vim.api.nvim_create_autocmd({ "VimEnter" }, { callback = open_nvim_tree })
-- Auto close -- Auto close
vim.api.nvim_create_autocmd({"QuitPre"}, { vim.api.nvim_create_autocmd({"QuitPre"}, {

View File

@ -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.mapleader = ' '
vim.g.maplocalleader = ' ' 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 -- Install package manager
-- https://github.com/folke/lazy.nvim -- https://github.com/folke/lazy.nvim
-- `:help lazy.nvim.txt` for more info -- `: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 -- 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. -- These are some example plugins that I've included in the kickstart repository.
-- Uncomment any of the lines below to enable them. -- Uncomment any of the lines below to enable them.
-- require 'kickstart.plugins.autoformat', require 'kickstart.plugins.autoformat',
-- require 'kickstart.plugins.debug', require 'kickstart.plugins.debug',
-- NOTE: The import below automatically adds your own plugins, configuration, etc from `lua/custom/plugins/*.lua` -- 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 -- You can use this folder to prevent any conflicts with this init.lua if you're interested in keeping

View File

@ -0,0 +1,6 @@
return {
"windwp/nvim-autopairs",
config = function()
require("nvim-autopairs").setup {}
end,
}

View File

@ -2,4 +2,6 @@
-- I promise not to create any merge conflicts in this directory :) -- I promise not to create any merge conflicts in this directory :)
-- --
-- See the kickstart.nvim README for more information -- See the kickstart.nvim README for more information
return {} return {
'fatih/vim-go',
}

View File

@ -6,7 +6,9 @@ return {
"nvim-tree/nvim-web-devicons", "nvim-tree/nvim-web-devicons",
}, },
config = function() config = function()
require("nvim-tree").setup {} require("nvim-tree").setup {
filters = { custom = { "^.git$" } }
}
end, end,
} }
} }