added more plugins
This commit is contained in:
		
							parent
							
								
									5aeddfdd5d
								
							
						
					
					
						commit
						f50ff82f33
					
				
							
								
								
									
										9
									
								
								init.lua
								
								
								
								
							
							
						
						
									
										9
									
								
								init.lua
								
								
								
								
							|  | @ -89,9 +89,10 @@ P.S. You can delete this when you're done too. It's your config now! :) | ||||||
| --  NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used) | --  NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used) | ||||||
| vim.g.mapleader = ' ' | vim.g.mapleader = ' ' | ||||||
| vim.g.maplocalleader = ' ' | vim.g.maplocalleader = ' ' | ||||||
|  | vim.opt.shell = '/bin/bash' | ||||||
| 
 | 
 | ||||||
| -- Set to true if you have a Nerd Font installed and selected in the terminal | -- Set to true if you have a Nerd Font installed and selected in the terminal | ||||||
| vim.g.have_nerd_font = false | vim.g.have_nerd_font = true | ||||||
| 
 | 
 | ||||||
| -- [[ Setting options ]] | -- [[ Setting options ]] | ||||||
| -- See `:help vim.opt` | -- See `:help vim.opt` | ||||||
|  | @ -102,7 +103,7 @@ vim.g.have_nerd_font = false | ||||||
| vim.opt.number = true | vim.opt.number = true | ||||||
| -- You can also add relative line numbers, to help with jumping. | -- You can also add relative line numbers, to help with jumping. | ||||||
| --  Experiment for yourself to see if you like it! | --  Experiment for yourself to see if you like it! | ||||||
| -- vim.opt.relativenumber = true | vim.opt.relativenumber = true | ||||||
| 
 | 
 | ||||||
