updated nvim config
This commit is contained in:
		
							parent
							
								
									19afab1641
								
							
						
					
					
						commit
						0b663c55a8
					
				
							
								
								
									
										48
									
								
								init.lua
								
								
								
								
							
							
						
						
									
										48
									
								
								init.lua
								
								
								
								
							|  | @ -91,7 +91,7 @@ vim.g.mapleader = ' ' | ||||||
| vim.g.maplocalleader = ' ' | vim.g.maplocalleader = ' ' | ||||||
| 
 | 
 | ||||||
| -- Set to true if you have a Nerd Font installed | -- Set to true if you have a Nerd Font installed | ||||||
| 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 +102,8 @@ 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 | ||||||
|  | vim.opt.wrap = false | ||||||
| 
 | 
 | ||||||
| -- 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' | ||||||
|  | @ -152,7 +153,7 @@ vim.opt.inccommand = 'split' | ||||||
| vim.opt.cursorline = true | vim.opt.cursorline = true | ||||||
| 
 | 
 | ||||||
| -- Minimal number of screen lines to keep above and below the cursor. | -- Minimal number of screen lines to keep above and below the cursor. | ||||||
| vim.opt.scrolloff = 10 | vim.opt.scrolloff = 13 | ||||||
| 
 | 
 | ||||||
| -- [[ Basic Keymaps ]] | -- [[ Basic Keymaps ]] | ||||||
| --  See `:help vim.keymap.set()` | --  See `:help vim.keymap.set()` | ||||||
|  | @ -176,19 +177,24 @@ vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagn | ||||||
| vim.keymap.set('t', '<Esc><Esc>', '<C-\\><C-n>', { desc = 'Exit terminal mode' }) | vim.keymap.set('t', '<Esc><Esc>', '<C-\\><C-n>', { desc = 'Exit terminal mode' }) | ||||||
| 
 | 
 | ||||||
| -- TIP: Disable arrow keys in normal mode | -- TIP: Disable arrow keys in normal mode | ||||||
| -- vim.keymap.set('n', '<left>', '<cmd>echo "Use h to move!!"<CR>') | vim.keymap.set('n', '<left>', '<cmd>echo "Use h to move!!"<CR>') | ||||||
| -- vim.keymap.set('n', '<right>', '<cmd>echo "Use l to move!!"<CR>') | vim.keymap.set('n', '<right>', '<cmd>echo "Use l to move!!"<CR>') | ||||||
| -- vim.keymap.set('n', '<up>', '<cmd>echo "Use k to move!!"<CR>') | vim.keymap.set('n', '<up>', '<cmd>echo "Use k to move!!"<CR>') | ||||||
| -- vim.keymap.set('n', '<down>', '<cmd>echo "Use j to move!!"<CR>') | vim.keymap.set('n', '<down>', '<cmd>echo "Use j to move!!"<CR>') | ||||||
|  | 
 | ||||||
|  | vim.keymap.set('i', '<left>', '<cmd>echo "Use h to move!!"<CR>') | ||||||
|  | vim.keymap.set('i', '<right>', '<cmd>echo "Use l to move!!"<CR>') | ||||||
|  | vim.keymap.set('i', '<up>', '<cmd>echo "Use k to move!!"<CR>') | ||||||
|  | vim.keymap.set('i', '<down>', '<cmd>echo "Use j to move!!"<CR>') | ||||||
| 
 | 
 | ||||||
| -- Keybinds to make split navigation easier. | -- Keybinds to make split navigation easier. | ||||||
| --  Use CTRL+<hjkl> to switch between windows | --  Use CTRL+<hjkl> to switch between windows | ||||||
| -- | -- | ||||||
| --  See `:help wincmd` for a list of all window commands | --  See `:help wincmd` for a list of all window commands | ||||||
| vim.keymap.set('n', '<C-h>', '<C-w><C-h>', { desc = 'Move focus to the left window' }) | --vim.keymap.set('n', '<C-h>', '<C-w><C-h>', { desc = 'Move focus to the left window' }) | ||||||
| vim.keymap.set('n', '<C-l>', '<C-w><C-l>', { desc = 'Move focus to the right window' }) | --vim.keymap.set('n', '<C-l>', '<C-w><C-l>', { desc = 'Move focus to the right window' }) | ||||||
| vim.keymap.set('n', '<C-j>', '<C-w><C-j>', { desc = 'Move focus to the lower window' }) | --vim.keymap.set('n', '<C-j>', '<C-w><C-j>', { desc = 'Move focus to the lower window' }) | ||||||
| vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper window' }) | --vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper window' }) | ||||||
| 
 | 
 | ||||||
