* feat(defaults.lua): add relative line numbers
* feat(keymaps.lua): add keymaps for buffer navigation, terminal, and nvimtree * feat(nvim-tree.lua): add nvim-tree plugin with setup function
This commit is contained in:
		
							parent
							
								
									4a37a0a9b1
								
							
						
					
					
						commit
						fb273bd85e
					
				|  | @ -0,0 +1 @@ | ||||||
|  | vim.opt.relativenumber = true | ||||||
|  | @ -0,0 +1,25 @@ | ||||||
|  | local opts = { noremap = true, silent = true } | ||||||
|  | 
 | ||||||
|  | local term_opts = { silent = true } | ||||||
|  | 
 | ||||||
|  | function keymap(mode, lhs, rhs, opts) | ||||||
|  |     local options = { noremap = true } | ||||||
|  |     if opts then | ||||||
|  |         options = vim.tbl_extend("force", options, opts) | ||||||
|  |     end | ||||||
|  |     vim.api.nvim_set_keymap(mode, lhs, rhs, options) | ||||||
|  | end | ||||||
|  | 
 | ||||||
|  | -- Navigate buffers | ||||||
|  | keymap("n", "<S-l>", ":bnext<CR>", opts) | ||||||
|  | keymap("n", "<S-h>", ":bprevious<CR>", opts) | ||||||
|  | 
 | ||||||
|  | -- Terminal | ||||||
|  | -- Better window navigation | ||||||
|  | keymap("n", "<C-h>", "<C-w>h", opts) | ||||||
|  | keymap("n", "<C-j>", "<C-w>j", opts) | ||||||
|  | keymap("n", "<C-k>", "<C-w>k", opts) | ||||||
|  | keymap("n", "<C-l>", "<C-w>l", opts) | ||||||
|  | 
 | ||||||
|  | -- Nvimtree | ||||||
|  | keymap('n', '<leader>n', ":NvimTreeToggle<cr>") | ||||||
|  | @ -0,0 +1,12 @@ | ||||||
|  | return { | ||||||
|  |     { | ||||||
|  |         "nvim-tree/nvim-tree.lua", | ||||||
|  |         version = "*", | ||||||
|  |         dependencies = { | ||||||
|  |             "nvim-tree/nvim-web-devicons", | ||||||
|  |         }, | ||||||
|  |         config = function() | ||||||
|  |             require("nvim-tree").setup {} | ||||||
|  |         end, | ||||||
|  |     } | ||||||
|  | } | ||||||
		Loading…
	
		Reference in New Issue