| -- Enable mouse mode, can be useful for resizing splits for example! | -- Enable mouse mode, can be useful for resizing splits for example! | ||||||
| vim.opt.mouse = 'a' | vim.opt.mouse = 'a' | ||||||
|  | @ -885,7 +886,7 @@ require('lazy').setup({ | ||||||
|   -- |   -- | ||||||
|   --  Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. |   --  Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. | ||||||
|   --    For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins` |   --    For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins` | ||||||
|   -- { import = 'custom.plugins' }, |   { import = 'custom.plugins' }, | ||||||
| }, { | }, { | ||||||
|   ui = { |   ui = { | ||||||
|     -- If you are using a Nerd Font: set icons to an empty table which will use the |     -- If you are using a Nerd Font: set icons to an empty table which will use the | ||||||
|  | @ -910,3 +911,5 @@ require('lazy').setup({ | ||||||
| 
 | 
 | ||||||
| -- The line beneath this is called `modeline`. See `:help modeline` | -- The line beneath this is called `modeline`. See `:help modeline` | ||||||
| -- vim: ts=2 sts=2 sw=2 et | -- vim: ts=2 sts=2 sw=2 et | ||||||
|  | 
 | ||||||
|  | require 'lua/custom/vscode' | ||||||
|  |  | ||||||
|  | @ -0,0 +1,40 @@ | ||||||
|  | return { | ||||||
|  |   'ThePrimeagen/harpoon', | ||||||
|  |   branch = 'harpoon2', | ||||||
|  |   dependencies = { 'nvim-lua/plenary.nvim' }, | ||||||
|  |   config = function() | ||||||
|  |     local harpoon = require 'harpoon' | ||||||
|  | 
 | ||||||
|  |     -- REQUIRED | ||||||
|  |     harpoon:setup() | ||||||
|  |     -- REQUIRED | ||||||
|  | 
 | ||||||
|  |     vim.keymap.set('n', '<leader>a', function() | ||||||
|  |       harpoon:list():add() | ||||||
|  |     end) | ||||||
|  |     vim.keymap.set('n', '<C-e>', function() | ||||||
|  |       harpoon.ui:toggle_quick_menu(harpoon:list()) | ||||||
|  |     end) | ||||||
|  | 
 | ||||||
|  |     vim.keymap.set('n', '<leader>1', function() | ||||||
|  |       harpoon:list():select(1) | ||||||
|  |     end) | ||||||
|  |     vim.keymap.set('n', '<leader>2', function() | ||||||
|  |       harpoon:list():select(2) | ||||||
|  |     end) | ||||||
|  |     vim.keymap.set('n', '<leader>3', function() | ||||||
|  |       harpoon:list():select(3) | ||||||
|  |     end) | ||||||
|  |     vim.keymap.set('n', '<leader>4', function() | ||||||
|  |       harpoon:list():select(4) | ||||||
|  |     end) | ||||||
|  | 
 | ||||||
|  |     -- Toggle previous & next buffers stored within Harpoon list | ||||||
|  |     vim.keymap.set('n', '<C-S-P>', function() | ||||||
|  |       harpoon:list():prev() | ||||||
|  |     end) | ||||||
|  |     vim.keymap.set('n', '<C-S-N>', function() | ||||||
|  |       harpoon:list():next() | ||||||
|  |     end) | ||||||
|  |   end, | ||||||
|  | } | ||||||
|  | @ -2,4 +2,59 @@ | ||||||
| --  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 { | ||||||
|  |   'nvim-tree/nvim-tree.lua', | ||||||
|  |   version = '*', | ||||||
|  |   lazy = false, | ||||||
|  |   dependencies = { | ||||||
|  |     'nvim-tree/nvim-web-devicons', | ||||||
|  |   }, | ||||||
|  |   config = function() | ||||||
|  |     require('nvim-tree').setup {} | ||||||
|  |     -- | ||||||
|  |     -- disable netrw at the very start of your init.lua | ||||||
|  |     vim.g.loaded_netrw = 1 | ||||||
|  |     vim.g.loaded_netrwPlugin = 1 | ||||||
|  |     -- empty setup using defaults | ||||||
|  |     local nvim_tree_api = require 'nvim-tree.api' | ||||||
|  |     local function open_nvim_tree(data) | ||||||
|  |       -- buffer is a directory | ||||||
|  |       local directory = vim.fn.isdirectory(data.file) == 1 | ||||||
|  |       if directory then | ||||||
|  |         -- change to the directory | ||||||
|  |         vim.cmd.cd(data.file) | ||||||
|  |         -- open the tree | ||||||
|  |         nvim_tree_api.tree.open() | ||||||
|  |         return | ||||||
|  |       end | ||||||
|  | 
 | ||||||
|  |       -- buffer is a real file on the disk | ||||||
|  |       local real_file = vim.fn.filereadable(data.file) == 1 | ||||||
|  | 
 | ||||||
|  |       -- buffer is a [No Name] | ||||||
|  |       local no_name = data.file == '' and vim.bo[data.buf].buftype == '' | ||||||
|  | 
 | ||||||
|  |       if not real_file and not no_name then | ||||||
|  |         return | ||||||
|  |       end | ||||||
|  | 
 | ||||||
|  |       -- open the tree, find the file but don't focus it | ||||||
|  |       nvim_tree_api.tree.toggle { focus = false, find_file = true } | ||||||
|  |     end | ||||||
|  |     vim.api.nvim_create_autocmd({ 'VimEnter' }, { callback = open_nvim_tree }) | ||||||
|  |     vim.keymap.set('n', '<leader>x', function() | ||||||
|  |       nvim_tree_api.tree.open() | ||||||
|  |     end) | ||||||
|  | 
 | ||||||
|  |     vim.api.nvim_create_autocmd('BufEnter', { | ||||||
|  |       group = vim.api.nvim_create_augroup('NvimTreeClose', { clear = true }), | ||||||
|  |       pattern = 'NvimTree_*', | ||||||
|  |       callback = function() | ||||||
|  |         local layout = vim.api.nvim_call_function('winlayout', {}) | ||||||
|  |         if layout[1] == 'leaf' and vim.api.nvim_buf_get_option(vim.api.nvim_win_get_buf(layout[2]), 'filetype') == 'NvimTree' and layout[3] == nil then | ||||||
|  |           vim.cmd 'confirm quit' | ||||||
|  |         end | ||||||
|  |       end, | ||||||
|  |     }) | ||||||
|  |   end, | ||||||
|  | } | ||||||
|  |  | ||||||
|  | @ -0,0 +1,6 @@ | ||||||
|  | return { | ||||||
|  |   'ggandor/leap.nvim', | ||||||
|  |   config = function() | ||||||
|  |     require('leap').create_default_mappings() | ||||||
|  |   end, | ||||||
|  | } | ||||||
|  | @ -0,0 +1,135 @@ | ||||||
|  | if vim.g.vscode then | ||||||
|  |   local vscode = require 'vscode' | ||||||
|  |   --n: normal mode, x: visual mode, i: insert mode | ||||||
|  | 
 | ||||||
|  |   vim.keymap.set({ 'n', 'x' }, '<leader>,', function() | ||||||
|  |     vscode.action 'workbench.action.showCommands' | ||||||
|  |   end) | ||||||
|  |   vim.keymap.set({ 'n', 'x' }, '<leader><leader>', function() | ||||||
|  |     vscode.action 'workbench.action.quickOpen' | ||||||
|  |   end) | ||||||
|  |   vim.keymap.set({ 'n', 'x' }, '<leader>ts', function() | ||||||
|  |     vscode.action 'workbench.action.toggleSidebarVisibility' | ||||||
|  |   end) | ||||||
|  |   vim.keymap.set({ 'n', 'x' }, '<leader>x', function() | ||||||
|  |     vscode.action 'workbench.view.explorer' | ||||||
|  |   end) | ||||||
|  |   vim.keymap.set({ 'n', 'x' }, '<leader>wr', function() | ||||||
|  |     vscode.action 'workbench.action.reloadWindow' | ||||||
|  |   end) | ||||||
|  |   vim.keymap.set({ 'n', 'x' }, '<leader>wq', function() | ||||||
|  |     vscode.action 'workbench.action.quit' | ||||||
|  |   end) | ||||||
|  | 
 | ||||||
|  |   -- find key | ||||||
|  |   vim.keymap.set({ 'n', 'x' }, '<leader>sf', function() | ||||||
|  |     vscode.action 'workbench.action.findInFiles' | ||||||
|  |   end) | ||||||
|  |   vim.keymap.set({ 'n', 'x' }, '<leader>sn', function() | ||||||
|  |     vscode.action 'workbench.action.focusNextSearchResult' | ||||||
|  |   end) | ||||||
|  |   vim.keymap.set({ 'n', 'x' }, '<leader>sp', function() | ||||||
|  |     vscode.action 'workbench.action.focusPreviousSearchResult' | ||||||
|  |   end) | ||||||
|  | 
 | ||||||
|  |   -- document keys | ||||||
|  |   vim.keymap.set({ 'n', 'x' }, '<leader>f', function() | ||||||
|  |     vscode.action 'editor.action.formatDocument' | ||||||
|  |   end) | ||||||
|  |   vim.keymap.set('n', '<leader>ds', function() | ||||||
|  |     vscode.action 'cSpell.toggleEnableSpellChecker' | ||||||
|  |     vscode.call 'workbench.action.quickOpenNavigateNextInEditorPicker' | ||||||
|  |     vscode.call 'workbench.action.quickOpenNavigateNextInEditorPicker' | ||||||
|  |   end) | ||||||
|  |   vim.keymap.set({ 'n', 'x' }, '<leader>.', function() | ||||||
|  |     vscode.action 'editor.action.quickFix' | ||||||
|  |   end) | ||||||
|  |   vim.keymap.set({ 'n', 'x' }, '<leader>rn', function() | ||||||
|  |     vscode.action 'editor.action.rename' | ||||||
|  |   end) | ||||||
|  |   vim.keymap.set({ 'n', 'x' }, '<leader>rr', function() | ||||||
|  |     vscode.action 'editor.action.refactor' | ||||||
|  |   end) | ||||||
|  |   vim.keymap.set({ 'n', 'x' }, '<leader>ri', function() | ||||||
|  |     vscode.action 'editor.action.organizeImports' | ||||||
|  |   end) | ||||||
|  |   vim.keymap.set('n', 'gd', function() | ||||||
|  |     vscode.action 'editor.action.revealDefinition' | ||||||
|  |   end) | ||||||
|  |   vim.keymap.set('n', 'gi', function() | ||||||
|  |     vscode.action 'editor.action.goToImplementation' | ||||||
|  |   end) | ||||||
|  |   vim.keymap.set('n', 'K', function() | ||||||
|  |     vscode.action 'editor.action.scrollUpHover' | ||||||
|  |   end) | ||||||
|  |   vim.keymap.set('n', '<C-k>', function() | ||||||
|  |     vscode.action 'editor.action.triggerParameterHints' | ||||||
|  |   end) | ||||||
|  |   vim.keymap.set('n', 'gr', function() | ||||||
|  |     vscode.action 'references-view.findReferences' | ||||||
|  |   end) | ||||||
|  |   -- editor.action.findReferences | ||||||
|  |   vim.keymap.set('n', '[d', function() | ||||||
|  |     vscode.action 'editor.action.marker.prev' | ||||||
|  |   end) | ||||||
|  |   vim.keymap.set('n', ']d', function() | ||||||
|  |     vscode.action 'editor.action.marker.next' | ||||||
|  |   end) | ||||||
|  |   vim.keymap.set('n', '<leader>e', function() | ||||||
|  |     vscode.action 'workbench.actions.view.problems' | ||||||
|  |   end) | ||||||
|  | 
 | ||||||
|  |   -- editor keys | ||||||
|  |   vim.keymap.set({ 'n', 'x' }, '<leader>ep', function() | ||||||
|  |     vscode.action 'workbench.action.pinEditor' | ||||||
|  |   end) | ||||||
|  |   vim.keymap.set({ 'n', 'x' }, '<leader>eP', function() | ||||||
|  |     vscode.action 'workbench.action.unpinEditor' | ||||||
|  |   end) | ||||||
|  |   vim.keymap.set({ 'n', 'x' }, '<leader>es', function() | ||||||
|  |     vscode.action 'workbench.action.splitEditor' | ||||||
|  |   end) | ||||||
|  |   vim.keymap.set({ 'n', 'x' }, '<leader>ev', function() | ||||||
|  |     vscode.action 'workbench.action.splitEditorDown' | ||||||
|  |   end) | ||||||
|  |   vim.keymap.set({ 'n', 'x' }, '<leader>et', function() | ||||||
|  |     vscode.action 'workbench.action.closeOtherEditors' | ||||||
|  |   end) | ||||||
|  |   vim.keymap.set({ 'n', 'x' }, '<leader>el', function() | ||||||
|  |     vscode.action 'workbench.action.moveEditorLeftInGroup' | ||||||
|  |   end) | ||||||
|  |   vim.keymap.set({ 'n', 'x' }, '<leader>el', function() | ||||||
|  |     vscode.action 'workbench.action.moveEditorRightInGroup' | ||||||
|  |   end) | ||||||
|  |   vim.keymap.set({ 'n', 'x' }, 'Q', function() | ||||||
|  |     vscode.call 'workbench.action.files.save' | ||||||
|  |     vscode.call 'workbench.action.unpinEditor' | ||||||
|  |     vscode.action 'workbench.action.closeActiveEditor' | ||||||
|  |   end) | ||||||
|  | 
 | ||||||
|  |   -- vscode-harpoon | ||||||
|  |   vim.keymap.set('n', '<leader>ha', function() | ||||||
|  |     vscode.action 'vscode-harpoon.addEditor' | ||||||
|  |   end) | ||||||
|  |   vim.keymap.set('n', '<leader>hp', function() | ||||||
|  |     vscode.action 'vscode-harpoon.editorQuickPick' | ||||||
|  |   end) | ||||||
|  |   vim.keymap.set('n', '<leader>he', function() | ||||||
|  |     vscode.action 'vscode-harpoon.editEditors' | ||||||
|  |   end) | ||||||
|  |   vim.keymap.set('n', '<leader>h1', function() | ||||||
|  |     vscode.action 'vscode-harpoon.goToEditor1' | ||||||
|  |   end) | ||||||
|  |   vim.keymap.set('n', '<leader>h2', function() | ||||||
|  |     vscode.action 'vscode-harpoon.goToEditor2' | ||||||
|  |   end) | ||||||
|  |   vim.keymap.set('n', '<leader>h3', function() | ||||||
|  |     vscode.action 'vscode-harpoon.goToEditor3' | ||||||
|  |   end) | ||||||
|  |   vim.keymap.set('n', '<leader>h4', function() | ||||||
|  |     vscode.action 'vscode-harpoon.goToEditor4' | ||||||
|  |   end) | ||||||
|  |   vim.keymap.set('n', '<leader>h5', function() | ||||||
|  |     vscode.action 'vscode-harpoon.goToEditor5' | ||||||
|  |   end) | ||||||
|  | end | ||||||
		Loading…
	
		Reference in New Issue