| -- [[ Basic Autocommands ]] | -- [[ Basic Autocommands ]] | ||||||
| --  See `:help lua-guide-autocommands` | --  See `:help lua-guide-autocommands` | ||||||
|  | @ -538,17 +544,17 @@ require('lazy').setup({ | ||||||
|       --  - settings (table): Override the default settings passed when initializing the server. |       --  - settings (table): Override the default settings passed when initializing the server. | ||||||
|       --        For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ |       --        For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ | ||||||
|       local servers = { |       local servers = { | ||||||
|         -- clangd = {}, |         clangd = {}, | ||||||
|         -- gopls = {}, |         gopls = {}, | ||||||
|         -- pyright = {}, |         pyright = {}, | ||||||
|         -- rust_analyzer = {}, |         rust_analyzer = {}, | ||||||
|         -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs |         -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs | ||||||
|         -- |         -- | ||||||
|         -- Some languages (like typescript) have entire language plugins that can be useful: |         -- Some languages (like typescript) have entire language plugins that can be useful: | ||||||
|         --    https://github.com/pmizio/typescript-tools.nvim |         --    https://github.com/pmizio/typescript-tools.nvim | ||||||
|         -- |         -- | ||||||
|         -- But for many setups, the LSP (`tsserver`) will work just fine |         -- But for many setups, the LSP (`tsserver`) will work just fine | ||||||
|         -- tsserver = {}, |         tsserver = {}, | ||||||
|         -- |         -- | ||||||
| 
 | 
 | ||||||
|         lua_ls = { |         lua_ls = { | ||||||
|  | @ -626,11 +632,11 @@ require('lazy').setup({ | ||||||
|       formatters_by_ft = { |       formatters_by_ft = { | ||||||
|         lua = { 'stylua' }, |         lua = { 'stylua' }, | ||||||
|         -- Conform can also run multiple formatters sequentially |         -- Conform can also run multiple formatters sequentially | ||||||
|         -- python = { "isort", "black" }, |         python = { 'isort', 'black' }, | ||||||
|         -- |         -- | ||||||
|         -- You can use a sub-list to tell conform to run *until* a formatter |         -- You can use a sub-list to tell conform to run *until* a formatter | ||||||
|         -- is found. |         -- is found. | ||||||
|         -- javascript = { { "prettierd", "prettier" } }, |         javascript = { { 'prettierd', 'prettier' } }, | ||||||
|       }, |       }, | ||||||
|     }, |     }, | ||||||
|   }, |   }, | ||||||
|  | @ -839,15 +845,15 @@ require('lazy').setup({ | ||||||
|   --  Uncomment any of the lines below to enable them (you will need to restart nvim). |   --  Uncomment any of the lines below to enable them (you will need to restart nvim). | ||||||
|   -- |   -- | ||||||
|   -- require 'kickstart.plugins.debug', |   -- require 'kickstart.plugins.debug', | ||||||
|   -- require 'kickstart.plugins.indent_line', |   require 'kickstart.plugins.indent_line', | ||||||
|   -- require 'kickstart.plugins.lint', |   require 'kickstart.plugins.lint', | ||||||
| 
 | 
 | ||||||
|   -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` |   -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` | ||||||
|   --    This is the easiest way to modularize your config. |   --    This is the easiest way to modularize your config. | ||||||
|   -- |   -- | ||||||
|   --  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 | ||||||
|  |  | ||||||
|  | @ -0,0 +1,12 @@ | ||||||
|  | return { | ||||||
|  |   'windwp/nvim-autopairs', | ||||||
|  |   -- Optional dependency | ||||||
|  |   dependencies = { 'hrsh7th/nvim-cmp' }, | ||||||
|  |   config = function() | ||||||
|  |     require('nvim-autopairs').setup {} | ||||||
|  |     -- If you want to automatically add `(` after selecting a function or method | ||||||
|  |     local cmp_autopairs = require 'nvim-autopairs.completion.cmp' | ||||||
|  |     local cmp = require 'cmp' | ||||||
|  |     cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done()) | ||||||
|  |   end, | ||||||
|  | } | ||||||
|  | @ -1,5 +1,70 @@ | ||||||
| -- You can add your own plugins here or in other files in this directory! | -- You can add your own plugins here or in other files in this directory! | ||||||
| --  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 informationc | ||||||
| return {} | return { | ||||||
|  |   { | ||||||
|  |     'christoomey/vim-tmux-navigator', | ||||||
|  |     lazy = false, | ||||||
|  |     cmd = { | ||||||
|  |       'TmuxNavigateLeft', | ||||||
|  |       'TmuxNavigateDown', | ||||||
|  |       'TmuxNavigateUp', | ||||||
|  |       'TmuxNavigateRight', | ||||||
|  |       'TmuxNavigatePrevious', | ||||||
|  |     }, | ||||||
|  |     keys = { | ||||||
|  |       { '<c-h>', '<cmd><C-U>TmuxNavigateLeft<cr>' }, | ||||||
|  |       { '<c-j>', '<cmd><C-U>TmuxNavigateDown<cr>' }, | ||||||
|  |       { '<c-k>', '<cmd><C-U>TmuxNavigateUp<cr>' }, | ||||||
|  |       { '<c-l>', '<cmd><C-U>TmuxNavigateRight<cr>' }, | ||||||
|  |       { '<c-\\>', '<cmd><C-U>TmuxNavigatePrevious<cr>' }, | ||||||
|  |     }, | ||||||
|  |   }, | ||||||
|  | 
 | ||||||
|  |   { | ||||||
|  |     'ThePrimeagen/harpoon', | ||||||
|  |     branch = 'harpoon2', | ||||||
|  |     opts = { | ||||||
|  |       menu = { | ||||||
|  |         width = vim.api.nvim_win_get_width(0) - 4, | ||||||
|  |       }, | ||||||
|  |       settings = { | ||||||
|  |         save_on_toggle = true, | ||||||
|  |       }, | ||||||
|  |     }, | ||||||
|  |     keys = function() | ||||||
|  |       local keys = { | ||||||
|  |         { | ||||||
|  |           '<leader>H', | ||||||
|  |           function() | ||||||
|  |             require('harpoon'):list():add() | ||||||
|  |           end, | ||||||
|  |           desc = 'Harpoon File', | ||||||
|  |         }, | ||||||
|  |         { | ||||||
|  |           '<leader>h', | ||||||
|  |           function() | ||||||
|  |             local harpoon = require 'harpoon' | ||||||
|  |             harpoon.ui:toggle_quick_menu(harpoon:list()) | ||||||
|  |           end, | ||||||
|  |           desc = 'Harpoon Quick Menu', | ||||||
|  |         }, | ||||||
|  |       } | ||||||
|  | 
 | ||||||
|  |       for i = 1, 5 do | ||||||
|  |         table.insert(keys, { | ||||||
|  |           '<leader>' .. i, | ||||||
|  |           function() | ||||||
|  |             require('harpoon'):list():select(i) | ||||||
|  |           end, | ||||||
|  |           desc = 'Harpoon to File ' .. i, | ||||||
|  |         }) | ||||||
|  |       end | ||||||
|  |       return keys | ||||||
|  |     end, | ||||||
|  |   }, | ||||||
|  |   { | ||||||
|  |     'ThePrimeagen/vim-be-good', | ||||||
|  |   }, | ||||||
|  | } | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue