* refactor(defaults.lua): remove trailing whitespace

* feat(defaults.lua): add swapfile option and set it to false
* refactor(keymaps.lua): add whitespace for readability
* feat(keymaps.lua): add keymap to open folder in workspace in tmux session
* feat(keymaps.lua): add keymaps for buffer delete and buffer wipeout
* chore(treesitter.lua): remove treesitter configuration file

* chore(init.lua): comment out debug plugin
* feat(init.lua): enable auto_install for nvim-treesitter
* feat(custom/plugins/init.lua): add bufdelete.nvim plugin to custom plugins list
This commit is contained in:
PeteChu 2023-04-03 11:45:59 +07:00
parent d20aea7ca4
commit 5c8fa11c53
5 changed files with 18 additions and 13 deletions

View File

@ -8,3 +8,5 @@ vim.opt.incsearch = true
vim.opt.scrolloff = 8 vim.opt.scrolloff = 8
vim.opt.colorcolumn = "80" vim.opt.colorcolumn = "80"
vim.opt.swapfile = false

View File

@ -22,14 +22,14 @@ 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>", {silent = true, noremap = true, desc = "Toggle [N]vimtree"}) keymap('n', '<leader>n', ":NvimTreeToggle<cr>", { silent = true, noremap = true, desc = "Toggle [N]vimtree" })
-- UndoTree -- UndoTree
keymap('n', '<leader>u', ":UndotreeToggle<cr>", { desc = "Toggle [U]ndo tree" }) keymap('n', '<leader>u', ":UndotreeToggle<cr>", { desc = "Toggle [U]ndo tree" })
-- Move line -- Move line
keymap('v', 'J', ":m '>+1<CR>gv=gv", {noremap = true}) keymap('v', 'J', ":m '>+1<CR>gv=gv", { noremap = true })
keymap('v', 'K', ":m '<-2<CR>gv=gv", {noremap = true}) keymap('v', 'K', ":m '<-2<CR>gv=gv", { noremap = true })
-- Search cursor in the middle -- Search cursor in the middle
keymap('n', 'n', "nzzzv") keymap('n', 'n', "nzzzv")
@ -49,6 +49,9 @@ keymap('n', "<C-j>", "<cmd>cprev<CR>zz")
keymap('n', "<leader>k", "<cmd>lnext<CR>zz") keymap('n', "<leader>k", "<cmd>lnext<CR>zz")
keymap('n', "<leader>j", "<cmd>lprev<CR>zz") keymap('n', "<leader>j", "<cmd>lprev<CR>zz")
-- Open folder in workspace in tmux session
keymap("n", "<leader>op", "<cmd>silent !tmux neww tmux-sessionizer<CR>", { desc = "[O]pen [P]roject" })
-- replace selected word in the file -- replace selected word in the file
keymap("n", "<leader>R", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]], { desc = "[R]eplace words in the file" }) keymap("n", "<leader>R", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]], { desc = "[R]eplace words in the file" })
@ -57,3 +60,7 @@ keymap("n", "<leader>x", "<cmd>!chmod +x %<CR>", { silent = true, desc = "Make [
-- Do nothing -- Do nothing
keymap("n", "Q", "<nop>") keymap("n", "Q", "<nop>")
-- Bufdelete.vim
keymap("n", "<leader>bd", ":Bdelete<CR>", {desc = "[B]uffer [D]elete"})
keymap("n", "<leader>bw", ":Bwipeout<CR>", {desc = "[B]uffer [W]ipeout"})

View File

@ -1,5 +0,0 @@
require('nvim-treesitter.configs').setup {
-- Add languages to be installed here that you want installed for treesitter
ensure_installed = {'terraform'},
auto_install = true
}

View File

@ -180,7 +180,7 @@ require('lazy').setup({
-- 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
@ -295,7 +295,7 @@ require('nvim-treesitter.configs').setup {
ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'typescript', 'help', 'vim' }, ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'typescript', 'help', 'vim' },
-- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!) -- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!)
auto_install = false, auto_install = true,
highlight = { enable = true }, highlight = { enable = true },
indent = { enable = true, disable = { 'python' } }, indent = { enable = true, disable = { 'python' } },

View File

@ -4,5 +4,6 @@
-- See the kickstart.nvim README for more information -- See the kickstart.nvim README for more information
return { return {
'fatih/vim-go', 'fatih/vim-go',
'mbbill/undotree' 'mbbill/undotree',
'famiu/bufdelete.nvim',
} }